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
Sorry, but I can not understand the logic of your indicator. (It should be short sentences and pictures).
As you can see, there are two parts:
1. named //new bar - draw indicator on new bar if xyz - in real time, normal work
2. named //History - draw indicator on the bar [i] when bar [i+1] like xx && bar [i+2] like xyz... where bar[i] is any bar related to its bars [i+1], [i+2]....Forget point 1. I just wont to print signal on every candle where second previous candle was down. Not in real time but for all in history of a chart.
As you can see, there are two parts:
1. named //new bar - draw indicator on new bar if xyz - in real time, normal work
2. named //History - draw indicator on the bar [i] when bar [i+1] like xx && bar [i+2] like xyz... where bar[i] is any bar related to its bars [i+1], [i+2]....Forget point 1. I just wont to print signal on every candle where second previous candle was down. Not in real time but for all in history of a chart.
Let us simplify the code:
and
It works. We verify the second bar. And draw on the second bar.
It works but not as it should.
1. it draws on bar [i+2] not on the bar [i]. In other words we wont: "Show on bar [i] if bar [i+2] was down".
2. it draws in present time not on the history.
The goal is to click compile on the clear chart and in that moment have a chart full of indicators like this
(the picture does not show our test conditions, it ilustrate the effect of calculations on history made in the moment of compilation)
It works but not as it should.
1. it draws on bar [i+2] not on the bar [i]. In other words we wont: "Show on bar [i] if bar [i+2] was down".
....
You could:
OK, but what about real formulas when we calculate together [i+1] [i+2] [i+3] ?
My oryginal code draw labels on real time (although I am not sure that calculate correct - another problem)
Now the problem is that my code draw on historical but only when condition is if (Close[i]<Open[i])
Does not draw when if (Close[i+2]<Open[i+2])
Does not draw when if (Close[2]<Open[2])
That is the point.
Your indicators creates a lot of objects. It is better to go to DRAW_ARROW.