//----- Martingaleif(Martingale == true)
{
//----- Calcuulate number of losses orders without a breakHistorySelect(0,TimeCurrent());
int Total = HistoryDealsTotal();
int Losses = 0; // Number of losses orders without a breakfor(i = 0;i < Total;i++)
{
ulong Ticket=HistoryDealGetTicket(i);
if(HistoryDealGetInteger(Ticket,DEAL_TYPE) < 2)
{
if(HistoryDealGetDouble(Ticket,DEAL_PROFIT)>0) break;
if(HistoryDealGetDouble(Ticket,DEAL_PROFIT)<0) Losses++;
}
if(Losses<=MaxLossTrade) TradeLot=(TradeLot*MathPow(LotMultiply,Losses));
else TradeLot=TradeLot;
}
}
//-----
First of all LR Correlation needs to be calculated. This is done in this library https://www.mql5.com/ru/code/1081
And then return this value via OnTester, like here https://www.mql5.com/ru/articles/286
bug - MathRound returns the type double instead of a logical integer.
in fact, it's still a bug - if we round a number, it should be an int. xD
See my similar question in the next thread.
See section about explicit type conversion.
bug - MathRound ...
An explicit type conversion helps from issuing warnings:
Help, it's not working, translated from 4.
Thank you.
From which line do the problems start and what exactly are they?
G001:
From which line do the problems start and what exactly are they?
In the strategy tester, it does not increase the lot size after a losing trade.
Once again, where do the problems start and what exactly are they?
Sorry, I don't know what to say, I don't know where the problem is, I know it doesn't do what I need it to do.
Sorry, I don't know what to say, I don't know where the problem is, I know it doesn't do what I need it to do.