Thank you
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!
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
NinjaTrader
Projected Line for Bollinger Bands for the current and prior sessions
Collapse
X
-
Originally posted by NinjaTrader_MichaelM View PostHello outsource,
I am glad you were able to get everything up and running.
Please let us know if we may be of further assistance.
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
-
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
Code:if(Bars.FirstBarOfSession){/*...where the bollingerSessionList is updated*/}
Michael M.NinjaTrader Quality Assurance
Comment
-
Originally posted by NinjaTrader_MichaelM View PostHello 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
Code:if(Bars.FirstBarOfSession){/*...where the bollingerSessionList is updated*/}
i`m trying but cant just seem to figure out.Too good for me
Comment
-
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
Code:BollingerBandLines(2, 14).SessionCount[0];
Michael M.NinjaTrader Quality Assurance
Comment
-
Originally posted by NinjaTrader_MichaelM View PostHello 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
Code:BollingerBandLines(2, 14).SessionCount[0];
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
-
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
-
Originally posted by NinjaTrader_MichaelM View PostHello 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.
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
-
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
-
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
-
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
-
Originally posted by NinjaTrader_MichaelM View PostHello 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.
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
-
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
by algospoke
Today, 06:18 PM
|
||
Started by arvidvanstaey, Today, 02:19 PM
|
4 responses
11 views
0 likes
|
Last Post Today, 04:08 PM | ||
Started by samish18, 04-17-2024, 08:57 AM
|
16 responses
61 views
0 likes
|
Last Post
by samish18
Today, 03:30 PM
|
||
Started by jordanq2, Today, 03:10 PM
|
2 responses
9 views
0 likes
|
Last Post
by jordanq2
Today, 03:23 PM
|
||
Started by traderqz, Today, 12:06 AM
|
10 responses
21 views
0 likes
|
Last Post
by traderqz
Today, 02:49 PM
|
Comment