Hi,
DEFPARAM PRELOADBARS = 50
timeframe(1 day)
myStd = std[50](range)*2
timeframe(1 minute)
buy based on myStd etc.
If I input this code into a MTF-system and with timeframe(1 day) and timeframe(1 minute) as above the myStd is not the same value as if I create an indicator and put it on the 1 day timeframe.
Why is that?
Line 2 should read:
timeframe(1 day, UpdateOnClose)
also bear in mind that in Daily TF it will enter one trade, while in your example it could enter multiple times during the day, if trades exit soon, because the daily condition is valid for 24 hours!
Oh yeah! thats true, thanks for that.
If I graph the myStd I get a value of 200. If I put the same code into and indicator and apply to the daily it would give me a value of 400. I dont understand, where could the value of myStd be coming from? I graph it on the 1 minute graph.
DEFPARAM PRELOADBARS = 50
timeframe(1 day, UpdateOnClose)
myStd = std[50](range)*2
graph myStd //values from 1 minute - I expect 1 day value
timeframe(1 minute)
buy based on myStd etc.
Is it just the graph or does it change when I use it as well?
with “UpdateOnClose”, we use the last Close value, so the day prior to this one in this case (daily timeframe). Remove “updateonclose” and you’ll get the value from the daily indicator in ‘real time’, each 1 minute in this case.
I explained it in details in this blog article: First approach to multi timeframe trading with ProRealTime
Thanks for a good reply! Let me try to explain more, I get 3 different values if I do the following
- graph std of something on the 1 day timeframe with default 1 min
- graph std of something on the 1 minute timefram with default 1 min
- graph std of something on the 1 day timeframe in an indicator
1. Is a surprise to me, I would expect it to be the same as 3. Number 2 is obviously the fact it runs on the 1 min, different range. 3. Is the “correct” value for me.
Removing the updateonclose gets me even further away from 3 since I use the 1 min value in the higher timeframe. Could it be that I have more data available on the 1 day timeframe than I have on the 1 minute timeframe and that the timeframe (1 day) only uses the data I have on the 1 minute and converts it to days?
It is as Nicolas said already. An indicator gives you an ‘on the fly’ value for the currently forming bar. Using GRAPH in a strategy will give you the value at the close of the last bar that closed.
Yes Vonasi, but data can’t double values!
There is something wrong somewhere. I sent a report to assistance. I hope IG replies.
Thanks Roberto! I think you are on to the right track, either the STD method is not adjusted for MTF or the low time frame is used to create the larger timeframe and the amount of data becomes much smaller thus affecting the value of STD which is then not the same on timeframe(1 day, calculateonclose) as selecting 1day and ploting it with an indicator. Unfortunately my support contact in IG markets can only answer things that can be clearly read on the homepage and questions other than that I dont get a reply.