Coding with time

Viewing 3 posts - 1 through 3 (of 3 total)
  • #7664

    Hi

    I am having trouble coding with time. I have created a simple indicator to learn how to incorporate the ‘Time’ constant into my coding in order to trade between certain times only. I would like the indicator to return a 1 only between 9:00 and 17:00 everyday. I have gotten as far as to generate a “1” from 9:00 and reset it each day but I cant get it to return to ZERO after 17:00. The code is as follows:

     

    I have gone through the manuals and some of the code on this site but I am missing something as I cant get the indicator to return to Zero after 17:00. I’ve tried variation of this but cant get it right. I don’t think it was really necessary but I’ve included an image of my results. The chart is set to 5min candles.

    Some help and insight as to why this is happening will be much appreciated

     

    Thanks

    Jens

    #7667

    Hi Jens!

    Hope it helps you.

    Regards.

    #7821

    It Works. Seems so obvious when you see it but I couldn’t think it.

    Thank you!

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

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