Features of the mql4 language, subtleties and techniques - page 32

 
Andrey Khatimlianskii:

If the 500-bar cycle and comparison of their values with the stored ones had to be done many times, and it would be longer than calculating the hash and comparing it with the stored one in the same cycle, then it would make sense.
But this is hardly the case.

What's taking you so long to count that you notice the rare occurrence of the resetting of prev_calculated?

The Expert Advisor calls the indicator every minute and checks what is new. If prev_calculated=0 is noticed, then it is a full recalculation, maybe it is not so long, but still. For example USDCNH pair is not so rare at my broker reset.
The reset time (prev_calculated=0):


P.S. I'm even curious myself which candle changes if the Max bar in history/chart is set to 2000/2000 in the terminal.
 
Nauris Zukas:

P.S. I even wonder which candle changes if the terminal Max bar in history/chart is set to 2000/2000.

create an indicator with 4 indicator buffers that store OHLC - fill it when you run the indicator for the first time

when prev_calculated=0 write in the log file where there is a discrepancy between OHLC and buffers and then synchronize indicator buffers with newOHLC

HH: in principle, there is no sense to fill in buffers at the first indicator start - it can be done at prev_calculated=0

 
Nauris Zukas:

The Expert Advisor calls the indicator every minute and checks what is new, if prev_calculated=0 is seen, then there is a full recalculation, it may not take long to count but still. For example USDCNH pair is not rare at my broker reset.
Reset time (prev_calculated=0):


P.S. I even wonder which candle changes if the Max bar in history/chart is set to 2000/2000 in the terminal.

Hardly a bar change. More likely something of a service.

I don't see the point in bothering with it at all.

 
Andrey Khatimlianskii:

More like something official.

Didn't know about that. Well then there's definitely no point in bothering with it. Just read in the handbook "If since the last call of OnCalculate() price data were changed (a deeper history was pumped or history gaps were filled in), then the value of input parameter prev_calculated will be set to zero by the terminal itself".

 
Igor Makanu:

write an indicator with 4 indicator buffers storing OHLC - fill it at first start of the indicator

When prev_calculated=0 you write in the log where there is a discrepancy between OHLC and buffers and then synchronize indicator buffers with newOHLC

HH: in principle, there is no sense to fill in indicator buffers at first occurence - you may do it at prev_calculated=0

Yes thanks, for the sake of interest I'll do a separate indicator, check if the candles are changing or there's something service.

 
OrderModify TP and SL fails in one pair (HSI50), all other pairs are OK in DC. Manually everything changes, but as soon as OrderModify is attempted, there is no way, even TP and SL cannot be removed from OrderModify. The error shows invalid price (129). Obviously OrderModify is banned there (not sure why).
Question, someone did check for OrderModify? How to check it?
P.S. The contract specification is HSI50 (Full acces.)
 
Good day!
At one broker MarketInfo() constantly (once or twice a day) flies off, gets value 0 ( specifically MODE_MARGINREQUIRED). It's kind of normal, but at the same time there is no attempt to reach the iCustom() indicator (connected through a resource). Even after MarketInfo() receives data, iCustom() remains silent. Only restarting the terminal helps. How to access the indicator without restarting the terminal, any ideas? Can the indicator disappear from a resource somewhere?
 
Nauris Zukas:
Good day!
One broker constantly (once or twice a day) MarketInfo() flies off, gets value 0 ( MODE_MARGINREQUIRED specifically). It's kind of normal, but at the same time there is no attempt to reach the iCustom() indicator (connected through a resource). Even after MarketInfo() receives data, iCustom() remains silent. Only restarting the terminal helps. How to access the indicator without restarting the terminal, any ideas? Can the indicator disappear from a resource somewhere?

That's the question I'd like an answer to.

 
Is it technically possible to find out if the broker is working in normal or FIFO mode without opening trades? I searched all the documentation and did not find such a parameter. If you are a netting account type, then hedging is disabled.
 
Hello!

I don't remember encountering "array out of range" for Time[1], but this fact happened in EA. Do you do some kind of check for "array out of range" for predefined array variables-Timeseries?