• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 U0000999, Today, 11:17 PM
        0 responses
        3 views
        0 likes
        Last Post U0000999  
        Started by tjendra, Today, 10:00 PM
        0 responses
        7 views
        0 likes
        Last Post tjendra
        by tjendra
         
        Started by momchi, Today, 09:19 PM
        0 responses
        5 views
        0 likes
        Last Post momchi
        by momchi
         
        Started by tomd0361, Today, 08:58 PM
        0 responses
        7 views
        0 likes
        Last Post tomd0361  
        Started by babouin77, Today, 08:37 PM
        0 responses
        5 views
        0 likes
        Last Post babouin77  
        Working...
        X