Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

plots converging

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

    plots converging

    I added NVWAP to my strategy and the plots on the chart are tightly compressed together. (pic 1 - indicator chart on left, strategy chart on right)

    If I refresh the chart, they plot normally however converge again when I restart replay. (pic 2 - strategy chart after refresh)

    The code I am using is:

    Add (NVWAP());

    Using the same code in a test strategy has no problem. (pic 3).

    Any idea what could cause different results in my strategy?

    I need to Add the indicator to pick up the values and of course the values are as far off as the plots. I do not add any plots in my strategy that could conflict as far as I know.

    Thanks.
    Attached Files
    Last edited by ATI user; 03-10-2008, 07:34 AM.

    #2
    Likely the number of bars used in the indicator calculations? When running the strategy, set the MinBarsRequired to a lower number to see if the indicator plot values react differently.
    RayNinjaTrader Customer Service

    Comment


      #3
      BarsRequired

      Thanks Ray

      I set the BarsRequired in the Initialize method in both the Indicator and the Strategy to values ranging from 1 to 100.

      In both the Indicator and the Strategy I returned if CurrentBar < Bars Required.

      Running in the strategy chart, the bars still converged at all BarsRequired values.

      Running in an indicator chart, the different BarsRequired values did not affect the plot.

      Question: in the NinjaScript generated code in the Indicator it has "indicator.BarsRequired = BarsRequired;" yet does not declare BarsRequired in the Initialize method. How does that work?...figures out its own value? I thought my setting BarsRequired in Initialize would make a difference...however it did not.

      What else could it be?

      Comment


        #4
        I would debug. Are you sure the same indicator class is being used in both scenarios? Adding some Print() statements would verify. BarsRequired in the indicator class is not a publicy supported property at this time.
        RayNinjaTrader Customer Service

        Comment


          #5
          You lost me there Ray. If by both scenarios you mean running the indicator in my cs and in the test cs (which is completely empty except for Adding the indicator), then yes...the indicator is the same and the class is 'public class'. Both my strategy and the test strategy are the same public class.

          In fact, thinking something in my code was affecting the plot, I commented out all my code so it was empty just like the test strategy and the plots still converge. So what could be the difference between the test strategy and mine if the only code they have is the Add statement??? See pic...white chart is test cs and black chart is mine....both have one line of code Add(NVWAPmod());

          As far as the Print() statements I do not know what you mean re determining class. Please explain.

          Thanks
          Attached Files
          Last edited by ATI user; 03-10-2008, 11:58 AM.

          Comment


            #6
            got it...

            the difference is the indicator uses CalculateOnBarClose = true

            my strategy uses CalculateOnBarClose = false

            when I change it to true, it works

            left chart is my cs with 'false'....middle chart is test cs with 'true'...right chart is my cs with 'true'

            my cs false setting must have overridden the true setting in the indicator....if you set the indicator (in an indicator chart) to false, it also converges....
            Attached Files
            Last edited by ATI user; 03-10-2008, 01:54 PM.

            Comment


              #7
              ATI User,

              The converging on these VWAP indicators simply happens because of the way each tick adds to the aggregate calculation. If you run tick by tick in the middle of the day, the latest ticks will quickly outweigh the previous volumes from all the historical bars which is why the indicator converges. It is simply a bug in regards to the indicator(s) and someone will just have to go back through them and work out the kinks.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Nvwap

                NVWAP does not converge at any time if CalculateOnBarClose = true

                Comment


                  #9
                  Thats because NVWAP doesn't do any tick calculations for the VWAP. It just approximates it all the way. Sticking strictly to VWAP's definition would mean you calculate it on every tick and not on a bar-by-bar basis.
                  Josh P.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by stafe, Today, 10:43 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post stafe
                  by stafe
                   
                  Started by UltraNIX, Today, 09:13 AM
                  1 response
                  9 views
                  0 likes
                  Last Post NinjaTrader_ChrisL  
                  Started by Tuxstuff215, Today, 06:32 AM
                  1 response
                  15 views
                  0 likes
                  Last Post NinjaTrader_ChrisL  
                  Started by carlot, Today, 08:10 AM
                  1 response
                  17 views
                  0 likes
                  Last Post NinjaTrader_ChrisL  
                  Started by KirkHammett, Yesterday, 11:15 PM
                  1 response
                  16 views
                  0 likes
                  Last Post NinjaTrader_ChrisL  
                  Working...
                  X