Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Problem with Add()

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

    Problem with Add()

    I have included a picture of what I am talking about to this message. I am adding the WoodiesCCI indicator programmatically (using Add() in Initialize) in the chart on the right, and adding it manually (adding it from the chart) to the chart on the left.

    The CCI line is not being drawn on the right chart until the bar is complete. Actually, it is being draw, but it always draws the CCI to the Zero line until the bar is complete, then it draws it correctly and starts on the next bar (at the zero line again).

    In addition, when looking at the Data Box on the active bar, all information is there OTHER than the CCI information - which is blank.

    The chart on the left works perfectly.

    I have tried setting CalculateOnBarClose to both true and false with no change. I am using version 6.5.

    Any ideas??



    Thanks,

    -Scott
    Attached Files

    #2
    I also wanted to mention the Turbo line appears to have the same problem.

    Thanks,

    -Scott

    Comment


      #3
      If the strategy's CalculateOnBarClose property is set to false, then the CCI in the Add() method will take on that property.
      RayNinjaTrader Customer Service

      Comment


        #4
        I have tried both True and False with no change in behavior.

        Thanks,

        -Scott

        Comment


          #5
          I have everything in the strategy commented out. The only thing I am doing at this piont is adding the WoodiesCCI indicator as seen below.

          Code:
           
          protected override void Initialize()
          {
          CalculateOnBarClose = false;
          Add(WoodiesCCI(2, 5, 14, 34, 25, 6, 60, 100, 2));
          Add(EMA(34));
          }
          Thanks for the help...

          -Scott

          Comment


            #6
            So we are on the same page -

            - When adding WoodiesCCI via Add(), the isntance of this indicator on the chart *always* plots as if CalculateOnBarClose was set to true..meaning, there is never a plot value on the right most bar on the chart

            Is my understanding correct?
            RayNinjaTrader Customer Service

            Comment


              #7
              Yes that is correct. The price bars are plotting fine, but the WCCI is not plotting until the bar is closed. The CCI line is *always* being drawn from the last bar to zero line of the forming bar - just as in the image I attached on the first message.

              Thanks,

              -Scott

              Comment


                #8
                Ray,

                I may have found my problem, but could use some clarification. I was able to fix it (I think) by setting the CalulateOnBarClose to false AND setting the Calculate On Bar Close parameter under the strategy configuration screen to False as well.

                I was under the impression the strategy would take the behavior from the Initialize method.

                I think I have it fixed now, but wanted to ask if this is the way I need to code all Strategies?

                Thanks,

                -Scott

                Comment


                  #9
                  I believe we have modified behaviour in 6.5 to overwrite certain parameters in the Strategy dialog by properties set in the Initialize() method. For sure this was the issue. Thanks for reporting back.
                  RayNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by DJ888, 04-16-2024, 06:09 PM
                  4 responses
                  11 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by terofs, Today, 04:18 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post terofs
                  by terofs
                   
                  Started by nandhumca, Today, 03:41 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post nandhumca  
                  Started by The_Sec, Today, 03:37 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post The_Sec
                  by The_Sec
                   
                  Started by GwFutures1988, Today, 02:48 PM
                  1 response
                  9 views
                  0 likes
                  Last Post NinjaTrader_Clayton  
                  Working...
                  X