Hello,
my MTF (multi-timeframe) indicator works fine on opened market (when new ticks are received -> starting OnCalculate() function).
E.g.: I see D1 moving average values on 10min chart...
Problem is on the closed market where no new ticks are received. I get error 4806 (BarsCalculated function returns 0).
If I change chart period to D1 it works fine. It seems like OnCalculate() function in called indicator.ex5 is not started without new tick on different time-frame from D1?
Here is summary how I call the D1 indicator in my MTF indicator:
Peter
Did you checked your handle is valid ?
What is the returned value of OnCalculate() for indicator.ex5 ?
ERR_INDICATOR_DATA_NOT_FOUND |
4806 |
Requested data not found |
I don't when this error eccours, but if you get this error then handle it in your code (best way is to simply return).
Did you checked your handle is valid ?
What is the returned value of OnCalculate() for indicator.ex5 ?
ERR_INDICATOR_DATA_NOT_FOUND |
4806 |
Requested data not found |
I don't when this error eccours, but if you get this error then handle it in your code (best way is to simply return).
I printed handles and both (handle in MTFindicator.ex5 and handle in indicator.ex5) return 10.
OnCalculate() in indicator.ex5 returns 2450 (D1 rates total) even on closed market.
OnCalculate() in MTFindicator.ex5 returns nothing on closed market, due to the mentioned error 4806. After the new tick is received it returns 24500 (M20 rates total).
Is It not possible to get values from indicator.ex5 on different time-frame without tick update? Or do I need to use OnTimer somehow?
Thnaks
Peter
I printed handles and both (handle in MTFindicator.ex5 and handle in indicator.ex5) return 10.
OnCalculate() in indicator.ex5 returns 2450 (D1 rates total) even on closed market.
OnCalculate() in MTFindicator.ex5 returns nothing on closed market, due to the mentioned error 4806. After the new tick is received it returns 24500 (M20 rates total).
Is It not possible to get values from indicator.ex5 on different time-frame without tick update? Or do I need to use OnTimer somehow?
Thnaks
Peter
Sorry but I don't understand your issue. If your indicator.ex5 returns 2450 then BarCalculated must return 2450. Maybe it would be more easy if you can show your code.
Hi,
I am using the same code as in this tutorial https://www.mql5.com/en/articles/127
The only difference is calling custom indicator with different time-frame from PERIOD_CURRENT
Handle=iCustom(_Symbol,PERIOD_D1,"TSIs",r,s,sp,sm);
- 2010.07.26
- Dmitry Fedoseev
- www.mql5.com
Hi,
I am using the same code as in this tutorial https://www.mql5.com/en/articles/127
The only difference is calling custom indicator with different time-frame from PERIOD_CURRENT
This article don't talk about multi timeframe indicator. I doubt it can work by changing only this line of code.
Of course I know, but the same approach is used for the most of MTF indicators:
https://www.mql5.com/en/code/198
https://www.mql5.com/en/code/1757
https://www.mql5.com/en/code/177
None of them are able to show values on closed market and must wait for a new tick!
All of them shows the error 4806 on closed market (e.g.: Set time-frame to H1 and put indicator on 15min chart).
Peter
- votes: 8
- 2010.09.29
- Armand Kilian
- www.mql5.com
Of course I know, but the same approach is used for the most of MTF indicators:
https://www.mql5.com/en/code/198
https://www.mql5.com/en/code/1757
https://www.mql5.com/en/code/177
None of them are able to show values on closed market and must wait for a new tick!
All of them shows the error 4806 on closed market (e.g.: Set time-frame to H1 and put indicator on 15min chart).
Peter
is there any function can tell us if the market close or not?
Hi,
but I think there is no need for market status identification. The indicator should work on closed market as same as other simple indicators do.
TO angevoyageur: Did you try any of listed indicators on closed market?
Peter
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
my MTF (multi-timeframe) indicator works fine on opened market (when new ticks are received -> starting OnCalculate() function).
E.g.: I see D1 moving average values on 10min chart...
Problem is on the closed market where no new ticks are received. I get error 4806 (BarsCalculated function returns 0).
If I change chart period to D1 it works fine. It seems like OnCalculate() function in called indicator.ex5 is not started without new tick on different time-frame from D1?
Here is summary how I call the D1 indicator in my MTF indicator:
Peter