One-time buy Signal at System Start

Forums ProRealTime English forum ProOrder support One-time buy Signal at System Start

Viewing 15 posts - 1 through 15 (of 23 total)
  • #239684

    I’m setting up a simple trading system and need a way to trigger a one-time entry (either long or short) at the start if there’s no existing position. This is particularly important after rolling contracts and restarting the system, so it can re-enter immediately if required. I’ve tried using ONCE and various flags, but the system keeps triggering unintended signals. Looking for a simple, reliable code solution to execute an entry just once at the start without affecting ongoing trade signals. Any suggestions?

    #239751
    JS

    Not a bad idea from ChatGPT… 🙂

    3 users thanked author for this post.
    #239753

    Thank you! ChatGPT couldn’t solve this, that’s why I am here haha

    Unfortunately I’m not getting any entries with this code. I’ve tried it both nested and un-nested, as well as with and without additional conditions, but nothing seems to happen:

    Sorry… newby here 😅

    #239754

    This was another try, with the full code, but nothing happens:

    #239755

    Add this line at the very beginning:

    it will open only ONE trade and will never close, as there is no indication when it must be exited.

     

     

    2 users thanked author for this post.
    #239765

    Thanks, the one-time entry works now! 🙏🏼

    With the following code, the other conditions also seem to work, except the first 2 Supertrend crossings directly after the one-time entry are missing (see attachment) – any idea why? The rest of the signals work fine!

    #239767

    Seems like the first signal is beeing ignored in any case:

    #239772
    JS

    Hi,

    Try this one:

     

    1 user thanked author for this post.
    #239775

    When i use your code 1:1 the entry on the backtest starting date is missing – it enters a short position on the next Supertrend short signal (Screenshot attached) – the problem is that I want to do auto trading with Futures, and when I have an open position and need to roll over to a new contract, I have to close that position but might want to continue with the position / auto trading within the new contract (as the trend is still ongoing), and don’t want to wait until the next signal.

    Also, opening a position manually won’t work with auto trading systems:

    PRT Conditions of execution of automatic trading systems

    “When you begin an automatic trading system, any pre-existing positions placed manually are closed first and any pre-existing orders placed manually are canceled. The first position of the system may be opened at the earliest at the open of the next bar after the system is started.”

    How do you handle this, as this is sub-optimal for Futures auto trading? It’s kinda frustrating 🥲

    #239777
    JS

    With short position on start/backtest date:

     

     

    #239779

    Yes we had that code before, but then upcoming signals are being ignored:

    #239782
    JS

    Strange, in my graph the first signal is executed…

    #239785

    Can you maybe try it with MBTCUSD and 1 day timeframe?

    #239788
    JS

    On MBTCUSD TimeFrame 1 day…

    1 user thanked author for this post.
    #239793

    It depends on the selected units, when i do a backtest (e.g. 3 or 5 years), 1day timeframe, 10k units there is an inconsistency within the entries. With 100 units (as in your test) it seems to work.

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

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