Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calculate on Bar Close

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

    Calculate on Bar Close

    Hi,

    I have an issue with backtesting.
    I compare parameters of two bars (current and previous) and if conditions are true, then I enter order on current bar. Problem with historical backtesting is that it makes all comparisons after current bar close and executes trade on next bar.In realtime, everything works. Please help, hw can I overcome this issue in historical simulation at least approximately.

    Best regards

    #2
    Hello saabas,
    Thanks for writing in and I am happy to assist yoy.

    Unfortunately during backtest, the strategy is calculated on the bar close only. However you can create a multi-timeframe strategy and submit the order in the higher granuality bar to get more realistic backtest value http://www.ninjatrader.com/support/h...nstruments.htm

    Please refer to this sample reference code for more details on the same http://ninjatrader.com/support/forum...ead.php?t=6652

    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Hi NinjaTrader_Joydeep, whats the method to paint the first bar ( the one that´s currently open) of a different color than the rest?

      basically i need to differentiate the current bar from the closed ones, i keep entering before the close

      thanks

      Comment


        #4
        Hello kabott,
        Thanks for writing in and I am happy to assist you.

        You can use the BarColorSeries to color the first bar http://www.ninjatrader.com/support/h...olorseries.htm

        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ScottWalsh, Today, 04:52 PM
        0 responses
        1 view
        0 likes
        Last Post ScottWalsh  
        Started by ScottWalsh, Today, 04:29 PM
        0 responses
        5 views
        0 likes
        Last Post ScottWalsh  
        Started by rtwave, 04-12-2024, 09:30 AM
        2 responses
        22 views
        0 likes
        Last Post rtwave
        by rtwave
         
        Started by tsantospinto, 04-12-2024, 07:04 PM
        5 responses
        70 views
        0 likes
        Last Post tsantospinto  
        Started by cre8able, Today, 03:20 PM
        0 responses
        7 views
        0 likes
        Last Post cre8able  
        Working...
        X