Rating: Empty Star Empty Star Empty Star Empty Star Empty Star
script for avoiding lots bigger than 'X'
adriandd

Member Since Oct 29, 2014  3 posts adriandd Dec 22 2017 at 11:07
I was writing a code because I want to set a maximum lot. I mean a script for avoiding lots bigger than 1, for example. When I compile the system says 'semicolon expected'. I post de code base in case someone can help me.

I someone know an indicator for what I said....

Thanks!!

extern bool MM = TRUE;
extern double Risk = 2;
extern double Lots = 0.1;
extern double LotDigits =2;
extern double MaxLots =1;
double GetLots()

void Start()
 {
double minlot = MarketInfo(Symbol(), MODE_MINLOT);
double maxlot = MarketInfo(Symbol(), MODE_MAXLOT);
double leverage = AccountLeverage();
double lotsize = MarketInfo(Symbol(), MODE_LOTSIZE);
double stoplevel = MarketInfo(Symbol(), MODE_STOPLEVEL);

 
double MinLots = 0.01; double MaximalLots = 2.0;
{
    if(MM)
    
  

    double Lots = NormalizeDouble(AccountFreeMargin() * Risk/100 / 1000.0, LotDigits);
   
    if (AccountFreeMargin() < Ask * lots * lotsize / leverage)
    
    
       return (result);
    }
    }
    //+------------------------------------------------------------------+

Please login to comment.
4-Week Bill Auction (30 min)
The Ratings Game: Netflix is still a top...(4 min ago)
EURUSD 1.15633 GBPUSD 1.31701
USDJPY 109.847 USDCAD 1.32724

Tools

Community

Reviews

Brokers

Platform

Support


Twitter |  Facebook |  Site Map  |  Terms  |   Privacy Policy
©2014 Myfxbook Ltd. All Rights Reserved.
HIGH RISK WARNING: Foreign exchange trading carries a high level of risk that may not be suitable for all investors. Leverage creates additional risk and loss exposure. Before you decide to trade foreign exchange, carefully consider your investment objectives, experience level, and risk tolerance. You could lose some or all of your initial investment; do not invest money that you cannot afford to lose. Educate yourself on the risks associated with foreign exchange trading, and seek advice from an independent financial or tax advisor if you have any questions. Any data and information is provided 'as is' solely for informational purposes, and is not intended for trading purposes or advice.