Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting trade on day's close

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

    Backtesting trade on day's close

    Let's say my indicator was triggered at the close of the daily bar on day X. When I do any enter position (limit or not) command in the backtest, it initiates the trade at X+1. I've managed for now to change it so that when I enter the position, I trigger at day X's closing price. However, it's still being entered on day X+1.

    Is there a way such that I can backtest getting the close of day X, and (retroactively?) entering an order on day X at the close price?

    Does this have anything to do with how the daily closes are read? eg. Are they read in as of 12am the next day or something? I use esignal for my feed.

    #2
    Hi pretender,

    Historical order timings always works the same and you could not change to submit to close of a bar. A condition evaluates true and then order is submitted to the next bar. In real time and with CalculateOnBarClose = false, conditions are evaluated with each tick and if true will submit the orders while the bar is forming.

    To get increased granularity in historical you can add a smaller, secondary time frame, following principles in this reference sample:
    You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by


    With this, the order is still submitted to the next bar after the condition, but the smaller series provides increased granularity.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DanielTynera, Today, 01:14 AM
    0 responses
    2 views
    0 likes
    Last Post DanielTynera  
    Started by yertle, 04-18-2024, 08:38 AM
    9 responses
    40 views
    0 likes
    Last Post yertle
    by yertle
     
    Started by techgetgame, Yesterday, 11:42 PM
    0 responses
    11 views
    0 likes
    Last Post techgetgame  
    Started by sephichapdson, Yesterday, 11:36 PM
    0 responses
    2 views
    0 likes
    Last Post sephichapdson  
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,615 views
    0 likes
    Last Post aligator  
    Working...
    X