NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > Application Technical Support > Miscellaneous Support > Historical Version 7 Beta Threads > Version 7 Beta General Questions & Bug Reports

Version 7 Beta General Questions & Bug Reports Ask questions here and post bug reports.

 
 
Thread Tools Display Modes
Old 10-02-2010, 04:26 PM   #1
thepcmd
Member
 
Join Date: Nov 2006
Location: , ,
Posts: 46
Thanks: 3
Thanked 0 times in 0 posts
Default ATM Targets

In NT7 I am currently using AtmStrategyChangeStopTarget(0, (stopPricevariable), "STOP1", atmStrategyId); to change the Stops for the ATM the script is running. Is there a command to change the Targets?

Thanks
thepcmd is offline  
Old 10-02-2010, 08:05 PM   #2
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
Default

thepcmd, the method you are using can change both stops and targets (hence the name AtmStrategyChangeStopTarget()), so you just have to specify the name of the target ("TARGET1") to change it instead of the stop.
NinjaTrader_Austin is offline  
Old 10-03-2010, 02:08 PM   #3
thepcmd
Member
 
Join Date: Nov 2006
Location: , ,
Posts: 46
Thanks: 3
Thanked 0 times in 0 posts
Default Target do not move - Stops do

I tested the code as follows:

if (atmStrategyId.Length > 0
&& GetAtmStrategyMarketPosition(atmStrategyId) == MarketPosition.Short)
{
AtmStrategyChangeStopTarget(0, (target1), "TARGET1", atmStrategyId);
AtmStrategyChangeStopTarget(0, (target2), "TARGET2", atmStrategyId);
AtmStrategyChangeStopTarget(0, (stopPrice), "STOP1", atmStrategyId);
AtmStrategyChangeStopTarget(0, (stopPrice), "STOP2", atmStrategyId);
}

The Stops move as expected but the Targets remain at the preset value of the ATM.

Any suggestions?

Thanks
thepcmd is offline  
Old 10-03-2010, 09:56 PM   #4
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
Default

Hello there, I will have someone get back to you tomorrow.
NinjaTrader_Austin is offline  
Old 10-04-2010, 07:50 AM   #5
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

thepcmd, can you please print the new stop and target prices you set from the scripts - would they provide new & different values for the targets at all?

Thanks
NinjaTrader_Bertrand is offline  
Old 10-04-2010, 03:11 PM   #6
thepcmd
Member
 
Join Date: Nov 2006
Location: , ,
Posts: 46
Thanks: 3
Thanked 0 times in 0 posts
Default Print to output window

I tested the code as follows:

if (atmStrategyId.Length > 0
&& GetAtmStrategyMarketPosition(atmStrategyId) == MarketPosition.Short)
{
AtmStrategyChangeStopTarget(0, (target1), "TARGET1", atmStrategyId);
AtmStrategyChangeStopTarget(0, (target2), "TARGET2", atmStrategyId);
Print("The current ATM Target 1 position is: " + target1);
Print("The current ATM Target 2 position is: " + target2);
AtmStrategyChangeStopTarget(0, (stopPrice), "STOP1", atmStrategyId);
AtmStrategyChangeStopTarget(0, (stopPrice), "STOP2", atmStrategyId);
}

Once the order fires here is the output
The current ATM Target 1 position is: 8
The current ATM Target 2 position is: 25

The ATM is set to 8 and 16 and the targets remained at 8 and 16
thepcmd is offline  
Old 10-04-2010, 03:30 PM   #7
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

thepcmd,

When you are changing the target you should be changing the limit price, not the stop price of the target order. Right now you are changing the stop price.
NinjaTrader_Josh is offline  
Old 10-04-2010, 06:49 PM   #8
thepcmd
Member
 
Join Date: Nov 2006
Location: , ,
Posts: 46
Thanks: 3
Thanked 0 times in 0 posts
Default Thanks

Thank you for the help solving my issue. Once you pointed out that I should have been using a limit order, I was able to solve my programming problem

Thanks again
thepcmd is offline  
 

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
Can you specify a value/percentage for targets in ATM strategies? wjhamilton ATM Strategies (Discretionary Trading) 11 10-10-2011 07:53 PM
Adding Targets to ATM Strategy trumpy SuperDOM and other Order Entry Windows 1 06-25-2010 03:21 PM
ATM Profits Targets and Stops by ticks saj816 ATM Strategies (Discretionary Trading) 1 02-06-2010 09:52 PM
ATM Strategy - Targets collapsed into one Edward Kunafi SuperDOM and other Order Entry Windows 1 10-21-2009 11:53 AM
More than 3 ATM Targets (have 4 or 5) akwonline Historical NinjaTrader 6.5 Beta Threads 1 03-28-2008 11:09 PM


All times are GMT -6. The time now is 07:02 AM.