Download MetaTrader 5

How to Set (by Script), the Long & Short, Only Long or Only Short options, when i run an EA?

To add comments, please log in or register
willimar
9
willimar  
Hi,

I would like to know if is there a way to Set (by Script) the Long & Short, Only Long or Only Short options, when the EA is loaded...


I tried to do this Saving 3 Templates, each one with one of these options selected (Long & Short, Only Long, Only Short). When i looked in those files, i noticed a difference on the parameter FLAGS, with the values (343 - Long & Short, 342 - Only SHort, and 341 - Only Long)

The problem is, when a use the Template manually, the EA is loaded fine, with the Option set correctly (Long & Short, Only Long or Only Short), according the file. It doesn't matter if the Template was made manually, or using the function ChartSaveTemplate...

But, when a try to load those same templates, using the funcion ChartApplyTemplate, the EA is Loaded, by always using the Long & Short Option set...The parameter FLAGS is ignored...

I need this, because i will have an EA controlling another one... And of course, one of them was not wrote by me...


I'm using MQL4...


Anyone can help me out?

Tks
To add comments, please log in or register