NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


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

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 05-07-2011, 03:08 PM   #1
TrendTracker
Member
 
Join Date: Apr 2008
Posts: 44
Thanks: 0
Thanked 0 times in 0 posts
Default CrossAbove Problem

I am trying to modify the Stochastics to plot a dot whenever %K crosses above a value of 80 or below a value of 20. I keep getting errors with my syntax and I can't figure out why. The code below:

if (CrossAbove(Stochastics(7,14,3).K[0],80,1)) DrawDot("Dwn Dot", false, 0, Stochastics(7,14,3).K[0], Color.Maroon);

gives me errors of:

"The best overloaded method match for 'NinjaTrader.Indicator.IndicatorBase.CrossAbove(do uble,NinjaTrader.Data.IDataSeries,int)' has some invalid arguments"
and
"Argument '2': cannot convert from 'int' to 'NinjaTrader.Data.IDataSeries'"


I've also tried the following and got the same results.

double value20=Stochastics(7,14,3).K[0];
if (CrossAbove(value20,80,1)) DrawDot("Dwn Dot", false, 0, value20, Color.Maroon);


Can anyone kindly help me out here?

Thanks in advance.
TrendTracker is offline  
Reply With Quote
 

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
CrossAbove/Below methods - help please... Art09 Miscellaneous Support 5 10-20-2010 11:58 AM
CrossAbove() "CJS" Strategy Development 6 09-28-2010 10:41 AM
CrossAbove / CrossBelow Shansen Indicator Development 7 07-04-2009 01:19 PM
CrossAbove GreenTrade Strategy Development 1 02-26-2009 06:56 AM
What does CrossAbove/Below do? tradefaz General Programming 1 08-23-2008 12:56 PM


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