Stoplevel is always 0 (demoAccount)

 

Hi,

I got some troubles calculating the StopLevel - here is my code:


double currPrice = SymbolInfoDouble(_Symbol,SYMBOL_ASK);
double point = SymbolInfoDouble(_Symbol,SYMBOL_POINT);
double stopLevel = SymbolInfoInteger(_Symbol,SYMBOL_TRADE_STOPS_LEVEL) * point;
double stopPrice = currPrice + stopLevel;


I don't think there is an error in the code (taken from Andrew R. Youngs MQL5 Book).

Can it be that the stopLevel for my demo-account (FXCM-MT5Demo01) is set to 0 on purpose (to ensure better expirience for the trader or so) ? Or am i doing something wrong ?


Greetings,

Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Symbol Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Symbol Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Symbol Properties - Documentation on MQL5
 
Distinctive:

Hi,

...

I don't think there is an error in the code (taken from Andrew R. Youngs MQL5 Book).

Can it be that the stopLevel for my demo-account (FXCM-MT5Demo01) is set to 0 on purpose (to ensure better expirience for the trader or so) ? Or am i doing something wrong ?


Greetings,

SYMBOL_TRADE_STOPS_LEVEL is set by broker and can be 0. It is up to you to adpat your code to manage this fact.

This may help you.

 
Distinctive:

Hi,

I got some troubles calculating the StopLevel - here is my code:


double currPrice = SymbolInfoDouble(_Symbol,SYMBOL_ASK);
double point = SymbolInfoDouble(_Symbol,SYMBOL_POINT);
double stopLevel = SymbolInfoInteger(_Symbol,SYMBOL_TRADE_STOPS_LEVEL) * point;
double stopPrice = currPrice + stopLevel;


I don't think there is an error in the code (taken from Andrew R. Youngs MQL5 Book).

Can it be that the stopLevel for my demo-account (FXCM-MT5Demo01) is set to 0 on purpose (to ensure better expirience for the trader or so) ? Or am i doing something wrong ?


Greetings,

STOPS_LEVEL  !=  your chosen StopLoss,  it governs where your Stop Loss can be but does not determine it.

This may help,  it was written for MT4 but I think it also applies to MT5:   Requirements and Limitations in Making Trades

Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
  • book.mql4.com
Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
 
angevoyageur:

SYMBOL_TRADE_STOPS_LEVEL is set by broker and can be 0. It is up to you to adpat your code to manage this fact.

This may help you.

Many thanks - that helps me.

@RaptorUK: I know that the STOPS_LEVEL does not determine the stoploss but sets the minimal difference to the Open-Price.

Thanks anyways :)

Reason: