Security function to code

 

Hi,

I am working on a indicator that can be put on a different timeframe than the chart is in.  This is a option for a lot of indicators on trading view. 

A pine scripter explained that to achieve this in trading view you must use the so called: "security function".  This function is explained in the pine script reference, but only states the use of the function, not the code behind the function.

I do understand the use of the function itself, but how it works is a mystery for me... I do not know how to code this function into MQL4.  Here is the link to the reference page:  . 

I want to make a indicator exactly the same as in trading view. I want (for example) the chart to be in a 1h time frame, and the indicator in a 30min time frame. In the attached files I added some picture to make things more clear.

Is there a function within MQL4 that will achieve the same result? Or how do I calculate such a function?

I hope to hear from you!

Thanks in advance!

Daan

Files:
1234.png  24 kb
12345.PNG  34 kb
Reason: