I don't understand why do you so complicate everything, for example:
a= (Low[i]-last)/(pipstep*Point); b= (High[i]-last)/(pipstep*Point); if(last+b*pipstep*Point-Close[i]>=Close[i]-a*pipstep*Point-last) ExtMapBuffer1[i] = last+a*pipstep*Point; else ExtMapBuffer1[i] = last+b*pipstep*Point;you could code as:
if(High[i]-Close[i]>=Close[i]-Low[i]) ExtMapBuffer1[i] = Low[i]; else ExtMapBuffer1[i] = High[i];

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
here is my indicator code i tried to create, and it doesn't work. please help me find out what is the matter with the code.
here is the code
the code of this indicator try to draw a line looks like zigzag. but is not same as the zigzag. this indicator start from the fisrt bar, and set the firstbar's openprice as the first price point. from left to right, if the next bar is over the first point above pipstep point, we will draw that point, some time the price bar may contain over 1 points that is over pipstep point. then we will choose the point wich is near the close price.
example the first open price that is the fisrt point of the indicator too, is 1.000 if the next bar is high 1.030 low 1.010 pipstep is 20. then this bar 's indicator's value will be 1.020.
if the next bar is high 1.001 low 1.010 the bar's indicator's value will be nothing.
if the next bar is high 1.0067 low 1.0020 then we will find out which point is near close price. if close price is 1.0060, then the indicator's value will be 1.0060 if the close price is 1.0042 then we will set the indicator's value 1.0040. please reference my code and understand it. if you need more information please post .
thank s for any help.