try
for(i=70; i>=0; i--) // 70 = Limit { if(Close[i+0]>Close[i+1] && Open[i+0]>Close[i+1] && Open[i+0]>Open[i+1] ) { up[i+0]=High[i+0]-100*Point; } else if(Close[i+0]<Close[i+1] && Close[i+1]>Open[i+0]&& Open[i+0]<Open[i+1] ) { dn[i+0]=Low[i+0]+100*Point; } else dn[i+0]= EMPTY_VALUE; } 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
This is a small code to identify in a specific way Gap formation (as per my definition :) )
I've tried to delete the arrows after the identified GAP is closed. -The GAP is considered closed if any candle (high/low) reaches the gap-
after introducing else if dn[i+0] = 0 & up[i+0] = 0, the logic is messed up !
appreciate if you could guide on way forward to delete the arrow if GAP is closed & leave the other arrows until price closes them.
cheers