Quote:
|
Originally Posted by efextrader
Im backtesting this version as suggested by one member on H4 charts...it starts off very well...then suddenly Journal says (100s of reports)
"zero divide"
It wont go further in the backtest.
Im sure someone here can find the coding error and post the edited version.
Ill then test it on a 4hr chart forward and backward.
thanks in advance
|
Change this line:
AveragePrice=AveragePrice/total;
to this:
if (OrdersTotal() > 0)
AveragePrice=AveragePrice/total;