It is because the order management section in void StartEA() iterates through the open trades, not all the symbols.hndymann wrote:I don't see why we are getting a div0 because of this, unless a function is trying to look up the pipfactor before the array is populatedSteveHopwood wrote:This sent me to look at my demo and the same thing.fmuir wrote:v1f also giving zero divide errors
I had been trying to use one of the fields in Baluda's symbolValues array that holds the pip factor for each symbol. This did not work when cycling through the list of trades to carry out management, so factor = 0 which caused the zero divide errors. I had to reintroduce the PFactor() function.
You cannot ignore these folks - the stop the EA from working. V 1g is in post 1 with the fix.
Originally, void GetMarketInfo(string symbol) did not include a pip factor calculation because this was always held in Paul's symbolValues array. The pip factor needs calculating afresh for each trade/symbol/whatever being examined each time it is examined.
So: the call to
Code: Select all
GetMarketInfo(OrderSymbol());//bid, ask , digits etcThe reason this error did not come to light before is: it only applied to profitable 10.2 trend trades, and there have been damn few of those so far.