Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

RC1 strategy analyzer optimization results: some rows zero PnL, zero trade count

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

    #16
    Have you added any additional series to this strategy? The bars required setting will apply to all series in the strategy.
    Ryan M.NinjaTrader Customer Service

    Comment


      #17
      Bug in Pivots indicator

      OK, good point.

      I am using another longer timeframe as well.

      So you are saying that NT will disregard the too-early "From" date which I set. Will it count the Bars Required using the longest timeframe from the first bar of data from the HDM available?

      And start executing OnBarUpdate() from that bar?

      Secondly I think you missed the second half of my post: there is a problem with the NT-own Pivots indicator:

      Originally posted by adamus View Post
      ....

      What I am seeing is that the Pivot indicator sometimes produces zero values for that date which causes the problem I'm having.

      Normally it's like this on the first bar:


      2009-11-13 18:00:00 pivot.R:0.94448 pivot.S:0.93428 ma1:0.97428 volatility:0.00030 atr1:0.00443


      But once in a while, randomly, about 1 in 10 or 1 in 20 runs, I get this:

      2009-11-13 18:00:00 pivot.R:0.00000 pivot.S:0.00000 ma1:0.97428 volatility:0.00030 atr1:0.00443

      If I check for Pivot.R1.ContainsValue(0) and it's false, then my strategy won't start on that bar, so the run will have a different number of bars in the run compared to runs where Pivot.R1 behaves.

      What is the situation? Has anybody else raised bugs against the Pivot indicator?

      Comment


        #18
        The strategy won't start processing until minimum bars required has been met for all series in the strategy. The from date is the earliest it will start looking at bars, but you need actual data before it does anything.

        You're running into issues with pivot indicator in your custom strategy, with extra layers of complexity on top of it. We can't debug what's happening in your strategy but if you find a simplified case where pivots do not work as expected, please let us know. .
        Ryan M.NinjaTrader Customer Service

        Comment


          #19
          Originally posted by NinjaTrader_RyanM View Post
          The strategy won't start processing until minimum bars required has been met for all series in the strategy. The from date is the earliest it will start looking at bars, but you need actual data before it does anything.
          When you say "you need actual data before it does anything", do you mean that it counts the Bars Required from the first data?


          Originally posted by NinjaTrader_RyanM View Post
          You're running into issues with pivot indicator in your custom strategy, with extra layers of complexity on top of it. We can't debug what's happening in your strategy but if you find a simplified case where pivots do not work as expected, please let us know. .
          How can any strategy that I am using affect the output of the Pivots indicator?

          The only relevant info is that I initialize it like this:

          Code:
          pivot = Pivots(PivotRange.Daily, 
                          HLCCalculationMode.DailyBars, 0.0, 0.0, 0.0, 100);
          and that I see the output as zero once every 10 runs on average in backtesting, when it should be 0.9551 or whatever.

          I suggest you put that into your simplest strategy and check its output, unless you can convince me that I am somehow affecting the output from Pivots, in which case I'll happily do it.

          Comment


            #20
            Bars required must be satisfied for all series, not just the first. It starts looking for bar objects anytime beyond the from date specified.

            I'm not able to reproduce the issue you reported accessing pivot values. 1 / 10 frequency doesn't give us much to go on, but willing to try if you can share a stripped down strategy that shows the issue.

            Please isolate to a simple script and let us know the steps needed to see the issue. Share the file you're working with. The strategy you sent earlier is too complex, and will not help us isolate issues related to pivots.
            Ryan M.NinjaTrader Customer Service

            Comment


              #21
              Ryan,

              before I try to nail this bug down, I need to understand exactly what the mechanism is and how BarsRequired is applied to affect the time and date of the first bar that calls OnBarUpdate().

              I need an explicit answer from you: does NT7 count the BarsRequired from the date of the first data in the Historical Data Manager regardless how I set the "From" date?

              Comment


                #22
                I've nailed it

                OK Muchachos,

                no need to give me the answer about BarsRequired - I've nailed the bug whatever that effect is.

                First of all, you need IB minute bars going back to 2009-10-21. I'm using $AUDCAD but I've seen it on all the forex instruments.

                Attached is the stripped down strategy that displays the Pivots bug.

                Here are the settings I am using:
                Code:
                [FONT=Courier New]Item                                   Value
                Parameters
                MaLength                               60
                Data series
                Price based on                         Last
                Type                                   Minute
                Value                                  5
                Time frame
                From                                   01/03/2009
                To                                     30/06/2010
                Session template                       <Use instrument settings>
                General
                Include commission                     False
                Label                                  PivotsBug
                Maximum bars look back                 TwoHundredFiftySix
                Min. bars required                     200
                Historical Fill Processing
                Fill type                              Default
                Slippage                               0
                Order Handling
                Entries per direction                  1
                Entry handling                         AllEntries
                Exit on close                          False
                Order Properties
                Default quantity                       100000
                Set order quantity                     by default quantity
                Time in force                          Gtc
                [/FONT]


                Just run the backtest on the strategy. Sometimes it will show results, sometimes there will be no results (zero PnL, zero trades).

                If you initially get just one or the other, keep r
                unning it - at least 30 times.

                You will also see occasional runs where the test results are not zero, nor are they what Pivots initializes properly. But I ran it 50 times before I saw that.

                The conclusion is that the Pivots indie has a bug where it sometimes remains null, i.e. ContainsValue = false, and sometimes gets initialized.
                Attached Files
                Last edited by adamus; 11-19-2010, 04:25 AM.

                Comment


                  #23
                  Hi Adamus, thanks for your efforts in stripping the code down - the Pivots are an 'async loading' indicator meaning you can run into race events loading the needed daily series in the daily calculation mode you use - http://www.ninjatrader.com/support/f...ad.php?t=32489

                  Would you see the same init issues when working with CalculationMode.Intraday?

                  Thanks,

                  Comment


                    #24
                    Edited!

                    Yes, I saw that new thread that the indie starts for itself, but I had blanked it from my mind, such is the insanity of using threads like that.

                    EDIT: Ignore this (((Unfortunately even with CalculateFromIntradayData, I'm still seeing this effect. Try it out yourself. Perhaps it ignores that setting for some reason.)))

                    It's just those crazy yen prices are outside the bounds of my checks - so sorry, we're all OK again now

                    Please ignore the rest of the message!

                    END EDIT.




                    It makes it unusable for strategies, basically, don't you agree, assuming that this is the cause of the randomness.

                    There is another Pivots indie from user Harry here that I'll check out: http://www.ninjatrader.com/support/f...d=4&linkid=343

                    although according to the other thread you posted, it looks like Harry based it on this one. I'll have to check that out with him.
                    Last edited by adamus; 11-19-2010, 08:08 AM.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    597 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    343 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    103 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    556 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    555 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X