Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

entry and exit plots on charts using OnBarClose

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

    entry and exit plots on charts using OnBarClose

    I am using the Calculate.OnBarClose to do my calculations for a strategy, my question is, when entering a long or short, the plot markers on the chart show the trade as taking place on the next bar, not the bar that the calculation is actually done on.

    I understand that no calculation is done until after the bar has been closed but it seems that since I am entering a trade based on that bar it would draw the entry/exit markers on that bar and not the next one.

    #2
    Hello andrewjoseph939,

    Thanks for your question. I have moved this thread to the Strategy Development forum as you are referring to NinjaScript strategies.

    With Calculate.OnBarClose, the strategy logic is calculated after the bar has closed. The bar is already closed and then the order is submitted, so the order will be filled with the price action that comes after that bar closed. The execution markers will show on the bar where the order was executed.

    If you would like to learn more about how orders are filled in a backtest, please see below. (Please note that there is no intrabar movement with a backtest, so fill prices are estimated using "virtual bars" to mimic how the market may have moved.

    https://ninjatrader.com/support/help...ical_fill_.htm

    Realtime orders will be filled with actual market data after the order is submitted.

    Please let us know if you have any additional questions.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Skifree, Today, 03:41 AM
    5 responses
    13 views
    0 likes
    Last Post Skifree
    by Skifree
     
    Started by Mongo, Today, 11:05 AM
    3 responses
    13 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by traderqz, Today, 12:06 AM
    6 responses
    13 views
    0 likes
    Last Post traderqz  
    Started by traderqz, Yesterday, 09:06 AM
    5 responses
    34 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by guillembm, Today, 11:25 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X