You cannot add values to a dimensionless array. You passed a dimensionless array into your function, but you set the size -after- putting all the items into it.
(1) The expedient way to do this is to statically fix array to a large enough size ahead of time.
double array[1000]; // size to a large enough value
(2) Another way is to call ArrayResize(pl_results, counter + 1) before each time you add the next deal_profit value. The downside of this is you could run into performance issues for large numbers. You can run the Profiler to see if that matters to you. You could always improve the performance by allocating blocks instead of singles ahead of time.
(3) A third way is to use dynamic arrays. See CArrayDouble
for more information.

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 would like some help trying to find out how many weeks are profitable after a backtest is made, i usually do 20 weeks backtest, I tried to build an array of profits and dates like OnTester documentation article, after that I tried split these results on another week array with no luck, any suggestion will be appreciated.