Time Functions not working?

Forums ProRealTime English forum ProOrder support Time Functions not working?

  • This topic has 14 replies, 4 voices, and was last updated 3 years ago by avatarMike.
Viewing 15 posts - 1 through 15 (of 15 total)
  • #135826

    Hi

    Can anyone see why this code won’t run.  If I comment IN the defparams the code opens trades on the 1 minute time frame but nothing higher.  If I comment the defparams out then no trades are opened.

    I plagiarised “Morning CAC 40” from the library and it won’t open any trades either.  I have had differing results on my Spreadbet and CFD accounts in the past. Neither will open any trades.

    Thanks in advance

     

     

    #135828

    In your example you used 50 seconds, so only if a candle closes on that boundary (try on a 10-second TF).

    If you use 142900 it’ll work on a 1-minute TF, if you use 142500 it’ll work also on a 5-minute TF, and so forth…

     

    1 user thanked author for this post.
    #135829

    on the 1 minute time frame but nothing higher

    That’s because you are using 143300 and so that time can only be met on a 1 min or less TF.

    IF time = 142950 THEN

    This means that your conditions must be met at that exact time else no trade.

    1 user thanked author for this post.
    #135830

    Thanks Roberto

    I thought “time” versus “currenttime” worked on the clock time, irrespective of the candle close…Have I misunderstood that?

     

     

    #135831

    Thanks GraHal

    I thought my condition was the time of day, which must occur once every 24 hours, at which point I thought my trade would open.  Again, I may have this wrong but I think “time” is supposed to relate to “real” time and “currenttime” is candles based.

    It sounds like I can’t open a trade at this very specif time.  Is that correct?

    #135836

    It sounds like I can’t open a trade at this very specif time.  Is that correct?

    I was wrong, you can open at that specific time.

    I thought you have additional conditions, but now I see you haven’t.

    See Roberto comment re use of 142950

    1 user thanked author for this post.
    #135886

    Sorry, I had the “time” and “currenttime” functions reversed.  It’s “currenttime” that is supposed to work independently of the candle/bar.

    The code still opens no trades on the daily timeframe.  It does, As Roberto suggested it would, open 1 trade at 142950 on the 10 second time frame.  However, to reiterate, this seems to be acting like the “time” function” and not the “currenttime” function.

    I have to imagine I can open a trade per day at a specific time…. Any further thoughts?

    Many thanks

     

     

    #135896

    As from Nicolas’ explanation in a comment to official documentation “CurrentTime is the one of the official timezone where the instrument is traded.

    So if you trade Nikkei and it’s 11am UTC+0 and the bar is labelled  100000, OPENTIME will return 100000 (opening time) TIME returns 110000 (closing time), CURRENTTIME will return 110000 + TZ difference for Japan.

    1 user thanked author for this post.
    #135897

    Above added as Log 223 here …

    Snippet Link Library

    I added the Comment … not code but worthy of logging here! 🙂

    1 user thanked author for this post.
    #135898

    Thanks again Roberto – yes, I know I will have to offset the time zone difference and my understanding of CURRENTTIME is as you/Nicolas describe it.   As a quick start I just wanted to get the code operational.  I still don’t see why “currenttime” won’t trigger one trade every 24 hours.  CURRENTTIME is acting like TIME.  Is this a bug or am I just not getting it!?

    To double check I tried this on the DAX and still no trades.

     

    #135899

    Droll 🙂

    #135900

    Code is read and decisions on orders made at the close of every candle. At this point the only times that the strategy can use are the ones at the open (OPENTIME) and at the close (TIME) of that candle. If you want a trade to open at time = 142950 then you must ensure that your chart has a candle that has a time of 142950.

    2 users thanked author for this post.
    #135901

    Just trying to figure… maybe the trade is still open next day due to high TP or SL and no further entry is allowed.

    1 user thanked author for this post.
    #135902

    Thanks Vonasi

    The fact the code operates at the close of the candle is the point I had lost sight of!

     

    #135903

    Thanks for the thoughts Roberto – Vonasi has got it into my head my it’s not working as I had hoped.

    I appreciate your time

     

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

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