Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Trades are totally independent of the time-frame. There is no need to change the time-frame of the chart.
Your EA can access data from any time-frame simultaneously, independent of what the chart's current time-frame may be.
Forcing a time-frame change on the chart will cause you EA (and all Indicators) to restart, going through a OnDeInit and OnInit cycle on all of them.
The simple resolution to your issue, is DO NOT force a change of chart time-frame. It is inefficient, counter-productive and a very bad design for your EA.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi everyone,
I'm new in MQL5 and the following code is not working for me, what I want is that when it detects the crossing of the two H1 moving averages, I change the period with ChartSetSymbolPeriod to M5 and place the purchase order (orderSend) and close the purchase (orderClose or trade. PositionClose) when I detect the crossing of the two moving averages in M5, I know that the ChartSetSymbolPeriod function performs the period change asynchronously, am I using this correctly? Should I do it with ChartSetSymbolPeriod or another way? It turns out that I don't know why it is not working for me, it never enters the condition of the moving averages in the M5 period:
Could someone help me? attached (example.png)