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 09-19-2009, 08:44 AM   #1
StarBright2009
Junior Member
 
Join Date: Sep 2009
Posts: 27
Thanks: 0
Thanked 0 times in 0 posts
Default Simple MA Cross Over Modification

I am new to Ninja Trader and Ninja Scripts. For the Simple Moving Average Cross Over Sample Strategy, I would like to go to cash instead of placing a short order when the Fast Moving Average crosses below the Slow Moving Average. How can this be accomplished?

Thanks.
StarBright2009 is offline  
Reply With Quote
Old 09-19-2009, 01:18 PM   #2
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 90 times in 82 posts
Default

Hi StarBright, by cash I'm assuming you mean flat. Instead of doing a EnterShort(), you can just have it ExitLong():
Code:
if (CrossBelow(SMA(Fast), SMA(Slow), 1))
    ExitLong();
NinjaTrader_Austin is offline  
Reply With Quote
Old 09-19-2009, 03:08 PM   #3
StarBright2009
Junior Member
 
Join Date: Sep 2009
Posts: 27
Thanks: 0
Thanked 0 times in 0 posts
Default

Thank you very much! That is exactly what I wanted.
StarBright2009 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
MA Cross - Color Change njnja Indicator Development 3 09-21-2009 11:54 PM
Group of stocks by MA Cross over on a particular day opensource Charting 1 01-31-2009 08:42 AM
Group of stocks by MA Cross over on a particular day opensource Automated Trading 2 01-31-2009 08:16 AM
Simple STO Cross problem gyoung General Programming 4 02-18-2008 11:19 AM
Problems with simple donchian cross test zoltran Strategy Development 2 04-02-2007 10:21 AM


All times are GMT -6. The time now is 06:20 PM.