Try putting ArraySetAsSeries before CopyBuffer maybe that helps.
-
ASAS before filling, as the example shows.
-
Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
Messages Editor
Hey Dan
I had a very similar issue to yours hopefully the resolution might help.
Problem: My Ichimoku indicator function was created with a function for each individual componant (i.e. TenkanSen, KijunSen etc.). My other functions worked fine but I could not get the right results for the ChikouSpan Value.
Resolution:
What I found to work was increasing the 'start_pos' parameter for the CopyBuffer() function by 1 so in your case it could be:
if(CopyBuffer(Ichimoku_handle_Long, CHIKOUSPAN_LINE, 27, 200, Ichimoku_Chikou_Long) <= 0)
So I think it works like the following
Candle 0 = 26 bars back
Candle 1 = 27 bars back
Candle 2 = 28 bars back and so on
I think its how the indicator counts 26 candles back. I think it starts '1' as the next completed candle and not the current candle.
Any ways i tested this on my indicator and it worked finally - came back with the correct values.
Good luck and I hope this helps
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
I noticed something strange thinks When I try to get the value of the Chikouspan 26 bars before. It only works in live mode correct.
But not in the backtester. In Backtester i get strange Values.
I use this Code for geting the Value :
Has enyone the same Problem ?
How can i get the correct Value for the Chikouspan Line 26 Bars bevor ?