Announcement

Collapse
No announcement yet.

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 yodaler, Today, 06:12 PM
    0 responses
    4 views
    0 likes
    Last Post yodaler
    by yodaler
     
    Started by op1031, Today, 05:16 PM
    0 responses
    1 view
    0 likes
    Last Post op1031
    by op1031
     
    Started by fscabrera03, Today, 01:18 PM
    1 response
    12 views
    0 likes
    Last Post fscabrera03  
    Started by BottomShark77, Today, 12:20 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by bowling, Today, 06:16 AM
    3 responses
    30 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Working...
    X