PDA

View Full Version : CLOSESTRATEGY COMMAND doesn´t work


Torso
08-14-2007, 07:54 AM
I traded today a strategy with *.txt files (send from eSignal to NT), the position was opened, but not closed.

The CLOSESTRATEGY COMMAND doesn´t closed the position about the one open FDAX-Future, only the target and the stop orders where canceled.

Here you can see the logfile(I changed only account number). Why was the position not closed?

Torso


14/08/2007 15:35:59 Order Order='776029134/Uxxxx' Name='Stop1' New State=Cancelled Instrument='FDAX 09-07' Action=Sell Limit price=0 Stop price=7496.5 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error='Order Storniert - Grund: (202)'
14/08/2007 15:35:59 Order Order='776029135/Uxxxx' Name='Target1' New State=Cancelled Instrument='FDAX 09-07' Action=Sell Limit price=7519 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='Order Storniert - Grund: (202)'
14/08/2007 15:35:58 Order Order='776029135/Uxxxx' Name='Target1' New State=PendingCancel Instrument='FDAX 09-07' Action=Sell Limit price=7519 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 15:35:58 Order Order='776029134/Uxxxx' Name='Stop1' New State=PendingCancel Instrument='FDAX 09-07' Action=Sell Limit price=0 Stop price=7496.5 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 15:35:58 Strategy Cancelling any remaining strategy orders
14/08/2007 15:35:58 ATI AT 'CLOSESTRATEGY;;;;;;;;;;;;DAX_1min_Target.7.5_Stop .15' processing
14/08/2007 15:32:05 Order Order='776029135/Uxxxx' Name='Target1' New State=Working Instrument='FDAX 09-07' Action=Sell Limit price=7519 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 15:32:05 Order Order='776029135/Uxxxx' Name='Target1' New State=Accepted Instrument='FDAX 09-07' Action=Sell Limit price=7519 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 15:32:05 Order Order='776029134/Uxxxx' Name='Stop1' New State=Working Instrument='FDAX 09-07' Action=Sell Limit price=0 Stop price=7496.5 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 15:32:05 Order Order='776029134/Uxxxx' Name='Stop1' New State=Accepted Instrument='FDAX 09-07' Action=Sell Limit price=0 Stop price=7496.5 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 15:32:04 Position Instrument='FDAX 09-07' Account='Uxxxx' Avg price=7511.5544 Quantity=1 Market position=Long Operation=Insert Currency=Euro
14/08/2007 15:32:03 Order Order='9df708400e124fc3b88e310293a23ab0/Uxxxx' Name='Target1' New State=PendingSubmit Instrument='FDAX 09-07' Action=Sell Limit price=7519 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 15:32:03 Order Order='303fabc33a8d465d8b17a4b4e48fea28/Uxxxx' Name='Stop1' New State=PendingSubmit Instrument='FDAX 09-07' Action=Sell Limit price=0 Stop price=7496.5 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 15:32:03 Execution Execution='FDAX 09-07/0000e7d2.4519c8ad.01.01' Instrument='FDAX 09-07' Account='Uxxxx' Exchange=Eurex Price=7511.5 Quantity=1 Market position=Long Operation=Insert Order='776029133' Time='14/08/2007 15:32:03'
14/08/2007 15:32:03 Order Order='776029133/Uxxxx' Name='Entry' New State=Filled Instrument='FDAX 09-07' Action=Buy Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=1 Fill price=7511.5 Error=NoError Native error=''
14/08/2007 15:32:03 Order Order='776029133/Uxxxx' Name='Entry' New State=Working Instrument='FDAX 09-07' Action=Buy Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 15:32:02 Order Order='776029133/Uxxxx' Name='Entry' New State=Accepted Instrument='FDAX 09-07' Action=Buy Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 15:32:02 Order Order='11ac3d73a5364c6ebc91b17500842c25/Uxxxx' Name='Entry' New State=PendingSubmit Instrument='FDAX 09-07' Action=Buy Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 15:32:02 Order Submitting order with strategy
14/08/2007 15:32:02 ATI AT 'PLACE;Uxxxx;FDAX 09-07;BUY;1;MARKET;0;0;DAY;;DAX_1min_Target.7.5_Stop. 15;NT_DAX_1min_Target.7.5_Stop.15;DAX_1min_Target. 7.5_Stop.15' processing

NinjaTrader_Ray
08-14-2007, 08:15 AM
At quick glance, it looks like both your stop and limit orders were filled before the order could be cancelled. This can happen if your stop/target are very close to each other and the market moves quickly and fills both orders before the cancellation requests can be confirmed.

Torso
08-14-2007, 08:43 AM
dont´t think so, that both orders (limit/stop) were filled. I checked the trades and it was only one trade (entry FDAX long, 15:32:02).

The limit order was 7496.0 and the stop order was 7519. It is not close to each other ( I traded the FDAX, and this is a difference from 26ticks). The market was not near the target order (highest high during the strategy time was 7513.5).

The matter is, why is the position not closed at the IB account?

The position was after sending the CLOSESTRATEGY further open (I checked the trades, no others sell/buy), although the market was under the (old) stop-order (but the stop order was canceled from NT).

Torso

NinjaTrader_Ray
08-14-2007, 09:32 AM
Sorry, I misread the log information.

I can see the problem but can't see how this could happen, I tried to reproduce on my development PC's and it worked as expected.

- Is this the only time this has happened or can you reproduce it?
- Can you test it on the Sim101 account, does it work or not?

