Hello,
This is very nice.
But could someone give a code, which could rotate the symbols on the same chart?
I wrote one but that is not working. Could someone give another one or tell me what is the problem?
When you change symbol on the current chart all indicators and EA are restarted, script exits.
So. your script should change symbol one time and then exit.
Your script should do the following:
- open new chart with ChartOpen() (or set open chart as topmost with ChartSetInteger())
- get that chart Id and then use it in your script as the first argument in the ChartSetSymbolPeriod()
- Changes the symbol and period of the specified chart. The function is asynchronous, i.e. it sends the command and does not wait for its execution completion. The command is added to chart message queue and executed only after all previous commands have been processed.
https://docs.mql4.com/chart_operations/chartsetsymbolperiodYou added the change symbol event to the queue. Once you exit the code, a deinit, change, init will occur for your EA. Not going to work because you don't exit.
When you get the init, wait your 2 seconds, find the next symbol after the current one and switch to that.
- You should stop using the old event handlers and IndicatorCounted() and start using new event handlers.
Event Handling Functions - Functions - Language Basics - MQL4 Reference
How to do your lookbacks correctly - MQL4 programming forum #9-14.
Do not double/triple post!
I will delete your other posts and move a reply here.
Do not double/triple post!
I will delete your other posts and move a reply here.
When you change symbol on the current chart all indicators and EA are restarted, script exits.
So. your script should change symbol one time and then exit.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I wrote a code for rotate all the symbols on the same chart, but not working.
Could someone tell me what is the problem or give another working code for that?
Thank you.