EA's properties (allow live trading) when using the OpenChart() function are wrong

 

Hi,

when I open a chart with the OpenChart() function the checkbox "allow live trading" in my EA's properties is always disabled. But when I open a new chart manually, the EA's properties are correct and live trading is allowed.

I don't understand that because the function OpenChart() uses the default template which works fine manually.

Can anyone help me?

 
Marbo:

Hi,

when I open a chart with the OpenChart() function the checkbox "allow live trading" in my EA's properties is always disabled. But when I open a new chart manually, the EA's properties are correct and live trading is allowed.

I don't understand that because the function OpenChart() uses the default template which works fine manually.

Can anyone help me?

https://docs.mql4.com/chart_operations/chartapplytemplate

"Live trading and DLL imports permissions cannot be extended for the Expert Advisors launched by applying the template using ChartApplyTemplate() function."

My guess is that it also applies to opening new chart with default template using ChartOpen() (but I may be wrong).

ChartApplyTemplate - Chart Operations - MQL4 Reference
ChartApplyTemplate - Chart Operations - MQL4 Reference
  • docs.mql4.com
Applies a specific template from a specified file to the chart. The command is added to chart message queue and executed only after all previous commands have been processed. The Expert Advisor will be unloaded and will not be able to continue operating in case of successful loading of a new template to the chart it is attached to. Live Trading...
 
Marcin Madrzak:

https://docs.mql4.com/chart_operations/chartapplytemplate

"Live trading and DLL imports permissions cannot be extended for the Expert Advisors launched by applying the template using ChartApplyTemplate() function."

My guess is that it also applies to opening new chart with default template using ChartOpen() (but I may be wrong).

No, I think you are right. That makes sense. Ok, then I know there is no option/checkbox I have forgotten to click in the MT4 options.

Thank you!

Reason: