it's not limit the level lot.. he still open with double lot every get sl from 0.1, 0.2, 0.4, 0.8, 1.6, 3.2......
should until 0.4 if 3 level lot that wanted.. even get sl on level 3 lot, it will open using lot from 0.1 again..but it increment again untill profit..
gjol.. maybe u add something code in the other place..
this is my code :
externdouble TakeProfit = 50;
externdouble StopLoss = 50;
externdouble Lots = 0.1;
int OT;
double OL;
string _symbol;
int Magic = 12345;
double Pip;
int init()
{
Pip = Point;
//----if(Digits==3||Digits==5)
{
Pip*=10;
TakeProfit *= Pip;
StopLoss *= Pip;
}
}
int start()
{
//----
CheckIfOrderEarned();
//-----if(OrdersTotal()<1) {
if (High[0]<High[1])
{
int ticket=OrderSend(Symbol(),OP_BUY,Lots,NormalizeDouble(Ask,4),3,Ask-StopLoss*Point,Ask+TakeProfit*Point,"",Magic,Green) ;
}
}
//----return(0);
}
//+------------------------------------------------------------------+void CheckIfOrderEarned()
{
int i=OrdersHistoryTotal()-1;
//----OrderSelect(i,SELECT_BY_POS,MODE_HISTORY);
{
OT = OrderType();
OL = OrderLots();
_symbol = OrderSymbol();
double OP = OrderProfit();
if (OrderMagicNumber() == Magic)
{
if (OrderProfit() < 0&& OrderLots() < NormalizeDouble(Lots*3,2))
{
Lots = NormalizeDouble(OL*2, 2);
}
else
{
Lots = 0.1;
}
}
}
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
i'm sorry i checked both examples & it's working just fine
1)
2)
it's not limit the level lot.. he still open with double lot every get sl from 0.1, 0.2, 0.4, 0.8, 1.6, 3.2......
should until 0.4 if 3 level lot that wanted.. even get sl on level 3 lot, it will open using lot from 0.1 again..but it increment again untill profit..
gjol.. maybe u add something code in the other place..
this is my code :
maybe miss something..