Multi Time Frames

Viewing 10 posts - 1 through 10 (of 10 total)
  • #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
    Return

    if it doesn’t work, is there a way to fix the code to make it work?

     

    #181012

    1-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:

    you can replace TIME by OPENTIME.

    #181013

    I 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?

    #181027

    No, 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.

     

    #181082

    No good mate. I want my condition to be met at precisely 172000 when I am on a 1 Hr chart. is it possible?

    #181083

    Nope. Sorry.

     

    #181096

    Tnx Roberto. Much appreciated mate.

    #181207

    Would the below trick code work and Draw the Text at 15.45 on the 1 Hr Chart?

     

     

    #181233

    The above code should work, but the text will appear only at exact timestamp. But you will probably not see it for 2 reasons:

    1. “elapsed” is equal to 7200 seconds, there is only a small chance the 1-hour bar will update at this precise second
    2. if the text is plotted, it will disappear automatically since you are using a drawonlastbaronly
    #181237

    Tnx Nicolas.

Viewing 10 posts - 1 through 10 (of 10 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login