Questions from Beginners MQL5 MT5 MetaTrader 5 - page 694
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
well, then the indicator cycle, in which the number of bars is this very line.
I wonder - what is clear(?), i.e. where to read about the peculiarities of MT5 in offline mode, could you tell me please?
In the rates_total indicator - it is successfully used instead of Bars() in the loop in OnCalculate()
Okay. Yes, there is such a thing.
Will there be the same number of bars for different instruments/timeframes, because I have a multi-currency indicator?
I can change parameters here
But what about rates_total to calculate the indicator for different timeframes and symbols?
Okay. Yes, there is such a thing.
Will there be the same number of bars for different instruments/timeframes, because I have a multi-currency tool?
To obtain the number of bars of history for a non-current timeframe or a non-current symbol in the multi-currency/multi-timeframe indicator, you should use Bars()
That's exactly what I'm writing about - that this feature doesn't work offline, although there is a quote history
Therefore, the indicator cannot be tested offline.
It turns out that the quote in MT5 is sent personally to each IP and may be different from the history of the quote, which is already drawn on the chart? //so goes the logic...
and then the indicator, in which the number of bars is this very line.
I wonder - what is clear(?), i.e. where to read about peculiarities of MT5 in offline mode, could you please tell?
It is clear that MT5. It is not clear what was done before calling Bars(). This simple script works and does not return zero even when there is no connection to the server or when there is no network at all.
I haven't tried it in indicators, that's why I asked how it is done in your case. Most likely, when re-call will be the real number of bars, the first call will cause renewal of data in cache.
{
Print("Bars on chart - ",Bars(_Symbol,PERIOD_CURRENT));
}
It is clear that MT5. It's not clear what was done before calling Bars(). This simple script works for me and does not return zero, even when there is no connection to the server or when there is no network at all.
I haven't tried it in indicators, that's why I asked how it is done in your case.
{
Print("Bars on chart - ",Bars(_Symbol,PERIOD_CURRENT));
}
What's the best simple way to link to a candle's close to run the EA? To recalculate indicators, remove/place orders, etc.?
By timer?
But how to start the timer at the right time so that it is triggered hourly at HH:00:00? and not every hour from the activation of the timer?
What's the best simple way to link to a candle's close to run the EA? To recalculate indicators, remove/place orders, etc.?
By timer?
But how to start the timer at the right time so that it is triggered hourly at HH:00:00? and not every hour from the activation of the timer?
Graphic question:
There is a design like this
if(currChart == график тестера) continue; // Что сюда написать?
ObjectSetInteger(currChart,"Sync",OBJPROP_BGCOLOR,clrGreen);
}
How can I find out that the chart is not the main one, but open in tester mode and skip it?
Create a template for the chart and put a label with the name, for example, "TesterChart" or any other object, you can use zero coordinates so that it is not visible. Name this template "Tester". Now all charts from tests will have an object with this name. Next ask if the chart has this object, if yes, it is "Our Tester", skip it.
Through and through, but I don't know any other way.
As a suggestion.
Create a template for the chart and label it with a name such as "TesterChart" or any other object, possibly at zero coordinates so that it is not visible. Name this template "Tester". Now all charts from tests will have an object with this name. Next ask if the graph has this object, if yes, it's "Our Tester", skip it.
I don't know how, but I don't know any other way.
Thank you, but this solution is not suitable in the sense that I'm testing on more than one template, but that's half the trouble, but the fact that this indicator is not only working for me, people simply get tired of filling labels in the tester.
It turns out that there is no way to determine programmatically that the chart runs in the tester? Where are you developers?
.