Correct simple one (if someone know the name of this, please, tell me):
#property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Red #property indicator_width1 1 //---- input parameters extern int PERIOD =12; //---- indicator buffer double Buffer[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { SetIndexBuffer(0,Buffer); SetIndexStyle(0,DRAW_LINE); } //+------------------------------------------------------------------+ int start() { int i=Bars-1-IndicatorCounted(); //---- while(i>=0) { Buffer[i]=Buffer[i+1]+(Close[i]-Close[i+PERIOD])/PERIOD; i--; } //---- //---- return(0); } //+------------------------------------------------------------------+
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
What is the problem here (last bar do not draw):