Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Timely Executions using indicators

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Timely Executions using indicators

    I'm sure I'm missing something obvious here but can't find a solution browsing the forums.

    I'm building a strategy that uses the Short Terms Swings indicator that turns red for down trends / green for up trends. I'd like to execute long or short buys based off this indicator. I'm getting executions based off the indicator but they are executed 2 bars too late. I'd like the order to be executed right when the indicator changes direction. I've experimented with the

    CalculateOnBarClose = false;

    but that doesn't seem to change the behavior. My order execution code occurs within the OnBarUpdate() event so maybe that's the problem. Should I be using a different event to be checking my indicator?

    Thanks in advance!

    #2
    Welcome to our forums - toggling CalculateOnBarClose in backtesting will not have any effects, it would be true in all cases as the intrabar formation is simply not know here you would work only with the granularity the underlying series can provide (OHLCV values of it).

    In realtime you can submit orders on each tick with CalculateOnBarClose set to false (the OnBarUpdate then gets called for each tick).

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    65 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    149 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    99 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    286 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X