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

Projected Line for Bollinger Bands for the current and prior sessions

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

    #31
    I think i get it.9-th argument was missing, which was for autoScale.Now it compiles and seems working as expected.

    Thank you

    Comment


      #32
      Hello outsource,

      I am glad you were able to get everything up and running.

      Please let us know if we may be of further assistance.
      Michael M.NinjaTrader Quality Assurance

      Comment


        #33
        Originally posted by NinjaTrader_MichaelM View Post
        Hello outsource,

        I am glad you were able to get everything up and running.

        Please let us know if we may be of further assistance.
        Thanks Michael,

        One little handy thing I forgot to consult with you is the session count - accessable via properties.Is there a reference for that,as well ?To have the session count accessable via code menu.

        Thank you

        Comment


          #34
          Hello outsource,

          Please see this forum post for additional information on how you might expose the session count: http://www.ninjatrader.com/support/f...ead.php?t=4991

          In the code example I created, the session count is stored in the variable:
          Code:
          bollingerSessionList.Count
          so you would want to access it after:
          Code:
          if(Bars.FirstBarOfSession){/*...where the bollingerSessionList is updated*/}
          Please let us know if we may be of further assistance.
          Michael M.NinjaTrader Quality Assurance

          Comment


            #35
            Originally posted by NinjaTrader_MichaelM View Post
            Hello outsource,

            Please see this forum post for additional information on how you might expose the session count: http://www.ninjatrader.com/support/f...ead.php?t=4991

            In the code example I created, the session count is stored in the variable:
            Code:
            bollingerSessionList.Count
            so you would want to access it after:
            Code:
            if(Bars.FirstBarOfSession){/*...where the bollingerSessionList is updated*/}
            Please let us know if we may be of further assistance.
            Thanks Michael,

            i`m trying but cant just seem to figure out.Too good for me

            Comment


              #36
              Hello outsource,

              You would use an IntSeries to store the session count at the current bar. Please see the example below:

              Add these lines into your BollingerBandLines indicator
              Code:
              #region Variables
              //...
              [COLOR="SeaGreen"]private IntSeries sessionCount;[/COLOR]
              //...
              #endregion
              Code:
              protected override void Initialize()
              {
              //...
              [COLOR="SeaGreen"]sessionCount = new IntSeries(this);[/COLOR]
              //...
              }
              Code:
              protected override void OnBarUpdate()
              {
              //...
              //insert this below the if(Bars.FirstBarOfSession) condition
              [COLOR="SeaGreen"]sessionCount.Set(bollingerSessionList.Count);[/COLOR]
              //...
              }
              Code:
              #region Properties
              //...
              [COLOR="SeaGreen"][Browsable(false)]
              [XmlIgnore()]
              public IntSeries SessionCount
              {
              	get { return sessionCount; }
              }[/COLOR]
              //...
              #endregion
              Then in your other indicator you would get the session count at the current bar by calling something like:
              Code:
              BollingerBandLines(2, 14).SessionCount[0];
              Please let us know if we may be of further assistance.
              Michael M.NinjaTrader Quality Assurance

              Comment


                #37
                Originally posted by NinjaTrader_MichaelM View Post
                Hello outsource,

                You would use an IntSeries to store the session count at the current bar. Please see the example below:

                Add these lines into your BollingerBandLines indicator
                Code:
                #region Variables
                //...
                [COLOR="SeaGreen"]private IntSeries sessionCount;[/COLOR]
                //...
                #endregion
                Code:
                protected override void Initialize()
                {
                //...
                [COLOR="SeaGreen"]sessionCount = new IntSeries(this);[/COLOR]
                //...
                }
                Code:
                protected override void OnBarUpdate()
                {
                //...
                //insert this below the if(Bars.FirstBarOfSession) condition
                [COLOR="SeaGreen"]sessionCount.Set(bollingerSessionList.Count);[/COLOR]
                //...
                }
                Code:
                #region Properties
                //...
                [COLOR="SeaGreen"][Browsable(false)]
                [XmlIgnore()]
                public IntSeries SessionCount
                {
                	get { return sessionCount; }
                }[/COLOR]
                //...
                #endregion
                Then in your other indicator you would get the session count at the current bar by calling something like:
                Code:
                BollingerBandLines(2, 14).SessionCount[0];
                Please let us know if we may be of further assistance.
                Hi Michael,

                thank you for the snippet provided.What do you mean ''in other indicator"?My intention was to access the session count in the BBLines indicator properties.It looks like the snippet you`ve provided is for the strategy usage.Or am i missing something?

                Thanks a lot!

                Comment


                  #38
                  Hello outsource,

                  Can you please clarify what you mean when you say "My intention was to access the session count in the BBLines indicator properties."?

                  We would not set the sessionCount as a property as it is a dynamic variable based on how many sessions the indicator has data for. This value is determined primarily by how many "days to load" your chart is set to.

                  Do you wish simply to plot the session Count variable so it is visible in the Data Box?

                  Thank you in advance.
                  Michael M.NinjaTrader Quality Assurance

                  Comment


                    #39
                    Originally posted by NinjaTrader_MichaelM View Post
                    Hello outsource,

                    Can you please clarify what you mean when you say "My intention was to access the session count in the BBLines indicator properties."?

                    We would not set the sessionCount as a property as it is a dynamic variable based on how many sessions the indicator has data for. This value is determined primarily by how many "days to load" your chart is set to.

                    Do you wish simply to plot the session Count variable so it is visible in the Data Box?

                    Thank you in advance.
                    Hi Michaek,

                    I want to access the days coulnt just like i access the lines colors - via properties.To be able to set the number of days back via indicator menu, as i need to.Am i clear?

                    Comment


                      #40
                      Hello outsource,

                      Changing the "Days to load" property will affect the chart and all indicators/strategies on the chart. Days and sessions are similar because usually one session occurs within one 24 hour period. So to use more or less sessions for the purposes of this indicator, you could change the "Days to load" property.

                      The "Days to load" property is not set in the indicator properties, it is set in the data series properties. The data series for the chart can be found by pressing CTRL + F while the chart is selected. You can change the number of days loaded by selecting the data series you want to change in the lower left-side box and changing the value next to "Days to load" in the right-side box and pressing OK.

                      Please see our help guide for more information: http://www.ninjatrader.com/support/h...s%2Bproperties

                      Please let us know if you have further questions.
                      Michael M.NinjaTrader Quality Assurance

                      Comment


                        #41
                        Hi MichaelM,

                        Is it possible to do the same trick with the linear regression indicator,i.e., to have projected lines from the prior session as with BB Lines,only this time to have the diagonal lines instead of the horizontal lines?If,so please suggest how.

                        Sincerely

                        Comment


                          #42
                          Hello outsource,

                          You could accomplish this although it would be slightly more mathematically complex.

                          The basis of how the indicator works would be the same.

                          The only difference is that you would have to calculate the angle that you wanted to draw the line at using the imagined line drawn between two earlier points from the linear regression indicator and then convert that into the y value of the point the line would end at (the x value the line would end at would be 0 because its plotted using barsAgo).

                          Please let me know if you have any further questions.
                          Michael M.NinjaTrader Quality Assurance

                          Comment


                            #43
                            Originally posted by NinjaTrader_MichaelM View Post
                            Hello outsource,

                            You could accomplish this although it would be slightly more mathematically complex.

                            The basis of how the indicator works would be the same.

                            The only difference is that you would have to calculate the angle that you wanted to draw the line at using the imagined line drawn between two earlier points from the linear regression indicator and then convert that into the y value of the point the line would end at (the x value the line would end at would be 0 because its plotted using barsAgo).

                            Please let me know if you have any further questions.
                            Hi Michael,

                            no matter i try,i can`t seem to figure it out.Would you be willing to assist with it?I attach the indicator.
                            Attached Files

                            Comment


                              #44
                              What`d really want is to kind of snap of the channel position at the session close and mirror /project it into the next session.

                              Comment


                                #45
                                Hello outsource,

                                What you are asking for is outside the scope of platform support. Unfortunately we are unable to provide custom programming services. I will leave this thread open in case another forum member has any further information/input on how to create this for you.

                                Please let me know if you have any questions.
                                Michael M.NinjaTrader Quality Assurance

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by algospoke, 04-17-2024, 06:40 PM
                                6 responses
                                48 views
                                0 likes
                                Last Post algospoke  
                                Started by arvidvanstaey, Today, 02:19 PM
                                4 responses
                                11 views
                                0 likes
                                Last Post arvidvanstaey  
                                Started by samish18, 04-17-2024, 08:57 AM
                                16 responses
                                61 views
                                0 likes
                                Last Post samish18  
                                Started by jordanq2, Today, 03:10 PM
                                2 responses
                                9 views
                                0 likes
                                Last Post jordanq2  
                                Started by traderqz, Today, 12:06 AM
                                10 responses
                                21 views
                                0 likes
                                Last Post traderqz  
                                Working...
                                X