How to Add Seconds to TIME?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #133448 quote
    toltec1000
    Participant
    New

    Hello,

    I would like to create a time window by defining times using the HHMMSS format and adding 4 seconds to it, something like:

    OpenMarketTime= 143000
    CloseMarketTime=210000
    OpenMarketWindow= Time > OpenMarketTime AND Time < CloseMarketTime+5   <- intention is to extend the window by 5 seconds

    This doesn’t seem to work, although I don’t get an error. Is there a way of getting this right?

    Thanks for your help

    Gary

    #133449 quote
    Vonasi
    Moderator
    Master

    It will work but you will have to trade on a 5 second or 1 second chart.

    #133450 quote
    toltec1000
    Participant
    New

    Thanks Vonasi.

    #133458 quote
    toltec1000
    Participant
    New

    Something isn’t adding up unfortunately. The code doesn’t run on a 1 second chart. However if I change CloseMarketTime+5 to a specific time eg 210005 in the above code, it runs. (CloseMarketTime+5) doesn’t help either 

    #133462 quote
    Vonasi
    Moderator
    Master

    It should work with either. The issue with trading on 1 second charts is that if there are no trades in that second then there is no candle to have that time so it does not recognise that the

    time has occurred.

    #133463 quote
    toltec1000
    Participant
    New

    I understand thanks, but there are trades during the 5 second added time on the SPX500. Changing the time to a specific number 210005 finds many trades.

    #133467 quote
    robertogozzi
    Moderator
    Master

    I tried this indicator on a 1-second TF:

    OpenMarketTime= 143000
    CloseMarketTime=210000
    OpenMarketWindow= Time > OpenMarketTime AND Time < CloseMarketTime+5
    return OpenMarketWindow

    it seems to be working fine (pic refers to yesterday night).

    x-17.jpg x-17.jpg
    #133474 quote
    toltec1000
    Participant
    New

    Thanks for the help… I’ll dig deeper, but can’t get it to work strangely

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

How to Add Seconds to TIME?


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
toltec1000 @toltec1000 Participant
Summary

This topic contains 7 replies,
has 3 voices, and was last updated by toltec1000
5 years, 8 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/27/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...