PDA

View Full Version : ATI records redundant multiple orders


2aspirin
04-23-2009, 02:08 PM
I am a C# newbie, so I have just started testing the ATI interface. I am using TS 8.5 with the logic taken from the supplied NT strategy sample code.
My TS 8.5 strategy (calculated every bar on close) generates one order, but the the ATI registers one order for every NT bar until I turn it off. What am I doing wrong?
BTW, I am getting the TS 8.5 reentrancy error message on every bar when the strategy generates an order.
Also, is it true that I can transmit an ATM strategy instead of separate market order and OCO bracket?
It would surely simplify things. Thanks.

NinjaTrader_Josh
04-23-2009, 02:15 PM
Which ATI interface are you using? You do not necessarily transmit an ATM strategy. What you can do is kind of attach it to your entry orders that you make.

2aspirin
04-23-2009, 02:31 PM
I am using the DLL interface, imported the ELD that came with NT. For example

If LastBarOnChart and NTConnected(1) and NTMarketPosition("SIM101") <= 0 then
NTSuccess = NTBuyMarket("", 1);

I have since replaced LastBarOnChart to a test that checks for real time ticks.

My most urgent problem is to stop the redundant orders.
What might be causing this?

Then, if this is possible, I will create and name an ATM strategy and will use the PLACE command to send it by name to the ATI.

I will try to simplify my ELS code and migrate it to NT, but as with anything new it's slow at the beginning.

Thanks.

NinjaTrader_Josh
04-23-2009, 02:52 PM
2aspirin,

Your code will keep resubmitting when your conditions are true. As long as that market order was not filled yet you will keep resubmitting. I am not a TS expert so cannot advise you on EasyLanguage, but you can try using a bool flag variable. When it is false, place the trade, once the trade has been submitted set the bool to true so the same condition will not be evaluated to true again. Then finally after your trade is complete, reset your bool to false to allow for future trading again.