![]() |
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
|
|||||||
| Version 7 Beta General Questions & Bug Reports Ask questions here and post bug reports. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Nov 2006
Location: , ,
Posts: 46
Thanks: 3
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
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.
Austin
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Nov 2006
Location: , ,
Posts: 46
Thanks: 3
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
Hello there, I will have someone get back to you tomorrow.
Austin
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
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
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
Member
Join Date: Nov 2006
Location: , ,
Posts: 46
Thanks: 3
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#7 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
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.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#8 |
|
Member
Join Date: Nov 2006
Location: , ,
Posts: 46
Thanks: 3
Thanked 0 times in 0 posts
|
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 |
|
|
|
| Thread Tools | |
| Display Modes | |
|
|
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 |