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 r68cervera, Today, 05:29 AM
        0 responses
        2 views
        0 likes
        Last Post r68cervera  
        Started by geddyisodin, Today, 05:20 AM
        0 responses
        3 views
        0 likes
        Last Post geddyisodin  
        Started by JonesJoker, 04-22-2024, 12:23 PM
        6 responses
        33 views
        0 likes
        Last Post JonesJoker  
        Started by GussJ, 03-04-2020, 03:11 PM
        12 responses
        3,239 views
        0 likes
        Last Post Leafcutter  
        Started by AveryFlynn, Today, 04:57 AM
        0 responses
        6 views
        0 likes
        Last Post AveryFlynn  
        Working...
        X