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

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....


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;

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

Please login to comment.
PPI Core Output (MoM) n.s.a (5 min)
EUR futures: neutral/bullish in the shor...(2 min ago)
EURUSD 1.171 GBPUSD 1.31685
USDJPY 112.352 USDCAD 1.29492







Twitter |  Facebook |  Site Map  |  Terms  |   Privacy Policy
©2018 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. Past performance is not indicative of future results.