- Strona główna
- Społeczność
- Programowanie
- script for avoiding lots bigger than "X"
Advertisement
Edit Your Comment
script for avoiding lots bigger than "X"
Dec 22, 2017 at 11:07
Uczestnik z Oct 29, 2014
3 postów
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);
}
}
//+------------------------------------------------------------------+
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);
}
}
//+------------------------------------------------------------------+

*Komercyjne wykorzystanie i spam są nieprawidłowe i mogą spowodować zamknięcie konta.
Wskazówka: opublikowanie adresu URL obrazu / YouTube automatycznie wstawi go do twojego postu!
Wskazówka: wpisz znak@, aby automatycznie wypełnić nazwę użytkownika uczestniczącego w tej dyskusji.