Multi Time Frames
Forums › ProRealTime English forum › ProBuilder support › Multi Time Frames
- This topic has 9 replies, 3 voices, and was last updated 3 years ago by IG_CFD_Trader.
-
-
11/05/2021 at 7:13 AM #181010
Hello coders,
Would the below simple indicator work on a 1 Hr chart?
defparam drawonlastbaronly = true
if CurrentTime = 172000 Or OpenTime = 172000 Then
DrawText(“Check 65m TimeFrame”,barindex,high+10,SansSerif,standard,16)coloured(255,255,255)
Endif
Returnif it doesn’t work, is there a way to fix the code to make it work?
11/05/2021 at 8:36 AM #1810121-hour TF will only open, and close, every hour, so there will never be a chance for a condition to be met at a 20-minute time.
You need to change TF or your code as follows:
1if Time = 172000 or (Time > 172000 and Time[1] < 172000) thenyou can replace TIME by OPENTIME.
11/05/2021 at 8:45 AM #181013I am confused. Did you mean the code will never work on 1 Hr chart no matter what or are you saying if I change the code to what you suggested then the 20 minute time condition will be met on 1 Hr chart?
11/05/2021 at 12:26 PM #181027No, it allows your condition to be checked on the first TF boundary AFTER 172000.
On a 1-hour TF your condition will be met at 180000.
With your code it will never be met.
11/05/2021 at 9:08 PM #181082No good mate. I want my condition to be met at precisely 172000 when I am on a 1 Hr chart. is it possible?
11/05/2021 at 9:16 PM #18108311/06/2021 at 12:37 AM #181096Tnx Roberto. Much appreciated mate.
11/08/2021 at 5:48 AM #181207Would the below trick code work and Draw the Text at 15.45 on the 1 Hr Chart?
12345678defparam drawonlastbaronly = trueelapsed = timestamp - opentimestampif OPENTIME = 150000 thenif elapsed = 2700 thenDrawText("Check 135m F9",barindex,high+10,SansSerif,standard,16)coloured(255,255,255)EndifEndifReturn11/08/2021 at 11:46 AM #181233The above code should work, but the text will appear only at exact timestamp. But you will probably not see it for 2 reasons:
- “elapsed” is equal to 7200 seconds, there is only a small chance the 1-hour bar will update at this precise second
- if the text is plotted, it will disappear automatically since you are using a drawonlastbaronly
11/08/2021 at 12:40 PM #181237 -
AuthorPosts
Find exclusive trading pro-tools on