Advertisement
Guest User

Untitled

a guest
Nov 27th, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1.  
  2. #property copyright "sample"
  3. #property link "http://sample.sample"
  4. #property version "1.00"
  5. #property indicator_buffers 7
  6. #property strict
  7. #property indicator_chart_window // or indicator_separate_window
  8. #property indicator_plots 3 //How Many Plots
  9.  
  10. input int Periods=13;
  11. double MyBuffer[];
  12. int OnInit()
  13. {
  14. SetIndexBuffer(0,MyBuffer,INDICATOR_DATA);
  15. return(INIT_SUCCEEDED);
  16. }
  17.  
  18. int OnCalculate(const int rates_total,
  19. const int prev_calculated,
  20. const datetime &time[],
  21. const double &open[],
  22. const double &high[],
  23. const double &low[],
  24. const double &close[],
  25. const long &tick_volume[],
  26. const long &volume[],
  27. const int &spread[])
  28. {
  29. int first=Periods+2; if(prev_calculated > 0 ) { first = prev_calculated-1; }
  30.  
  31. for(int bar = 0; bar < rates_total-first; bar++){ // main loop of the calculation
  32. MyBuffer[bar]= (2 / Periods);
  33. }
  34. return(rates_total);
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement