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

Slope CCI Max error

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

    #46
    Thanks Josh

    I get confused.

    Since I put on Initialize()
    Add(PeriodType.Range, 16);//This is 16 ticks Range Bars chart as secondary Time frame on Primery Chart (8 ticks)

    BarsInProgress==1 (Is this the secondary Time frame bar on Primery Chart (8 ticks)?)

    So everything that I want from CurrentBar of secondary time frame bar must start on primery at this bar (BarsInProgress==1) Does Ninja Trade knows where it is on Primery Chart?

    Is BarsInProgress==0 the 1st bar on primery chart?

    I don't know to express the DrawLine StartBar. I tried to do
    barsAgoOpen = MRO(delegate{return Close [0] ==Opens[1][0];},1,CurrentBar);

    Doesn't work. I tried 0 (zero) and BarsInProgress==1 doesn't work as well

    if (BarsInProgress == 1)
    DrawLine("OpenRange16", false, 0, Opens[1][0], 0,
    Opens[1][0], Color.Cyan, DashStyle.Dash, 1);
    }

    Can you please help me on this, I already read
    http://www.ninjatrader-support.com/HelpGuideV6/helpguide.html?MultiTimeFrameInstruments


    Thanks

    Comment


      #47
      Rita,

      Sorry I am not sure what exactly you are asking. Every time your code enters OnBarUpdate() it is within the context of either BarsInProgress == 0 or BarsInProgress == 1. It will run through the code in OnBarUpdate() as either of them depending on which one has the event first (in most cases, BIP=0 will have the event first).

      When you want to run logic with a mix of Opens[1][0] and compare it against Close[0] this means you need to actually filter your entire OnBarUpdate() to be within BIP0 because when you are in BIP0, Close[0] would be for BIP0. If you were in BIP1, Close[0] would be equivalent to Closes[1][0] and then the comparison becomes invalid.
      Josh P.NinjaTrader Customer Service

      Comment


        #48
        Thanks Josh

        I don't need to compare them, I thought it was the way to find Bar Ago the Open bar from secondary chart start for primary chart knows where starts DrawLine, it was for Bar Start. If I put 0 (zero) it is CurrentBar on primary chart but not Open price on CurrentBar on Secondary Chart and I need this is a unique line during all CurrentBar from secondary chart on primary chart.

        What I need to know is what I put on DrawLine's Bar Start argument to get the CurrentBar and Open value of the secondary chart. It doesn't work with BarsInProgress==1 that was what I wanted to say DrawLine start since Open[1][0] is known.

        Thanks

        Comment


          #49
          Rita, could you please share a code snippet of what you're currently trying to draw with the line? The added chart / timeframe would just be internally for calculations, so the visualization would still take place on the primary series where you start the indicator from.
          BertrandNinjaTrader Customer Service

          Comment


            #50
            Hi

            I used the script SampleMultiColoredPlot to do other for CCIMA MultiColoredPlot. I changed on the script SMA(period) by CCIMA(smaperiod,period) it works good unless if I put Calculate on bar close=false the actual bar doesn't felow the CCIMA, only actual bar the rest is ok.

            Could you please tell me how do I fix it?

            Thanks

            Comment


              #51
              Rita, could you please post a screenshot of the outcome you see? I'm not aware of CalculateOnBarClose = false issues for the sample code you cited.

              Thanks
              BertrandNinjaTrader Customer Service

              Comment


                #52
                Thanks Bertrand

                On last bar yellow line is normal CCIMA (we have CCIMA MultiColoredPlot over it in Blue and Orange) ; Blue line on last bar doesn't match CCIMA, it only match on bar close and next bar it happens the something.
                Attached Files

                Comment


                  #53
                  Please post the exact scripts in use. Thank you.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #54
                    Thanks Josh

                    Here you have the scripts CCIMA and CCIMAMultipleColoredPlot
                    Attached Files

                    Comment


                      #55
                      Rita, thanks for those - are working in our 6.5 release or 7 beta?

                      Thanks
                      BertrandNinjaTrader Customer Service

                      Comment


                        #56
                        Thanks Bertrand

                        I'm working on 6.5

                        Comment


                          #57
                          Thanks Rita - I could reproduce this issue on 6.5 with your code, however it all worked as expected on our NT7 Beta 20, therefore I would suggest you start working in this environment if you need this working on CalculateOnBarClose = false.
                          BertrandNinjaTrader Customer Service

                          Comment


                            #58
                            Thanks Bertrand

                            A time ago, I experimented a lot of problems importing my scripts to NT7 that I decided forget NT7, even script imported from the forum that says optimized to NT7 like for example CCI Forecast gave me errors on import. That put me too nervous.

                            By the way I adapted the script SampleMultiColoredPlot to others indicators all of them work good on Calculateonbarclose=false except CCIMA. (on NT6.5)

                            Comment


                              #59
                              I can understand Rita, here's what I would like you to try : in the CCIMA you call in your script, please do not set CalculateOnBarClose in the called script, please remove it completely and then retry.
                              BertrandNinjaTrader Customer Service

                              Comment


                                #60
                                Thanks Bertrand

                                I think you didn't understand one thing the script that has problem is CCI MA MultiColoredPlot the CCIMA itself is ok the problem is the script to do CCMA with diferente colors for rise and fall. I already did a lot of indicator with dif colors for rise and fall witout any problem except with CCIMA I don't understand why this happen on CCI must have an explanation. It stay last bar the value is zero as you can see on screenshot until the bar close on bar close it assume the real value but new bar has the same problem again and so on

                                Any way I did what you asked and didn't fix it

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by DJ888, Today, 10:57 PM
                                0 responses
                                6 views
                                0 likes
                                Last Post DJ888
                                by DJ888
                                 
                                Started by MacDad, 02-25-2024, 11:48 PM
                                7 responses
                                158 views
                                0 likes
                                Last Post loganjarosz123  
                                Started by Belfortbucks, Today, 09:29 PM
                                0 responses
                                7 views
                                0 likes
                                Last Post Belfortbucks  
                                Started by zstheorist, Today, 07:52 PM
                                0 responses
                                7 views
                                0 likes
                                Last Post zstheorist  
                                Started by pmachiraju, 11-01-2023, 04:46 AM
                                8 responses
                                151 views
                                0 likes
                                Last Post rehmans
                                by rehmans
                                 
                                Working...
                                X