I was looking to calculate the width of Bollinger Bands for a strategy using (upper band - lower band) / middle band. I understand I can't do that directly in strategy builder, but from reading similar posts, it's possible using a data series? My problem is figuring out how to manipulate the individual series results after they've been defined. I don't see a way in the conditions and actions area to subtract one from the other and store the result in a variable or another series. Thanks for your help!
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Arithmetic in Strategy Builder/Data Series
Collapse
X
-
Arithmetic in Strategy Builder/Data Series
Good morning,
I was looking to calculate the width of Bollinger Bands for a strategy using (upper band - lower band) / middle band. I understand I can't do that directly in strategy builder, but from reading similar posts, it's possible using a data series? My problem is figuring out how to manipulate the individual series results after they've been defined. I don't see a way in the conditions and actions area to subtract one from the other and store the result in a variable or another series. Thanks for your help!Tags: None
-
Hello medicmiked,
Yes that is possible with a custom series. The first part of your math could be accomplished by using a series, the upper - lower can be assigned to a series. As a separate action for a second series you can use the result / middle.
These are the steps to do that.- In the builder go to the additional data tab
- Expand the Custom Series section
- Click Add
- Name your first series as diff and leave its default as type double.
- Click Add again and add a second series named Result
- In set 1 actions click Add
- Select Misc -> Set diff
- Hover the mouse over the series value field and click Set
- In the window that appears select Indicators -> Bollinger -> Select the Upper plot
- In the properties that appear you will see the offset area, select the minus symbol
- Hover the mouse over the 0 value and click Set
- Select Indicators 0-> Bollinger -> select the lower band plot
Back in Set 1 click Add to add another action- Select Misc -> Set Result
- Hover the mouse over the series value field and click Set
- Select Misc -> Custom Series and select diff
- In the Offset area select Division
- Hover the mouse over the 0 value and click Set
- Select Indicators -> Bollinger -> Select the middle band
At this point the result is set to the Result series To use the value in other sets you can find it under the Misc -> Custom series option. Custom series work the same way as other series like the close price, you can specify a bars ago if needed, the current value will be at 0 bars ago.
Comment
-
PERFECT! Thanks so much for your help! I figured out how to set them, just now how to reference/manipulate them. Never thought to look into the "custom series" under Misc. Thanks again and have a great weekend!
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
20 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
119 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
63 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
41 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
45 views
0 likes
|
Last Post
|

Comment