Errors, bugs, questions - page 2135

 

Trailing in EA works on all currencies/commodities, BUT:

SILVER,H1: invalid stoploss for OrderModify function

Please advise where to look?

 
Igor Golieniev:

Trailing in EA works on all currencies/commodities, BUT:

SILVER,H1: invalid stoploss for OrderModify function

Please advise where to look?


SYMBOL_TRADE_TICK_SIZE

Minimum price change

double

 
Vladislav Andruschenko:


SYMBOL_TRADE_TICK_SIZE

Minimum price change

double

Thank you. How do I set the tick size explicitly? For Silver/.
 
Igor Golieniev:
Thank you. How do I set the tick size explicitly? For Silver/


You cannot set it, the broker sets it.

You need to "calibrate" your stops to the size of the tick

 
Vladislav Andruschenko:


You cannot set it, the broker sets it.

You need to "unstop" your stops by the size of the tick

Before sending an order for modification, it prints stoploss = 15.15 - two digits.

Can it be corrected in a simple way? Forced to output triple digits.

 

Hi all, can you tell me what kind of magic is going on in MQL5.


This code will wait for a new tick to be calculated:


int TakeArraySize(datetime time)

{

   MqlRates rates[];

   int Arr1 = CopyRates(_Symbol, PERIOD_CURRENT, time, time, rates);

   Print("Время: ", TimeToString(time), " Скопировано ", Arr1 ," баров");

   // Тут мы будем ждать следующий тик и не будем выходить из функции;

   int Arr2 = CopyRates(_Symbol, PERIOD_CURRENT, time+60, time+60, rates);

   Print("Время: ", TimeToString(time), " Скопировано ", Arr2 ," баров");

   return (Arr2 );

}


And this code will be executed normally during one tick:


int TakeArraySize(datetime time)

{

   MqlRates rates[];

   int Arr1 = CopyRates(_Symbol, PERIOD_CURRENT, time, time, rates);

   Print("Время: ", TimeToString(time), " Скопировано ", Arr1 ," баров");

   // А этот код работает и не ждет следующий тик.

   MqlRates rates1[];

   int Arr2 = CopyRates(_Symbol, PERIOD_CURRENT, time+60, time+60, rates1);

   Print("Время: ", TimeToString(time), " Скопировано ", Arr2 ," баров");

   return (Arr2 );

}


Oh, yeah, even if we just call"TakeArraySize" twice in a row (like in the next code snippet), we'll still wait for one tick


int TakeArraySize(datetime time)

{

   MqlRates rates[];

   int Arr1 = CopyRates(_Symbol, PERIOD_CURRENT, time, time, rates);

   Print("Время: ", TimeToString(time), " Скопировано ", Arr1 ," баров");

   return (Arr1);

}

What's the catch? How can this be fixed? Or what am I doing wrong in this example?

Thanks in advance.

 

What characters are allowed in the"Symbol" field? Otherwise, what characters can be found in the names of currency pairs that are exposed by the broker?

(0-9)

(a-z)

(A-Z)

(.)

(&)

any others?

 
Pavel Kolchin:

What characters are allowed in the "Symbol" field? Otherwise, what characters can be found in the names of currency pairs that are exposed by the broker?

(0-9)

(a-z)

(A-Z)

(.)

(&)

any others?

#

$

_ (underscore)
 
OrderStopLoss() outputs two decimal places. Can I force it to output three decimal places?
 
Igor Golieniev:

Why?

Reason: