One-time buy Signal at System Start

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

Viewing 15 posts - 16 through 30 (of 33 total)
  • #239794
    JS

    When I use 10k units, it works well …?

    #239797

    Really sorry, I have no clue why but my backtest doesn’t match yours… it misses a signal and I get stopped out.

    #239800
    JS

    I think I know why this happens. When the first position is opened, and within 36 units an opposite position should be opened by the indicator, it goes wrong because the indicator hasn’t had time to configure itself yet. You can solve this by using the period of the supertrend (36 units) as “PreLoadBars.”
    So use: DefParam PreLoadBars=36

    1 user thanked author for this post.
    #239804

    This fixed it – thanks a lot 🙏🏼 been looking for a solution for this for a while now!

    1 user thanked author for this post.
    avatar JS
    #239962

    I’ve tried this code now with (DEMO) auto trading, but it doesn’t open a position, not on the system start, not the next day, also not the day after… does anyone know what the reason could be?

    When i use this code for backtesting, it works fine!

    #239963

    Undoubtedly PreLoadBars. It would be the only thing that matters for Backtest vs Demo (or Live for that matter).
    Hence, your SuperTrend can’t cope with the 100 bars 0nly.

    ?

     

    PS: I see that JS already gave the same response to earlier posts. Still I think my text applies.

    1 user thanked author for this post.
    #239966

    Hi Peter, with JS the last solution was to use at least PreLoadBars = 36, I’ve increased it to 100 for backtesting, it works. I have tested the system now with 1000 bars, in a 5 min. timeframe (in hope to see sooner results if the position would be opened at the next bar) but nothing happens (screenshot attached). As I am a very beginner at this, it might just be a basic setting but I just can’t figure it out.

    #239968

    Just to clarify my goal here: I’m aiming for an immediate entry into a long or short position (I’d adjust the code accordingly) as soon as I start the auto trading system, without having to wait for the next signal. We’ve only increased the PreLoadBars to ensure that the first signals from the SuperTrend indicator are accurately interpreted AFTER the immediate entry.

    #239969

    I’m aiming for an immediate entry into a long or short position

    Below on Lines 9,10 and 11 of the most recent posted code will (should?) give you above (you adjust for Short or Long as you think fit when you start your Algo).

    Tell us what is not happening if not above?

    IF NOT ONMARKET AND EntryFlag = 0 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF

     

    1 user thanked author for this post.
    #239973

    Yes that’s what the code SHOULD do, and it works when I do backtesting but when I start auto trading (in Demo mode), nothing happens – no matter what timeframe i use, no positions are being opened (see screenshot attached). The system was also active for a couple of days with a 1 day timeframe, in case it opens a position at the next candle/day, but still nothing happened.

    1 user thanked author for this post.
    #239975

    I will try it on my Demo and Ill report back.

    1 user thanked author for this post.
    #239976

    I started it on DJI on 1 min TF and 2 bars have formed, but no position opened so I confirm / supprt what you are saying.

    I will make a change to see if I can get it going.

    1 user thanked author for this post.
    #239977

    Below works … see attached.

    Maybe somebody can tell us why??

     

    #239978
    JS

    Hi,
    “PreLoadBars” does not determine the number of bars over which the backtest is conducted, but rather the number of bars loaded before the backtest is performed.
    (The number of bars for your backtest is determined by the amount of “units” in your chart)
    If you use “PreLoadBars=36” as discussed, it should work fine…
    Opening the first position depends on your timeframe: if you use 1 day, the first position will open after 1 day, and if you use a 5-minute timeframe, then after 5 minutes…

    #239981

    Thanks JS, but first position didn’t open at all (see my ss) until I deleted ‘Not onmarket’ as  I posted.

Viewing 15 posts - 16 through 30 (of 33 total)

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