Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem with backtest

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

    Problem with backtest

    Hello,

    I have problem with backtesting.

    See situation on the attachment - one is from Multicharts, second from NinjaTrader.

    Ninja trader fill one stoploss and one trade moreover than Multicharts.
    By my opinion wrong.
    On the blue diamond is stop order, on the red diamond is stoploss.

    When is candle on the top, Ninja buy, but candle certainly not return to the bottom!

    I use same data in Multicharts and NinjaTrader.
    Resolution of data is one minute and one candle have 15 minute.

    I test it with "CalculateOnBarClose = false" too, withou changes...

    Petr
    Attached Files

    #2
    Hello Petr,

    When your strategy is processing Historically or while Backtesting NinjaTrader is always going to process your Strategy with CalculateOnBarClose (COBC) true, only as real-time comes into NinjaTrader will your strategy process on every tick of data with COBC set to false.

    This is why you may see your Stop Loss order get his since after you are in position NinjaTrader only has access to the Open, High, Low, Close values so if the Low is low enough to hit your stop loss NinjaTrader will fill that order.

    If you would like to have some intrabar granularity to your strategy when backtesting you may view the following example that can show you how to add this logic into your strategy.
    You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by
    JCNinjaTrader Customer Service

    Comment


      #3
      Hello, super, it work. But this unnecessary difficult. Thanks Petr

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Tin34, Today, 03:30 AM
      2 responses
      11 views
      0 likes
      Last Post Tin34
      by Tin34
       
      Started by sastrades, Yesterday, 09:59 AM
      2 responses
      26 views
      0 likes
      Last Post brucerobinson  
      Started by ETFVoyageur, Today, 12:52 AM
      1 response
      12 views
      0 likes
      Last Post Leeroy_Jenkins  
      Started by lollers, Today, 03:26 AM
      0 responses
      10 views
      0 likes
      Last Post lollers
      by lollers
       
      Started by aliyahany, Today, 03:16 AM
      0 responses
      2 views
      0 likes
      Last Post aliyahany  
      Working...
      X