I am trying to call the indicator inside itself with different parameter and Chart symbols. See what I did:
#define count_symbol 3
for(int i=0; i < count_symbol; i++)
chart_id[i] = ChartOpen(Symbols[i],0);
int indicator = iCustom(Symbols[i],0,"Real Time Testing\\Trade_Real_Test",0,false,false,false);
Print("The Symbol is: ", _Symbol);
I see when I apply the indicator on the chart, the other charts start getting appeared on screen with the indicator applied on it. But I could not see the output of the OnTimer(). I only see the output of the timer for the symbol on which is was primarily applied and no output for the rest charts which I drew using the program. I could not understand what is the reason for it. Please help me in running the Timer function for the rest charts too.
But I didn't understood why the Timer function is not working. I am calling the same indicator and the indicator itself has the Event Timer which has to get executed, am I not right, sir?
Please explain this to me. If possible can you give a demo code that would help a lot.
Sir, can you explain how I can create separate instance of OnTImer() on each of the charts, please?
You have to attach the same indicator to multiple charts each running their own timer event.
Meaning the indicator that you add has to have it's own timer function.
If I am adding the indicator to a chart within that indicator itself, then I guess the Timer function is already there. Check my code. If that is the scenario then the timer should get executed, am I right sir?
You did not attach the indicators to a chart, but you rather executed iCustom() command. Only OnInit() and OnCalculate() are triggered. Some commands (e.g. graphic ones) are ignored within iCustom() as well.
Sir, only if the OnInit() is triggered then I have Event Timer included inside the OnInit(), then why it is not happening?
The OnInit() and
Is only for the current chart, not for the charts that you are calling via iCustom.
We know nothing about the existence of any timer in
"Real Time Testing\\Trade_Real_Test"
Since you are not showing any of the code involved.
You say you call the indicator inside of itself this would cause an endless loop of opening charts and calling indicators within indicator.
That part is not clear, as are many.
Sir I have shared the code above. Is that not the code you were expecting? What else should I say? I am just experimenting with the function of MQL5. Hence the above code is what I tried. Above code means what I have mentioned in the question of mine.
Probably because "Only OnInit() and OnCalculate() are triggered." and " Some commands are ignored within iCustom()..."
If I translate it for you, no OnTimer(), OnChartEvent(), OnTester() are ever invoked within iCustom().