![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Sep 2009
Posts: 27
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 90 times in 82 posts
|
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();
Austin
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Sep 2009
Posts: 27
Thanks: 0
Thanked 0 times in 0 posts
|
Thank you very much! That is exactly what I wanted.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |