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 cmoran13, Yesterday, 01:02 PM
    0 responses
    27 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    18 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    160 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    95 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    148 views
    2 likes
    Last Post CaptainJack  
    Working...
    X