Download MetaTrader 5

read parameters from common tab(Important)

To add comments, please log in or register
All activity of the MQL5.community members is displayed on a single page!
Mohammad Reza Mohammadi
1455
Mohammad Reza Mohammadi 2016.03.27 18:59 

Hi there

I want to read "only  long, only short, long & short" from Expert Advisors Properties\common tab and comment on the chart, but I don't know which function is doing this action. please guide me.

thanks 

Khurram Mustafa
27546
Khurram Mustafa 2016.03.27 21:29  
Mohammad Reza Mohammadi:

Hi there

I want to read "only  long, only short, long & short" from Expert Advisors Properties\common tab and comment on the chart, but I don't know which function is doing this action. please guide me.

thanks 

You mean you want to trade only sell or buy position or sell buy position??
Mehmet Bastem
607
Mehmet Bastem 2016.03.27 23:15  
Mohammad Reza Mohammadi:

Hi there

I want to read "only  long, only short, long & short" from Expert Advisors Properties\common tab and comment on the chart, but I don't know which function is doing this action. please guide me.

thanks 

ENUM_SYMBOL_TRADE_MODE

Identifier

Description

SYMBOL_TRADE_MODE_DISABLED

Trade is disabled for the symbol

SYMBOL_TRADE_MODE_LONGONLY

Allowed only long positions

SYMBOL_TRADE_MODE_SHORTONLY

Allowed only short positions

SYMBOL_TRADE_MODE_CLOSEONLY

Allowed only position close operations

SYMBOL_TRADE_MODE_FULL

No trade restrictions

 

Mohammad Reza Mohammadi
1455
Mohammad Reza Mohammadi 2016.03.28 08:21  
Khurram Mustafa:
You mean you want to trade only sell or buy position or sell buy position??
For example I selected only long from that path to take buy positions. I want to show my selection on the chart. for this action I must read it then comment it on the chart.
Mohammad Reza Mohammadi
1455
Mohammad Reza Mohammadi 2016.03.28 08:24  
Mehmet Bastem:

ENUM_SYMBOL_TRADE_MODE

Identifier

Description

SYMBOL_TRADE_MODE_DISABLED

Trade is disabled for the symbol

SYMBOL_TRADE_MODE_LONGONLY

Allowed only long positions

SYMBOL_TRADE_MODE_SHORTONLY

Allowed only short positions

SYMBOL_TRADE_MODE_CLOSEONLY

Allowed only position close operations

SYMBOL_TRADE_MODE_FULL

No trade restrictions

 

thank you but I know these parameters but I don't know how can read them from Common Tab. can you tell me which function can read that selection?
Marco vd Heijden
Moderator
4684
Marco vd Heijden 2016.03.28 10:40  
Comment(SymbolInfoInteger(Symbol(),SYMBOL_TRADE_MODE));
Khurram Mustafa
27546
Khurram Mustafa 2016.03.28 12:18  
Mohammad Reza Mohammadi:
For example I selected only long from that path to take buy positions. I want to show my selection on the chart. for this action I must read it then comment it on the chart.

1- you can program as by bool function  

2- Comment() use when you are opening  buy

Mohammad Reza Mohammadi
1455
Mohammad Reza Mohammadi 2016.03.28 14:55  
Marco vd Heijden:
thank you, but this code only returns "2". 
To add comments, please log in or register