Torso
08-14-2007, 09:59 AM
Hi Ray,

I tryed it again, it works proper (and also in the past the system works during the last 3 weeks proper). Here the log-file from now, I tested it 5min ago.

Additionally I checked the chart during the time between entry up to the closestrategy-file (not the trade now, the failing trade), also the ticks from eSignal to understand the mistake. I think, that the price from FDAX was near or the same like the stop order, than the CLOSESTRATEGY file was generated from the eSignal chart and sended to NT.

Is it possible, that the stop order and the CLOSESTRATEGY order clashed?


See attached the last test, it works fine ( I tested twice, the first one is atteched)

Torso


14/08/2007 17:41:19 Execution Execution='FDAX 09-07/0000e9b5.446a2955.01.01' Instrument='FDAX 09-07' Account='Uxxxxx' Exchange=Eurex Price=7473.5 Quantity=1 Market position=Short Operation=Insert Order='1038173143' Time='14/08/2007 17:41:19'
14/08/2007 17:41:19 Order Order='1038173143/Uxxxxx' Name='Target1' New State=Filled Instrument='FDAX 09-07' Action=Sell Limit price=7466 Stop price=0 Quantity=1 Type=Limit Filled=1 Fill price=7473.5 Error=NoError Native error=''
14/08/2007 17:41:19 Position Instrument='FDAX 09-07' Account='Uxxxxx' Avg price=0 Quantity=0 Market position=Long Operation=Remove Currency=Euro
14/08/2007 17:41:19 Order Order='1038173142/Uxxxxx' Name='Stop1' New State=Cancelled Instrument='FDAX 09-07' Action=Sell Limit price=0 Stop price=7457 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error='Order Storniert - Grund: (202)'
14/08/2007 17:41:18 Order Order='1038173143/Uxxxxx' Name='Target1' New State=PendingChange Instrument='FDAX 09-07' Action=Sell Limit price=7466 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 17:41:18 Strategy Closing position strategy
14/08/2007 17:41:18 ATI AT 'CLOSESTRATEGY;;;;;;;;;;;;DAX_1min_Target.7.5_Stop . 15' processing
14/08/2007 17:39:46 Order Order='1038173143/Uxxxxx' Name='Target1' New State=Working Instrument='FDAX 09-07' Action=Sell Limit price=7479.5 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 17:39:46 Order Order='1038173143/Uxxxxx' Name='Target1' New State=Accepted Instrument='FDAX 09-07' Action=Sell Limit price=7479.5 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 17:39:46 Order Order='1038173142/Uxxxxx' Name='Stop1' New State=Accepted Instrument='FDAX 09-07' Action=Sell Limit price=0 Stop price=7457 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 17:39:46 Position Instrument='FDAX 09-07' Account='Uxxxxx' Avg price=7472.08 Quantity=1 Market position=Long Operation=Insert Currency=Euro
14/08/2007 17:39:46 Order Order='f249de8f80e148949da02d7976f41784/Uxxxxx' Name='Target1' New State=PendingSubmit Instrument='FDAX 09-07' Action=Sell Limit price=7479.5 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 17:39:46 Order Order='539b22cedbbd4947acea3dee34125dde/Uxxxxx' Name='Stop1' New State=PendingSubmit Instrument='FDAX 09-07' Action=Sell Limit price=0 Stop price=7457 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 17:39:45 Execution Execution='FDAX 09-07/0000e9b5.446a2926.01.01' Instrument='FDAX 09-07' Account='Uxxxxx' Exchange=Eurex Price=7472 Quantity=1 Market position=Long Operation=Insert Order='1038173141' Time='14/08/2007 17:39:45'
14/08/2007 17:39:45 Order Order='1038173141/Uxxxxx' Name='Entry' New State=Filled Instrument='FDAX 09-07' Action=Buy Limit price=7472 Stop price=0 Quantity=1 Type=Limit Filled=1 Fill price=7472 Error=NoError Native error=''
14/08/2007 17:39:33 Order Order='1038173141/Uxxxxx' Name='Entry' New State=Working Instrument='FDAX 09-07' Action=Buy Limit price=7472 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 17:39:33 Order Order='1038173141/Uxxxxx' Name='Entry' New State=Accepted Instrument='FDAX 09-07' Action=Buy Limit price=7472 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 17:39:32 Order Order='486621590edf4a4cbe2c22badf96a320/Uxxxxx' Name='Entry' New State=PendingSubmit Instrument='FDAX 09-07' Action=Buy Limit price=7472 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
14/08/2007 17:39:32 Order Submitting order with strategy
14/08/2007 17:39:32 ATI AT 'PLACE;Uxxxxx;FDAX 09-07;BUY;1;LIMIT;7472.0;0;DAY;;DAX_1min_Target.7.5_S top. 15;NT_DAX_1min_Target.7.5_Stop.15;DAX_1min_Target. 7.5_Stop. 15' processing

NinjaTrader_Ray
08-14-2007, 10:01 AM
The problem was that the internal strategy position size was zero. I know this from some of the text in the log file. The problem is that I can't see how the strategy position would be zero.

If you see this again, please report back.

Thanks for running the tests.

Torso
08-14-2007, 10:10 AM
How can I check it? Where in the logfile can I identify, that the strategy position size is zero?

Torso

NinjaTrader_Ray
08-14-2007, 10:49 AM
There is nothing specific other than a number of things that I personally can tell from the log file.

You could tell in NT itself, the "Strategies" tab, position column.