View Full Version : ATI issue when strategy enabled
ThePatientOne
05-21-2007, 09:14 AM
When I enable my TradeStation strategy on a given market, I am getting an oddball order placement in another market even though no other market is loaded or strategy applied.
The attached graphic explains what is happening. In a nutshell, I have a 55t @ES chart with a strategy that I've updated to use the NT DLL interface. I have all of the necessary code in place to make sure that no trades get placed before the last bar of the chart *and* until all of the trade logic is setup correctly. Once all is in place, the limit order(s) are placed accordingly. However, I am getting a weird order generated to buy the ER2 market as well at the same @ES limit price.
Again, please see the attached graphic.
I believe this to be an NT bug.
I am running the latest 6.1000.2 build.
NinjaTrader_Ray
05-21-2007, 10:42 AM
Please check a few things -
- In NT Instrument Manager, is the external symbol mapping for the ER2 instrument configured for ES?
- Your EL function call for placing orders, are there any references to ER2 anywhere along the link of function calls?
ThePatientOne
05-21-2007, 11:11 AM
In NT Instrument Manager, is the external symbol mapping for the ER2 instrument configured for ES?
No. I verified this twice. All are set correct.
Your EL function call for placing orders, are there any references to ER2 anywhere along the link of function calls?
I hadn't checked this but I have now and nothing at all referencing any hard coded symbol names.
What I find interesting is that this order got placed without the NTCommand function printing any statements referencing the ER2 market at all. I had updated the NTCommand function to print out EVERY command sent to it and that is what you see in the TradeStation Output window. There are only ES commands placed. Therefore, I believe this order came from the NinjaTrader ATI itself.
NinjaTrader_Ray
05-21-2007, 11:53 AM
You can look at the log tab where this order was placed, it should show you a log showing that it came from a call to our ATI. If not, let me know.
ThePatientOne
05-21-2007, 12:03 PM
Yes, the order is coming from the ATI according to the log. However, looking at the attached log snapshot, there appears to be some "early" orders being placed before the actual ATI order. It appears different than the order placed by the correct order on the @ES market.
See snapshot.
Thanks again.
NinjaTrader_Ray
05-21-2007, 12:07 PM
This looks fine to me. What it does show is that the ER2 order was placed external from NT. Somewhere an order was placed for the ER2.
ThePatientOne
05-21-2007, 12:11 PM
This looks fine to me. What it does show is that the ER2 order was placed external from NT. Somewhere an order was placed for the ER2.
I disabled the SMTP server in NT. I will see if that has anything to do with this the next time I load the strategy.
Thanks for all of the help Ray.
ThePatientOne
05-21-2007, 01:12 PM
OK. Now I KNOW it is not me here. In the last 5 minutes, I've disabled and enabled a strategy on an ER2 chart and had NQ, ES and ER2 orders placed on the different strategy startups. I don't even have an NQ chart loaded.
I AM checking for LastBarOnChart. In each of the occurrences of an incorrect market showing up, the limit price on the order is the price of the ER2 market. I am using the standard, NinjaTrader supplied TradeStation functions for all of my calls. I have verified that the symbol mapping is correct in NinjaTrader.
I don't know what else to try next. Do you guys have some other ideas on how to troubleshoot this? It seems to me that the correct symbol is not being passed back from TS to NT. I am using continuous contracts in TS and I have them mapped to automatic nearest contracts in NT (not directly tied to a particular contract). I have tried it both ways with same results.
NinjaTrader_Ray
05-21-2007, 01:59 PM
I recall someone had posted (possibly in this forum) that there are situations where TS does not submit the correct information based on how the many strings.
What you can do is in your strategy, override the functions and include a parameter where you have to pass in the actual instrument name. So for ES, you could pass in "ES 06-07".
ThePatientOne
05-21-2007, 02:05 PM
[QUOTE=ThePatientOne;10146]OK. Now I KNOW it is not me here. In the last 5 minutes, I've disabled and enabled a strategy on an ER2 chart and had NQ, ES and ER2 orders placed on the different strategy startups. I don't even have an NQ chart loaded.QUOTE]
Here is a snapshot of what I am talking about. Getting frustrating not knowing what is going on. Could it be a bug in TradeStation not getting the correct symbol name at this point? It seems as if NT is simply cycling through the list of instruments in my instrument list.
NinjaTrader_Ray
05-21-2007, 02:07 PM
I meant to say how TS handles string management. As per my last post, hard code the instrument name in all order functions.
ThePatientOne
05-22-2007, 07:58 AM
I got this resolved.
1) Changing the NT functions to require passing the symbol name did not make it work correctly yet.
2) I had to create my own timing function to prevent any orders from being generated until TradeStation was "ready". There appears to be an unstable period during TradeStation's strategy "history" processing that caused extra orders and incomplete variable initialization.
All is well now.
Thanks again for your help.