Luandre Ezra: My attempt is to count the bar using this code:
The logic behind this is that the code will count the bar from bar 0 to bar shift (in this case is 25 since bar is counted from 0).
- Your function is equivalent to just shift (the value passed). Counting from zero through shift is shift.
- We have no idea what your chikouSpan() is.
How To Ask Questions The Smart Way. 2004
Be precise and informative about your problem - If a bar had already touched the indicator, you would have already closed the order. Therefor all you need to do is test if the last bar is touching.
We have no idea what your chikouSpan() is.
Chikou span is the price line that is shifted 26 bars to the left.
If a bar had already touched the indicator, you would have already closed the order. Therefor all you need to do is test if the last bar is touching.
I tried to put a print statement when the code but the result is the same, nothing happened. I don't know if it's because of the price line is a number and bars is not a number value that the code doesn't recognize the syntax. Basically that part of code never run.
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
Hi all,
I want to create an EA based on ichimoku strategy. My problem lies when I want to close the open order. The strategy is when the chikou span or lagging indicator touches the bar then the open order will be close.
My attempt is to count the bar using this code:
the logic behind this is that the code will count the bar from bar 0 to bar shift (in this case is 25 since bar is counted from 0).
then I use this code to close the order
The code never close the order and the order is open until back testing is over. I hope someone can help me how to make this works.
Thank you.