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.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 07-03-2009, 01:28 PM   #1
boulbi
Junior Member
 
Join Date: Jun 2009
Posts: 2
Thanks: 0
Thanked 0 times in 0 posts
Default Close ATM strategy in priority to stop loss generated by AtmStrategyCreate

Quote:
// Condition set 1
if (orderId.Length == 0 && atmStrategyId.Length == 0 && CrossAbove(Close[1]etc.))
{
atmStrategyId = GetAtmStrategyUniqueId();
orderId = GetAtmStrategyUniqueId();
AtmStrategyCreate(Action.Buy, OrderType.Limit, 0, 0, TimeInForce.Day, orderId, "MY-ATM", atmStrategyId);
}
So i have a stop on my Dom with that code.

But if i want to put another priority condition > to my stop loss generated on the Dom to close my strategy, do i have to put :

Quote:
// Condition set 2
if (Close[1] < MyIndicator(...))
{
AtmStrategyClose("idValue");
Is that right, or i need to add another code ?

thanks
boulbi 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
Going from a Stop Loss to a Trailing Stop within a strategy Sidhartha Strategy Development 28 03-24-2009 03:11 PM
Strategy stop loss junkone Strategy Development 6 12-11-2008 10:32 AM
Atm strategy/ stop priority nico_p Strategy Development 5 04-18-2008 12:56 AM
Sample ATM strategy resets on position close tecmisc1 Strategy Development 1 04-10-2008 09:08 AM
ATM strat with stop loss and target order Angel ATM Strategies (Discretionary Trading) 5 11-08-2007 09:44 AM


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