Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
BB Stops From Thinkscript custom indicator
Collapse
X
-
BB Stops From Thinkscript custom indicator
Hi All, I am looking for something like the cyan/ magenta dots seen on the attached chart. Basically like an ATR trailing stop but instead it uses Bollinger Bands to calculate not sure exactly. Please help! This indicator is very important to my trading visually. The code is not copyrighted or being sold anywhere. I can post here if it is not against the rules. -Chris1 PhotoTags: None
-
Thank you, check this out and let me know if it is any more help. It is currently set 34, EMA on my charts.Originally posted by s.kinra View PostHello,
I guess its using upper band to trail sl for short trades & lower band for long trades. This actually is simple to plot, you can use 2 plots & achieve it.
input baseMA = {default sma, ema, wma, vwma, swma, dema, hullema, tema};
input length = 20;
input mult = 1; #hint mult: 0.001 to 50
input colorFill = yes;
def vClose = close;
def bn = BarNumber();
def nan = double.NaN;
def ema1 = MovingAverage(AverageType.EXPONENTIAL, vClose, length);
def ema2 = MovingAverage(AverageType.EXPONENTIAL, ema1, length);
def ema3 = MovingAverage(AverageType.EXPONENTIAL, ema2, length);
def tema = 3 * (ema1 - ema2) + ema3;
def wma = MovingAverage(AverageType.WEIGHTED, vClose, length);
def basis;
switch (baseMA)
{
case sma: basis = MovingAverage(AverageType.SIMPLE, vClose, length);
case ema: basis = MovingAverage(AverageType.EXPONENTIAL, vClose, length);
case wma: basis = MovingAverage(AverageType.WEIGHTED, vClose, length);
case vwma: basis = MovingAverage(AverageType.EXPONENTIAL, vClose, length);
case swma: basis = wma[3]/6 + 2*wma[2]/6 + 2*wma[1]/6 + wma;
case dema: basis = ema2;
case hullema: basis = MovingAverage(AverageType.HULL, vClose, length);
case tema: basis = tema;
}
def dev = mult * stdev(vClose, length);
def upper = basis + dev;
def lower = basis - dev;
def up = if bn == 1
then nan
else if Crosses(vClose, upper, CrossingDirection.ABOVE)
then 1
else if Crosses(vClose, lower, CrossingDirection.BELOW)
then 0
else up[1];
def dn = if bn == 1
then nan
else if Crosses(vClose, lower, CrossingDirection.BELOW)
then 1
else if Crosses(vClose, upper, CrossingDirection.ABOVE)
then 0
else dn[1];
def changeUp = dn[1] and up;
def changeDn = up[1] and dn;
def stopLine = if up then lower else if dn then upper else nan;
plot p1 = stopLine;
p1.SetLineWeight(2);
p1.AssignValueColor(if stopLine == upper then Color.Magenta else Color.Cyan);
#plot pChangeDn = if changeDn then lower else nan;
#plot pChangeUp = if changeUp then upper else nan;
#pChangeDn.SetPaintingStrategy(PaintingStrategy.BO OLEAN_ARROW_DOWN);
#pChangeUp.SetPaintingStrategy(PaintingStrategy.BO OLEAN_ARROW_UP);
#pChangeDn.SetDefaultColor(Color.Red);
#pChangeUp.SetDefaultColor(Color.Green);
Comment
-
Hello Chris,
You can work around a new indicator for this & use the intended logic, actually its easy, if stuck anywhere will surely help. Use new indicator wizard to get started. SWMA is not available by default all others are included in NT8 so you can simply invoke them.Last edited by s.kinra; 10-22-2020, 01:48 AM.
- Likes 1
Comment
-
Hello technicallydreaming,
Thanks for your post and welcome to the NinjaTrader forums!
If you would like to create this yourself, we can provide links to get you started in a general way with Ninjascript which is based on C# programming language.
If you would like this created for you, we can provide a link to 3rd party programmers in the NinjaTrader Ecosystem.
- Likes 1
Comment
-
Thanks Paul, I compared the " BB Stops" side by side with the Ninja indicator "TS Supertrend" and I can't really say what I had was any better. In fact in some cases, it even provides earlier signals...so I am going to stick with the Supertrend!Originally posted by NinjaTrader_PaulH View PostHello technicallydreaming,
Thanks for your post and welcome to the NinjaTrader forums!
If you would like to create this yourself, we can provide links to get you started in a general way with Ninjascript which is based on C# programming language.
If you would like this created for you, we can provide a link to 3rd party programmers in the NinjaTrader Ecosystem.
- Likes 1
Comment
-
- Likes 1
Comment
-
That is so cool! Thank you so much. Will be testing both Supertrend and this one properly in Ninjatrader in the next few days. I have done my best to replicate my entire chart from ToS in ninja and I think I have gotten close if not exactly a match (minus the volume average becuase I am using Tick charts now). I have attached a screenshot for comparison. The Madrid ribbon is very quick way to identify the trend strength for me. Loving Ninjatrader so much. Like a fighter jet compared to every other software I have used.Originally posted by s.kinra View PostHello technicallydreaming,
Here you get [ATTACH]n1124174[/ATTACH] , just in case you still need it.
Comment
-
-
No problems! Volume is not very important for my trading, don't need it at least at the moment. I am really excited to get started with Ninja... I was just showing off my new chart hahaOriginally posted by s.kinra View PostOK, so what exactly is your doubt now? I can add Volume to tick chart as well & so the Volume MA. Let me know where are you getting stuck.
- Likes 1
Comment
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
607 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
353 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
560 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
561 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment