Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why this weird behavior when analyzing simultaneous Bars Object script

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

    Why this weird behavior when analyzing simultaneous Bars Object script

    Hi Ninjas,

    I've developing a code very simple but using simultaneous Bars object. I call each one of these Bars object correctly using the BarsInProgress and Close, Closes prices...etc. When I put this Scrip doing backtest with the Strategy Analyzer, I get satisfactory global performance as I expected, BUT when I go into details and watched in Executions I realized that there's no logic continuing between Trades-ID number and its execution time. If you sort all trades by time or by NT-ID number you´ll realize that there are a lot of trades that breaks the logic order.

    Following examples attached as jpeg files will show you what I meant.

    The explanation to me is that since I work with BarOnClose, every different Bar object has different closing times, so when a signal is triggered "maybe" the system marks that trade when the Bar object is in spite of present time.

    - Does this explanation sound logic to you ?
    - Should this weird behavior make me not to trust in the code?
    If so, what steps should I take in order to avoid these errors?

    Thanks
    Attached Files
    Last edited by pstrusi; 11-20-2013, 03:22 AM.

    #2
    pstrusi, I guess I'm not exactly sure what you mean - your entry will trigger whenever the condition in your bars object evaluates to true, same would apply to the exits you trigger. How the trades in your backtest would be grouped together in the managed mode would be determined by your entry and exit signal names used to tie signals together.

    What ID's are you comparing here the order and trade id?

    The execution time would be tied to your bar object yes, as in backtesting you would only test with CalculateOnBarClose = true, so you would see the execution on the open of the next bar as earliest possible trade point.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Bertrand, thanks for the quick response

      I'ts pretty easy what I mean, I'm showing that when you work with several simultaneous Bars Objects in the Strategy analyzer, often you get these "out of logic order" by Time or by Order ID.

      In the Script I decided not to put any signal names on purpose to prevent this kind of behavior. What I'm comparing is Time Vs Order ID. As you can see easily in the attached files there are trades clearly out of time or out of ID order.

      At first, since it's a Backtest, I'm not too worry about how the trades are grouping in, but clearly the Strategy Analyzer might need some review when is assessing several Bars Object, it's a suggestion.

      Comment


        #4
        pstrusi, from what you've shown I'm not exactly clear sorry. We would need something here on our end to reproduce exactly what you do, I'm feeling it is connected to you're trying to scale out in backtesting without scaling in first. Do you have an example script you're using that would show this kind of behavior you could forward to us?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Bertrand in the files attached it's pretty clear the out of any logic order trades. However, since I've seen before this kind of non-vital issue, doing backtest, i'm not too worry, my intention was to let you know.

          At this moment I'm not allowed to send any code or part of it, I'm so sorry.

          Regards

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by sidlercom80, 10-28-2023, 08:49 AM
          167 responses
          2,260 views
          0 likes
          Last Post jeronymite  
          Started by warreng86, 11-10-2020, 02:04 PM
          7 responses
          1,362 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by Perr0Grande, Today, 08:16 PM
          0 responses
          5 views
          0 likes
          Last Post Perr0Grande  
          Started by elderan, Today, 08:03 PM
          0 responses
          9 views
          0 likes
          Last Post elderan
          by elderan
           
          Started by algospoke, Today, 06:40 PM
          0 responses
          10 views
          0 likes
          Last Post algospoke  
          Working...
          X