NinjaTrader Support Forum  

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

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 06-08-2007, 01:05 PM   #1
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default Need help with a condition to check the angle of an MA

Question:

Quote:
Can someone please help me, in strategy:

How I can write if I want a certain MA to cross at a Certain "ANGLE"

say 30 degrees, not less

Thanks
Zee
Answer:

You have to use the Slope() method in addition checking for the cross.

Something like:

if (CrossAbove(SMA(10), SMA(20), 1) && Slope(SMA(10), CurrentBar - 1, CurrentBar) > angleValue)
// Do something

PS - There is a bug in the current Slope() method calculation, will be resolved for the next update.
NinjaTrader_Ray is offline  
Reply With Quote
Old 06-08-2007, 01:40 PM   #2
zkalian
Junior Member
 
Join Date: Jun 2007
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default Thanks Ray

Hi Ray:

Thanks for help, this could be a good thread.

I am using the strategy wizard, so where and how do I perform the task, you wrote, I am not a programer.

Please help

Thanks
zee
zkalian is offline  
Reply With Quote
Old 06-08-2007, 02:00 PM   #3
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Unfortunately accessing the Slope() method is not available in the Wizard at this time. It will be later in the fall.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Condition Builder OUFan Strategy Development 6 12-19-2007 02:05 PM
Referencing Previous Instance(s) Of Condition roxana Automated Trading 11 08-01-2007 05:13 PM
Slppe/Angle of indicator AO76 Indicator Development 6 07-09-2007 10:22 PM
How do I check for the instrument name? NinjaTrader_Ray General Programming 0 02-07-2007 01:24 AM
Check News cherokeeruby Miscellaneous Support 6 04-27-2005 02:00 AM


All times are GMT -6. The time now is 03:36 AM.