Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #property copyright "sample"
- #property link "http://sample.sample"
- #property version "1.00"
- #property indicator_buffers 7
- #property strict
- #property indicator_chart_window // or indicator_separate_window
- #property indicator_plots 3 //How Many Plots
- input int Periods=13;
- double MyBuffer[];
- int OnInit()
- {
- SetIndexBuffer(0,MyBuffer,INDICATOR_DATA);
- return(INIT_SUCCEEDED);
- }
- int OnCalculate(const int rates_total,
- const int prev_calculated,
- const datetime &time[],
- const double &open[],
- const double &high[],
- const double &low[],
- const double &close[],
- const long &tick_volume[],
- const long &volume[],
- const int &spread[])
- {
- int first=Periods+2; if(prev_calculated > 0 ) { first = prev_calculated-1; }
- for(int bar = 0; bar < rates_total-first; bar++){ // main loop of the calculation
- MyBuffer[bar]= (2 / Periods);
- }
- return(rates_total);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement