How I can Specify Active Window Chart

 

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

}
 

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
 
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 

 
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

Thank you!!

I used: ChartSetInteger(chartidNumber,CHART_BRING_TO_TOP,0);