Hi all, so I have a piece of code that loops through all the instruments - alerts trigger as required in my Alerts box correctly.
I then am closing all the windows after this as a tidy up.
Currently I am going through the alerts manually in the alerts window to check which instruments alerted and then re-opening them to check it out.
1. Is there a way of conditionally checking {if 'Alert occured'} do NOT chartclose
2. Is there a way of clearing the Alert window pop up programmatically?
Current Code here:
voidOnStart(){
for(int i=0;i<SymbolsTotal(false);i++){
if( StringFind(SymbolName(i,false),".r",0)!=-1
){
ChartOpen(SymbolName(i,false),TimeFrame);
}
}
//Closing all chart which are not the current chartlong currChart,prevChart=ChartFirst();
int z=0,limit=100;
ChartClose(prevChart);
while(z<limit)// We have certainly not more than 100 open charts
{
currChart=ChartNext(prevChart); // Get the new chart ID by using the previous chart ID if(currChart<0) break; // Have reached the end of the chart list if(prevChart!=ChartID()) ChartClose(prevChart); // Close the chart which is not current chart
prevChart=currChart;// let's save the current chart ID for the ChartNext()
z++;// Do not forget to increase the counter
}
}
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.
Hi all, so I have a piece of code that loops through all the instruments - alerts trigger as required in my Alerts box correctly.
I then am closing all the windows after this as a tidy up.
Currently I am going through the alerts manually in the alerts window to check which instruments alerted and then re-opening them to check it out.
1. Is there a way of conditionally checking {if 'Alert occured'} do NOT chartclose
2. Is there a way of clearing the Alert window pop up programmatically?
Current Code here: