opentime bug or not?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #160633 quote
    PaulPaul
    Participant
    Master

    is it a bug or not?

    If using criteria like this

    ctime = opentime >= 153000 and time < 160000
    
    // entry
    if ctime then

    it still can open a trade sometimes at 000000 (assuming the rest of the code is good.)(on a 30s timeframe tested)

    Changing opentime to time fixes it.

    #160641 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    OpenTime is the time when a candle opens, Time when a candle closes.

    It seems correct.

    Try this indicator:

    ctime = opentime >= 153000 and time < 160000
    Return ctime
    #160645 quote
    PaulPaul
    Participant
    Master

    with that indicator, it gives value 1 often at 23:59:30 for 1 bar

    Screenshot-2021-02-08-at-11.23.56.jpg Screenshot-2021-02-08-at-11.23.56.jpg Screenshot-2021-02-08-at-11.24.09.jpg Screenshot-2021-02-08-at-11.24.09.jpg
    #160649 quote
    PaulPaul
    Participant
    Master

    same on dax & other timeframes like 5m, it’s off.

    switching to a stock, it’s ok

    strange!

    #160653 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    That’s correct on a 30-second TF:

    • 23:59:30 is > 15:30:00  (OpenTime, the candle that OPENS at 15:30:00)
    • 23:59:30 is 00:00:00 when the last bar CLOSES and it’s < 16:00:00

    you probably should avoid mixing Opening and Closing times.

    Paul thanked this post
    #160658 quote
    PaulPaul
    Participant
    Master

    haha your right! I assumed you can use both, but I will stick to time and double check if I use opentime 🙂

    Thnx for the explanation!

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

opentime bug or not?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Paul @micky75d Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by PaulPaul
5 years, 7 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/08/2021
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...