NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 05-04-2008, 01:36 PM   #1
Razor_Trader
Junior Member
 
Join Date: Nov 2007
Posts: 22
Thanks: 0
Thanked 0 times in 0 posts
Default RSI Dot

Can anyone help me with the code that would plot a dot overlayed on price bars when the RSI crossed above or below a certain level?

For example if the RSI(20) crosses above 40 then print a dot above the price bar. Also if the RSI(20) crosses below 30 then print a dot below the price bar.

Thanks for any help.

Razor
Razor_Trader is offline  
Reply With Quote
Old 05-04-2008, 04:02 PM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Code:
if (CrossAbove(RSI(20),  40, 1))
{
     DrawDot("Dot", true, 0, Close[0], Color.Red);
}
NinjaTrader_Josh is offline  
Reply With Quote
Old 05-04-2008, 09:50 PM   #3
Razor_Trader
Junior Member
 
Join Date: Nov 2007
Posts: 22
Thanks: 0
Thanked 0 times in 0 posts
Default

Josh,

I get the error "No overload for method 'RSI' takes '1' arguments".

What can do?

Thanks.

Razor
Razor_Trader is offline  
Reply With Quote
Old 05-05-2008, 12:01 AM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

if (CrossAbove(RSI(20, 3), 40, 1))
{
DrawDot("Dot", true, 0, Close[0], Color.Red);
}
NinjaTrader_Josh is offline  
Reply With Quote
Old 05-05-2008, 08:33 AM   #5
Razor_Trader
Junior Member
 
Join Date: Nov 2007
Posts: 22
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks Josh. The error is gone.

What does the 3 mean?

Razor
Razor_Trader is offline  
Reply With Quote
Old 05-05-2008, 08:35 AM   #6
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Default

Smooth parameter for RSI indicator.
NinjaTrader_Ray is offline  
Reply With Quote
Old 05-05-2008, 07:28 PM   #7
Razor_Trader
Junior Member
 
Join Date: Nov 2007
Posts: 22
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks Ray.

Is there a way to make it so that all of the past signals remain on the screen?

As it is now, when a new signal appears the previous one goes away.
Razor_Trader is offline  
Reply With Quote
Old 05-05-2008, 07:58 PM   #8
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Default

DrawDot("Dot" + CurrentBar, true, 0, Close[0], Color.Red);
NinjaTrader_Ray is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 09:00 PM.