MaxLot

Created at 03 Feb 2015, 12:58
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
KA

kamol

Joined 03.02.2015

MaxLot
03 Feb 2015, 12:58


Hi

Could anyone write (or convert from MQL) MaxLot indicator?


MQL indicator

void start()
{
   double minlot = MarketInfo(Symbol(),MODE_MINLOT);
   double maxlot = MarketInfo(Symbol(),MODE_MAXLOT);

   double Accounfreemargin  = AccountFreeMargin();
   double MarginRequired    = MarketInfo(Symbol(),MODE_MARGINREQUIRED);
   double count      = 1/minlot;
   
   double ML = Accounfreemargin/MarginRequired;
   if(ML>maxlot) ML=maxlot;
   
   double MaxLot = MathFloor(ML/minlot)*minlot;
}


@kamol
Replies

Spotware
10 Feb 2015, 10:21

Dear Trader,

For converting the above code you need to use the Account object and the Symbol object. 

Hope this helps. If it doesn't help, please contact one of our Partners or post a job in Development Jobs section.


@Spotware