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 pibrew, Today, 06:37 AM
    0 responses
    0 views
    0 likes
    Last Post pibrew
    by pibrew
     
    Started by rbeckmann05, Yesterday, 06:48 PM
    1 response
    12 views
    0 likes
    Last Post bltdavid  
    Started by llanqui, Today, 03:53 AM
    0 responses
    6 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    10 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    15 views
    0 likes
    Last Post AaronKoRn  
    Working...
    X