![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Oct 2011
Posts: 70
Thanks: 2
Thanked 1 time in 1 post
|
I am experimenting with a simple strategy that when SMMA (Smoothed Moving Average) for current bar is grater than the SMMA for the previous bar - go long.
My profit target is 10 points on ES. The challenge is once I hit the profit target, the ATM strategy immediately places another long trade if SMMA is on rise and is increasing. I do now want this to happen. I'd like to place only one trade every time the condition is fulfilled. Ideally the next trade will be a short one when SMMA stars going down and then long again. Is there a way to code this in NT so that only one trade is placed in one direction? Many Thanks. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,570
Thanks: 262
Thanked 1,018 times in 999 posts
|
You could either do this with user variables / boolean flags as showcased in this example -
http://www.ninjatrader.com/support/f...ad.php?t=15417 or you would express your entry rule with a cross over condition so it would not evaluate to 'true' on a only rising SMMA value. http://www.ninjatrader.com/support/h...crossabove.htm
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Executing a trade at a specific time | ExactlyMyPoint | Strategy Development | 3 | 02-11-2011 01:55 PM |
| Prevent strategy from executing trade at the same price level within a session | suprsnipes | Strategy Development | 1 | 03-01-2010 03:08 AM |
| How can I set the app so that a single 100-contract trade is listed as 1 trade? | Kovacs | Miscellaneous Support | 1 | 12-08-2008 05:12 PM |
| Enetering Multiple Orders with Single Condition | daven | Automated Trading | 1 | 09-26-2008 04:03 PM |
| Long trade, executing shorts | Dunthrin | Automated Trading | 15 | 07-11-2007 09:49 AM |