Download MetaTrader 5

Indicator loading funny first time after history downloaded

To add comments, please log in or register
Ernie Gunning
1147
Ernie Gunning  

Hi All,

 I have a indicator that uses the MACD. I have adidtion 2 extra buffers to draw up arrow and down arrow. Ontop of this I draw trend lines (objects) to pickup divergence. So when drawing a divergence line you kinda need to know in the past the highest point (or lowest dep on what type of divergence I want to display). The problem I found is that if I delete my symbol history, open mt5 and open that chart again, attach the indicator it draws really funny stuff ...not what I'm expecting...if I give the indicator enough time to download and remove it again and add the indicator again is shows 100%, have anyone come across something like this?

also please confirm if I'm right in saying once a MT5 indicator loads it start by downloading the latest feed and then goes backwards (attaching to chart) to the oldest feed?

How is this different (loading feeds) for MQL4?

Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
  • www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Object Types - Documentation on MQL5
khai hoan nguyen
242
khai hoan nguyen  

thank you for share

But your indicator can determine whether buy or sell

phi nuts
2181
phi nuts  
ToolMaker:

Hi All,

 I have a indicator that uses the MACD. I have adidtion 2 extra buffers to draw up arrow and down arrow. Ontop of this I draw trend lines (objects) to pickup divergence. So when drawing a divergence line you kinda need to know in the past the highest point (or lowest dep on what type of divergence I want to display). The problem I found is that if I delete my symbol history, open mt5 and open that chart again, attach the indicator it draws really funny stuff ...not what I'm expecting...if I give the indicator enough time to download and remove it again and add the indicator again is shows 100%, have anyone come across something like this?

also please confirm if I'm right in saying once a MT5 indicator loads it start by downloading the latest feed and then goes backwards (attaching to chart) to the oldest feed?

How is this different (loading feeds) for MQL4?

 

1. You actually already answer your own question. When we delete a historical data, and then attach an indicator that need data from the past (past = historical), MT5 will again download the historical data for this indicator.

2. An indicator in MT5 does NOT start by downloading the latest feed and goes backward. Depend on the code, on both MT4 and MT5, an indicator can start calculating from historical data to present latest data or vice versa, but does not necessary have to download any data, unless it need to.  

Ernie Gunning
1147
Ernie Gunning  
phi.nuts:

1. You actually already answer your own question. When we delete a historical data, and then attach an indicator that need data from the past (past = historical), MT5 will again download the historical data for this indicator. - sorry this was not my question

2. An indicator in MT5 does NOT start by downloading the latest feed and goes backward. Depend on the code, on both MT4 and MT5, an indicator can start calculating from historical data to present latest data or vice versa, but does not necessary have to download any data, unless it need to.  

thanks for the reply and sorry I always struggle to explain my problem :(

 

I have not confirmed that MT5 downloads the history from latest (current - today) through to the past. I only added some alert function to observer that if the history is not downloaded, the rates_total variable is set to around 40 for every calculate event. I will print out the time[] variable and match up the times and if they are in sequence, yes I will go and answer my question myself :) , I will post again.

 

so without writing allot and confuse the actual reason for this post, I need to know if there is some indicator\variable that I can read to know how many feeds are still available on the broker side before I start my indicator? OR is there some function\method to call to force the indicator to download all history before the first Calculate event?

Documentation on MQL5: Common Functions / Alert
Documentation on MQL5: Common Functions / Alert
  • www.mql5.com
Common Functions / Alert - Documentation on MQL5
khai hoan nguyen
242
khai hoan nguyen  
MACD is a indicator good to detect trend in market. thanks share good indicator
phi nuts
2181
phi nuts  
ToolMaker:

thanks for the reply and sorry I always struggle to explain my problem :(

 

I have not confirmed that MT5 downloads the history from latest (current - today) through to the past. I only added some alert function to observer that if the history is not downloaded, the rates_total variable is set to around 40 for every calculate event. I will print out the time[] variable and match up the times and if they are in sequence, yes I will go and answer my question myself :) , I will post again.

 

so without writing allot and confuse the actual reason for this post, I need to know if there is some indicator\variable that I can read to know how many feeds are still available on the broker side before I start my indicator? OR is there some function\method to call to force the indicator to download all history before the first Calculate event?

If there's a need to update the data, MT5 automatically will download the data. However we can use SymbolIsSynchronized() to check if MT is synchronized with server, 

 

To add comments, please log in or register