![]() |
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
|
|||||||
| Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Feb 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
|
Since the ATM strategy on the DOM may have arbitrary targets and stops,
how do I access what ever are the current values? While the order is in play string [,] orders = GetAtmStrategyStopTargetOrderStatus("TARGET1", atmStrategyId); just returns zeroes for fill and quantity and a status of "working" When the order goes flat, GetAtmStrategyStopTargetOrderStatus() gets an error. so I am unable to find out the fill. What am I missing about the architecture design here? Same questions for stops. Thanks in advance. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
Hi Roland, what you see here would be unfortunately expected - the current values could not be checked, only their state, fill price and qty. You can provide your own values though through the AtmStrategyChangestopTarget() method and then keeping track of values you used.
If your strategy has only one target and you would nullify the atmStrategyId on the fill, you cannot check later the fill price, as the strategy reference would not exist anymore.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Feb 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
|
Bertrand:
Thanks for answering.. OK I can deal with not knowing current value.(although it would be nice in the future, particularly when the ATM DOM custom stops are complex) However, as I explained, I cannot seem to get ultimate fill price on target or stop after ATM strategy goes flat. I just get an error message when it try to access GetAtmStrategyStopTargetOrderStatus(). What am I doing incorrectly? |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
You nullify / reset the atmStrategyId then likely too early, as then when you try to access it's already in reset state and you cannot access the needed values anymore. Before doing that I would suggest to store a reference to those, then you could do the needed reset in your code.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Feb 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
|
Bertrand:
Here is the code snippet which first tests for Flat and the tries to get the fill price: : else if (atmStrategyIdn[lim].Length > 0 && GetAtmStrategyMarketPosition(atmStrategyIdn[lim]) == Cbi.MarketPosition.Flat) { Print(CurrentBar + " upOrdS Closing ATM ID # " + lim.ToString() + " tnum " + posAtmIdXRef[lim] + " entry fiiled at " + posAvgFillPrice[lim] + " approx exit at " + Close[0]); string[,] orders = GetAtmStrategyStopTargetOrderStatus("TARGET1", atmStrategyIdn[lim]); if (orders.Length > 0) { for (int i = 0; i < orders.GetLength(0); i++) { if (dbg("ATM")) Print(CurrentBar + " upOrdS Target Status" + lim.ToString() + " targ fill price is " + orders[i, 0].ToString() + " Qty " + orders[i, 1].ToString() + " state is " + orders[i, 2].ToString()); } } atmStrategyIdn[lim] = string.Empty; As you can see, I am trying to acquire fill BEFORE I close the strategy ID Here is the output Window: 41420 upOrdS Closing ATM ID # 1 tnum 1 entry fiiled at 82.54 approx exit at 82.61 **NT** GetAtmStrategyStopTargetStatus() method error: AtmStrategyId 'f0ff19bfe86644a4ae6b7f34e77b66d7' does not exist or is already in terminated state |
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
Thanks Roland, I can reproduce this outcome here and will check into.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
Hi Roland, thanks for the patience here - I've looked into your report and what you see is unfortunately expected, to clarify our info: the reset is not the key, once the atm is in terminated state, so last target / stop is filled you could not access the fill info anymore.
I've logged this is limitation / enhancement request into our product management tracking system under id 1843 and surely added your vote in as well. Thanks and all the best for you,
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Feb 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
|
Bertrand:
Thanks for getting to the bottom of this. Hope the fix happens soon as the help file instructions are quite clear that this should work. Roland |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hard Stop, But is "Replaced" by a Trailing Stop once a Target is hit | outstretchedarm | Strategy Development | 19 | 11-24-2011 09:38 AM |
| stop loss & profit target orders get activated only after buy stop order is execute | clearpicks | Automated Trading | 1 | 07-21-2010 06:18 AM |
| Chnage stop of target 2 based on the fill of target 1 | difdiffer | ATM Strategies (Discretionary Trading) | 3 | 08-27-2009 09:23 AM |
| Close ATM strategy in priority to stop loss generated by AtmStrategyCreate | boulbi | Strategy Development | 3 | 07-04-2009 01:34 PM |
| Add ATM Target & No Stop (Manual Stop) | coryrh | ATM Strategies (Discretionary Trading) | 2 | 06-11-2009 04:03 PM |