Download MetaTrader 5

How I can Specify Active Window Chart

To add comments, please log in or register
Ehsan Tavakoli
171
Ehsan Tavakoli 2016.11.05 20:52 

Hi

I have a function & put on a expert . i open 10 chart & add expert to all of them but i want function work just on selected chart not other chart

when i select another chart now i want function work on this selected chart  

for this i need specify active chart to put condition for run function like this

if( chart is active or selected )
{

run function

}
Marco vd Heijden
Moderator
4730
Marco vd Heijden 2016.11.06 02:47  

Maybe you can check the condition of:

if(ChartGetInteger(0,CHART_BRING_TO_TOP)==true)
{
// Do Something...
}

Please see:

https://www.mql5.com/en/docs/constants/chartconstants/enum_chart_property#enum_chart_property_integer

Documentation on MQL5: Standard Constants, Enumerations and Structures / Chart Constants / Chart Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Chart Constants / Chart Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Chart Constants / Chart Properties - Reference on algorithmic/automated trading language for MetaTrader 5
Ehsan Tavakoli
171
Ehsan Tavakoli 2016.11.07 10:33  
Marco vd Heijden:

Maybe you can check the condition of:

if(ChartGetInteger(0,CHART_BRING_TO_TOP)==true)
{
// Do Something...
}

Please see:

https://www.mql5.com/en/docs/constants/chartconstants/enum_chart_property#enum_chart_property_integer

this works :)

Thank you very very very very much 

To add comments, please log in or register