one to one coaching

Add Min Max Lots Code

MinLots and MaxLots
In the extern parameters, add :

Code:

extern double MinLots=0.01;
extern double MaxLots=100;

Before the OrderSend functions add :

Code:

if(Lots<MinLots)Lots=MinLots;
if(Lots>MaxLots)Lots=MaxLots;

Of course, Lots should be replaced by your Lots parameter's name.
 

Tech_fx

New member
extern double MinLots=0.01;
extern double MaxLots=100;
//------ calc Lot func befor SendOrder()
string smbl = OrderSymbol();
double minLot = MarketInfo(smbl,MODE_MINLOT);
double maxLot = MarketInfo(smbl,MODE_MINLOT);
if(Lots<MinLots) Lots=MathMax(minLot,MinLots);
if(Lots>MaxLots) Lots=MathMin(maxLot,MaxLots);
 
one to one coaching
Top