I'm having some issue while using in an EA indicators that use ChartSetSymbolPeriod(0,NULL,0) function.
I used this function in some of my indicator because it's the only way to trigger indicator recalculation without waiting a new tick but:
In case of I call multiple of these indicators of different pairs from my EA, I get (rightly) my chart jumping among all symbols and timeframe during initialization.
This occurs because the ChartSetSymbolPeriod(0,NULL,0) command get triggered for each one of my handles.
I think the only way is to avoiding this command to work when indicator is loaded through iCustom command.
Maybe is there a way to recognize that?
Or I need to create a variable like "EA Mode" in my indicator, setting it to TRUE when called with iCustom and then, in my indicator code, do ChartSetSymbolPeriod only if EA Mode=false?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hello,
I'm having some issue while using in an EA indicators that use ChartSetSymbolPeriod(0,NULL,0) function.
I used this function in some of my indicator because it's the only way to trigger indicator recalculation without waiting a new tick but:
In case of I call multiple of these indicators of different pairs from my EA, I get (rightly) my chart jumping among all symbols and timeframe during initialization.
This occurs because the ChartSetSymbolPeriod(0,NULL,0) command get triggered for each one of my handles.
I think the only way is to avoiding this command to work when indicator is loaded through iCustom command.
Maybe is there a way to recognize that?
Or I need to create a variable like "EA Mode" in my indicator, setting it to TRUE when called with iCustom and then, in my indicator code, do ChartSetSymbolPeriod only if EA Mode=false?
What is best practice in this case?
Thanks