Charles Stangor:
Your code is correct. You have to check the buy_ and _sell variable to be sure the copy was done without error. Then you can use your buys[] and sells[] array.Am I doing this right at all?
How do I get the right value for num_bars to assure that the called indicators always line up with the correct bars in the series?
The problem is that the indicators don't come with dates.
Or perhaps there is an entirely different way?
Thanks.
If you want access these arrays as series, you need to use ArraySetAsSeries(). Then they will line up, no need for dates.
Alain Verleyen:
Your code is correct. You have to check the buy_ and _sell variable to be sure the copy was done without error. Then you can use your buys[] and sells[] array.
If you want access these arrays as series, you need to use ArraySetAsSeries(). Then they will line up, no need for dates.
Thank you Alain. ArraySetAsSeries() seems perfect. So many useful functions in mql5 :)
Your code is correct. You have to check the buy_ and _sell variable to be sure the copy was done without error. Then you can use your buys[] and sells[] array.
If you want access these arrays as series, you need to use ArraySetAsSeries(). Then they will line up, no need for dates.
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
Am I doing this right at all?
I have an indicator (it's BrainTrend2Sig from the codebase).
It outputs a buyarray[] and a sellarray[]
In my EA I first link to that indicator
Then in OnTick() I call for the arrays.
int buy_ = CopyBuffer(indicator_handle,0,0,num_bars,buys);
int sell_ = CopyBuffer(indicator_handle,1,0,num_bars,sells);
How do I get the right value for num_bars to assure that the called indicators always line up with the correct bars in the series?
The problem is that the indicators don't come with dates.
Or perhaps there is an entirely different way?
Thanks.