Maximum value for setting the stop loss and take profit

 

Hello all, who haven't seen today.

The question is as follows:

how do I limit the setting of the stoploss to the maximum value?

I.e. which function is responsible for setting the maximum possible stoploss or takeprofit?


here is an example:



opening price 14,690 stoploss at 3900000000014,xxx - does not pass. Says stoploss is wrong.

how do I know the maximum stoploss?


You say:

-Да ты поехал, зачем такой стоп ставить?

-I agree, but it's not me who sets such a stoploss.

 
Vladislav Andruschenko:

Hello all, who haven't seen today.

The question is as follows:

how do I limit the setting of the stoploss to the maximum value?

I.e. which function is responsible for setting the maximum possible stoploss or takeprofit?

here is an example:


opening price 14,690 stoploss at 3900000000014,xxx - does not pass. Says stoploss is wrong.

how do I know the maximum stoploss?


You tell me:

Didn't check, but most likely the maximum possible value is "double".

Документация по MQL5: Основы языка / Типы данных / Вещественные типы (double, float)
Документация по MQL5: Основы языка / Типы данных / Вещественные типы (double, float)
  • www.mql5.com
Вещественные типы (или типы с плавающей точкой) представляют значения, имеющие дробную часть. В языке MQL5 есть два типа для чисел с плавающей точкой. Способ представления вещественных чисел в машинной памяти определен стандартом IEEE 754 и не зависит от платформ, операционных систем и языков программирования. Константы с плавающей точкой...
 
Once upon a time I tried to find the answer to this question. I think there's just a limit to the number of pips from the opening price. It should not be more than UINT_MAX
 
Vitaly Muzichenko:

Didn't check, but most likely the maximum possible value is "double".


no it doesn't work.

I specify the maximum double - position does not open. Invalid Stops

 
Ihor Herasko:
Once upon a time I tried to find the answer to this question. I think there's just a limit to the number of pips from the opening price. It should not be more than UINT_MAX


only fits

999999999

Eurobucks opens


 

An exotic task you have. Try to get it this way:


double point = SymbolInfoDouble(Symbol(),SYMBOL_POINT);

MqlTick lastTick;
SymbolInfoTick(Symbol(),lastTick);

int maxDistance = lastTick.ask/point;

Wat?

Vladislav Andruschenko:


fits only

999999999

on eurobucks opens


 

The maximum is non-existence, i.e. 0 (where else?),

as experimenting to find a specific maximum value makes no practical sense.

 

Can't the moderators see that this user is always looking for any excuse to show off and now opens a thread with such a question.

I never thought anyone would ask such a question, especially since some even try to answer it.

 
Petros Shatakhtsyan:

Can't the moderators see that this user is always looking for any excuse to show off and now opens a thread with such a question.

I never thought anyone would ask such a question, especially as some even try to answer it.

Petros, there are plenty of posts and threads like this.

People are beginning to delve into such thickets, it's amazing.

However, they do not ask the question - "Why do I need it?

 
Petros Shatakhtsyan:

Can't the moderators see that this user is always looking for any excuse to show off and now opens a thread with such a question.

I never thought anyone would ask such a question, especially since some are even trying to answer it.


I think you have an obsession.

I open as many threads as I want.

I started it because the marketplace somehow sets a stoploss that exceeds 999999999 and outputs an error Invalid Stoploss.


Be envious in silence, please. Do not touch me.

If you do not succeed with your products - do not throw your tantrums on me. I am fed up with it.

 
Renat Akhtyamov:

The maximum is non-existence, i.e. 0 (how much more?),

As experimenting to find a specific maximum value makes no sense in practice.


that's the point.

It doesn't make sense in practice, but it does in the marketplace. That's why I asked how you can find out the maximum value. to which it is attached.