How to Access Common Parameters

 

HI Experts

I am new to MQL4 Programming, and trying to learn it, while writing my own EA, I am trying to access the EA common parameters which are shown when you attach an EA to a chart (as shown in screenshot), specially for positions, like if someone had set to open positions for Long only, I want to check that in my EA code and dont want to open Short positions, as I am wiring program for Swing Trading.

Files:
 
Nilesh Toshniwal: I am trying to access the EA common parameters 

Did you bother to look at available constants and find any?
          List of MQL4 Constants - MQL4 Reference

 

Thanks for your quick response, yes I did and tried code like 


bool shortonly = SymbolInfoInteger(Symbol(),SYMBOL_TRADE_MODE_SHORTONLY);

but I get error as:

'SYMBOL_TRADE_MODE_SHORTONLY' - improper enumerator cannot be used

 
Nilesh Toshniwal:

Thanks for your quick response, yes I did and tried code like 


but I get error as:

'SYMBOL_TRADE_MODE_SHORTONLY' - improper enumerator cannot be used

You missed this sentence in the documentation:

*These values are not used in MQL4 (added for compatibility with MQL5).

Reason: