View Full Version : January 08 S&C article "Profit Locking And The Relative Price Channel"
NinjaTrader_Ray
01-23-2008, 01:25 PM
Attached is the "Bear Range Trailing Stop" indicator as discussed in the January 08 S&C article authored by Leaon Wilson titled "Profit Locking And The Relative Price Channel".
This indicator is for NinjaTrader Version 6.5 or greater.
To install:
1. Download the file to your desktop
2. Start NinjaTrader
3. Select the menu File > Utilities > Import NinjaScript
4. Select the downloaded file saved to your Desktop
jonesenberg
02-03-2008, 10:41 AM
This particular .zip is giving me an error when importing. Anyone else having issues? I'm quite interested in the idea behind this one.
NinjaTrader_Josh
02-03-2008, 10:43 AM
Are you using NinjaTrader 6.5?
jonesenberg
02-03-2008, 10:46 AM
Apparently not?! Working on that now and will report...
jonesenberg
02-03-2008, 11:06 AM
Upgrading to 6.5 surely did the trick, but interestingly, LinRegSlope no longer plots.
NinjaTrader_Josh
02-03-2008, 11:31 AM
That is because of the syntax change to the Slope() function in NT6.5. Go bring up your indicator and remove the CurrentBar references.
If it use to be "...CurrentBar - Period, CurrentBar)" change it to just "...Period, 0)"
jonesenberg
02-03-2008, 11:40 AM
The applicable lines read:
{
LRSlope.Set(Slope(LinReg(Period), CurrentBar - Period + 4, CurrentBar));
}
So...:
{
LRSlope.Set(Slope(LinReg(Period), Period + 4, 0));
}
? And thank you for the help, Josh.
NinjaTrader_Josh
02-03-2008, 01:42 PM
Right. Btw. Where did you get LinRegSlope? I have it on my comp too, but forgot what I made it for haha.
jonesenberg
02-03-2008, 02:56 PM
Right. Btw. Where did you get LinRegSlope? I have it on my comp too, but forgot what I made it for haha.
Awesome, works like a charm. It comes from the Dec '07 S&C release, paired with the rSquared indicator.
Thanks again. I'm sure I'll be back for more.
bkout
02-06-2009, 04:45 PM
Per the below message I made the change in the code for the LinRegSlope indicator and saved it and closed the window -- see attached image. However the indicator does not display on the chart. I can choose it but the panel is blank. Did I leave out something I need to do? I'm not familiar with code btw.
The applicable lines read:
{
LRSlope.Set(Slope(LinReg(Period), CurrentBar - Period + 4, CurrentBar));
}
So...:
{
LRSlope.Set(Slope(LinReg(Period), Period + 4, 0));
}
? And thank you for the help, Josh.
NinjaTrader_Ben
02-07-2009, 10:52 AM
Hello,
Try adding if(CurrentBar < Period + 4) return; right after OnBarUpdate().
You can't access a bar that does not exist yet.
This link will help explain:
http://www.ninjatrader-support2.com/vb/showthread.php?t=3170
traderz
02-23-2009, 03:09 PM
I still can't get the indicator to plot..what am I doing wrong? Also is there a way to plot angle value of the Linear regression Line? Thanks!!
{
if(CurrentBar < Period + 4) return;
LRSlope.Set(Slope(LinReg(Period), Period + 4, 0));
}
NinjaTrader_Ray
02-23-2009, 04:49 PM
Are there any error messages in the Log tab of the Control Center window when you apply this indicator to a chart?
There are no ways to access an angle value for lin reg.
bkout
02-23-2009, 06:49 PM
The Slope for the Linear Regression posted by anachronist here:
http://www.ninjatrader-support2.com/vb/local_links.php?catid=1&sort=N&pp=15&page=7
( LinRegSlopeSFX - Linear regression slope super fast calc with option for exponential weighting )
matches the Slope indicator in the orignal S&C article (I plotted historical charts and they matched the ones in the article). IMO his formula should replace the one in Ninja
NinjaTrader_Bertrand
02-24-2009, 05:22 AM
Thanks for the link and input bkout!
rt6176
02-24-2009, 10:35 AM
NT,
I get this display on both Range and Tick charts For the indicator below in post #1.
" Attached is the "Bear Range Trailing Stop" indicator".
Is this the correct display? It doesn't look like the one below???
RJay
NinjaTrader_Bertrand
02-24-2009, 11:15 AM
If I'm not mistaken it was designed for long positions on daily charts...