Your Help Please: Using global variable to allow 1 indicator to plot different lines each time 'next' copy applied to chart.
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
My aim is to learn how to use one .ex4 many times on main chart by using concept of 'instances'
Each time indicator (ind) is applied to chart a differently colored moving average line is plotted,
showing that instance(n) has run...
(brief pseudo code)
My problem is...
Below is log [timestamps removed] of what happens is run more than one instance.
The first plots it's line and stays running.
The second/third/.../fifth runs - log message that running then exit.
IE, start() is not entered! deinit() called instead of start()
Can you enlighten me as to why start() not entered on instances >1 ???
^^^^^^^^^^^^^^^^^^^^
MOST appreciated! hope to hear from you ;)
===================
.mq4 SOURCE FILE ATTACHED.
===================
globalVariableTest GBPUSD,Daily: removed
globalVariableTest GBPUSD,Daily: deinitialized
globalVariableTest GBPUSD,Daily: Exit:instance(3) deinit() deinit() called instead of start()
globalVariableTest GBPUSD,Daily: initialized
globalVariableTest GBPUSD,Daily: instance(3) running on:GBPUSD, session minutes:1440
globalVariableTest GBPUSD,Daily: loaded successfully
globalVariableTest GBPUSD,Daily: removed
globalVariableTest GBPUSD,Daily: deinitialized
globalVariableTest GBPUSD,Daily: Exit:instance(2) deinit() deinit() called instead of start()
globalVariableTest GBPUSD,Daily: initialized
globalVariableTest GBPUSD,Daily: instance(2) running on:GBPUSD, session minutes:1440
globalVariableTest GBPUSD,Daily: loaded successfully
globalVariableTest GBPUSD,Daily: instance(1) start() entered AND blue line plots
globalVariableTest GBPUSD,Daily: initialized
globalVariableTest GBPUSD,Daily: instance(1) running on:GBPUSD, session minutes:1440
globalVariableTest GBPUSD,Daily: loaded successfully