I know this is way late, but I think if you shift your senkou spans 26 places, you should get the current bar's kumo (or, the kumo that the bar 26 bars back predicted for this bar).
Senkouspana = iIchimoku(NULL,0,9,26,52,MODE_SENKOUSPANA,26); Senkouspanb = iIchimoku(NULL,0,9,26,52,MODE_SENKOUSPANB,26);
I am not a pro, but I think this should work! I hope it helps anyone with this problem in the future.
- jdgibbons88 #: I am not a pro, but I think this should work! I hope it helps anyone with this problem in the future.
Invalid call for MT4. This is the MT4 forum.
- 150070:
if ((Open[1] < KumoTop) && (Open[1] > KumoBottom) && (Close[1] > KumoTop)) { priceBreakLong = true; } else if ((Open[1] > KumoBottom) && (Close[1] < KumoTop) && (Close[1] < KumoBottom)) { priceBreakShort = true;
Do you ever set the variables to false?
priceBreakLong = Open[1] < KumoTop && Open[1] > KumoBottom && Close[1] > KumoTop; priceBreakShort = Open[1] > KumoBottom && Close[1] < KumoTop && Close[1] < KumoBottom;
Why are you using open in one and close in the other?
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, I'm playing around with using the Ichimoku indicator on my EA but have ran into an issue when opening a trade based on the value of the Senkou Span lines.
Basically I want to open a Buy order when the price opens inside the kumo cloud, then closes above it. Then I want to open a sell order when the price opens inside the kumo cloud, then closes below it. Basically simulating a breakout strategy.
I run this function in the onTick() function.
Then trigger the order depending on whether priceBreakLong() or priceBreakShort() are true.
The problem I have (and it's reaaally annoying me) is that the EA is opening/closing trades based on the values of the Senkou Span 26 periods ahead, not of the current candle. When ran in visual mode the price is nowhere near the cloud when the trades are actioned as can be seen in the attached picture.
I know it's probably a very simply mistake, but I really can't work out what I'm doing wrong!
Any help would be greatly appreciated!