If such an indicator is put on each desired chart, then any change of objects in the controlled area (chart) will send an event to the chart with the expert.
//идентификатор графика с советникомlong ID=1;
intOnInit()
{
//установка флага получения событий создания объектов графика ChartSetInteger(ChartID(),CHART_EVENT_OBJECT_CREATE,true);
//установка флага получения событий удаления объектов графика ChartSetInteger(ChartID(),CHART_EVENT_OBJECT_DELETE,true);
return(INIT_SUCCEEDED);
}
voidOnChartEvent(constint id, constlong &lparam, constdouble &dparam, conststring &sparam)
{
//если объект удалён или создан, или изменёнif(id==CHARTEVENT_OBJECT_DELETE || id==CHARTEVENT_OBJECT_CREATE || id==CHARTEVENT_OBJECT_CHANGE)
{
EventChartCustom(ID,1,lparam,dparam,sparam);
}
}
intOnCalculate(constint rates_total,
constint prev_calculated,
constdatetime &time[],
constdouble &open[],
constdouble &high[],
constdouble &low[],
constdouble &close[],
constlong &tick_volume[],
constlong &volume[],
constint &spread[])
{
return(rates_total);
}
If you put such indicator on each desired chart, then any change of objects in the controlled area (chart) will send an event to the chart with the Expert Advisor.
Example as an idea
Thanks, but I checked my code on crypto, everything works as I wanted.
At first glance it seems fine. You can check in the script on any day. But here in the documentation I do not like the example. Here is how I advise to write
If such an indicator is put on each desired chart, then any change of objects in the monitored area (chart) will send an event to the chart with the expert.
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.
You don't have to pull bullshit from the reference, write the obvious cycle...you'll have to live with it later :-)
for(long chartId=ChartNext(0);chartId>0 &&!IsStopped();chartId=ChartNext(chartId)) {
if (ChartSymbol(chartId)=="") continue;
DoChart(chartId);
}
for(long chartId=ChartNext(0);chartId>0 &&!IsStopped();chartId=ChartNext(chartId)) {
if (ChartSymbol(chartId)=="") continue;
DoChart(chartId);
}
Maxim, I can't figure out how to apply this to my problem(
Please help to find or write a function to search for objects on open charts.
Five open charts, EA is on the first one. MT4
this code should work:
check on cryptocurrencies, they work on weekends
The only thing is to monitor the opening (and closing ? ) of new charts and then update the listthis code should work:
check on cryptocurrencies, they work on weekends
Thank you)))
Is it acceptable to run the indicator with minimal code on each chart? Is it possible to do this with a default template.
Is it acceptable to run an indicator or EA with minimal code on each chart? Is it possible to do this with a default template.
so there is only one
If such an indicator is put on each desired chart, then any change of objects in the controlled area (chart) will send an event to the chart with the expert.
Example as an idea.If you put such indicator on each desired chart, then any change of objects in the controlled area (chart) will send an event to the chart with the Expert Advisor.
Example as an ideaThanks, but I checked my code on crypto, everything works as I wanted.
Thank you all for your help!
Here's my problem with Chart_ID()
Did it like this
But you can't check it in the tester(.
...I have to wait so long for Monday(
During initialization, everything seems to work
But how will it work in real life?
While I was away .........
At first glance it seems fine. You can check in the script on any day. But here in the documentation I do not like the example. Here is how I advise to write
If such an indicator is put on each desired chart, then any change of objects in the monitored area (chart) will send an event to the chart with the expert.
Example as an idea.For this task
Forum on trading, automated trading systems and testing trading strategies
Any questions from newbies on MQL4 and MQL5, help and discussion of algorithms and codes
MakarFX, 2021.06.19 21:21
To be honest Alexey, with my knowledge it sounds scary...
If you have not entered the market yet, you cannot go back to the market and buy from a cursor.