Lot increment is failing when Martingale < 1.5
Comment("Next BUY order at ",NextLong);
Print("OrderSend BUY error ",GetLastError());
Anyone knows how to fix that?
1. Code doesn't work because failing in two or three issues.
2. I think the function doesn't store decimal values below the rounding up point.
3. This OrderSend fit my needs, and the world will see when expert's working.
rounding means a values of 0.010000 to 0.0149999999 rounds down to 0.01 (for 2 digits)
rounding means a values of 0.015000 to 0.0199999999 rounds up to 0.02 (for 2 digits)
so if you use a martingale multiplier less then 1.5 and your previous lot size is 0.01 then your lot size will always be stay at 0.01.
example 0.01, then next lot size will be 0.01 and so on we go.
change your starting lot to 0.02 and you'll see that it works.
now the following is wrong
change this to something more intelligent so that it works starting at 0.01 also
double GridLots=NormalizeDouble(InitialLotSize * MathPow(Martingale, ExistingOpenOrderCount), 2)
you will need to calculate the value ExistingOpenOrderCount
Ok I got it, the MathPow formula is right.
But now it seems to be a problem in OrdersCount as I don't get the values exactly as in the excel sheet.
When SellOrders() is: