Questions from Beginners MQL5 MT5 MetaTrader 5 - page 408
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
It all depends on the logic of the indicator. Most often - yes, in the OnCalculate() function.
The"OnCalculate() function is called only in custom indicators when it's necessary to calculate the indicator values by theCalculate event. This usually happens when a new tick is received by the symbol" - how then to make the calculation run only once at the appearance of a candle. In mql4 there is a check.
Easiest if not the first tick (prev_calculated != 0) and rates_total > prev_calculated.
Yeah :). Maybe I should find an example of two exponential moving averages crossing (I've seen it somewhere) and redo it.
How do I intercept the closing event on the current tick? There are no standard means? I.e. when opening a trade you have to write something like:and then check on every tick:
and then check on every tick:
How do I intercept the closing event on the current tick? There are no standard means? I.e. when opening a trade you have to write something like:and then check on every tick:
and then check on every tick:
How do I intercept the closing event on the current tick? There are no standard means? I.e. when opening a trade you have to write something like:and then check on every tick:
and then check on every tick:
I do not understand anything. What value do you want to get?
I read what you wrote this way
{
Opening of an order;
If the order opens, then
TotalOrder = TotalOrder+1;
}
) by default totalOrder =0, but after each opening of an order the value will increase, after 10 openings (the value will be exactly 10) the counter of all ever opened positions (no check by type, by Magik and by symbol = it will add absolutely all open orders)
And the next condition looks like this
if TotalOrder is not equal toOrdersTotal {}
It's up to you, mate, to the order desk. They only give advice and help with code problems here.