From Tradestation via the DLL I place an order with a strategy for two contracts which has two targets.
As a test I then use the following Easylanguage code and get the Ninja log output at the bottom of this message;
T1 = 998.5;
T2 = 999.5;
BestStop = 991.25;
once value1= NTCommand("CHANGE", NTAccount, "SELL", FullSize, "STOP", 1, BestStop , "DAY", "", "STOP1", "", MyStrategyID);
once value1= NTCommand("CHANGE", NTAccount, "SELL", FullSize, "STOP", 1, BestStop , "DAY", "", "STOP2", "", MyStrategyID);
once value1= NTCommand("CHANGE", NTAccount, "BUY", 1, "LIMIT", T1, 0 , "DAY", "", "TARGET1", "", MyStrategyID);
once value1= NTCommand("CHANGE", NTAccount, "BUY", 1, "LIMIT", T2, 0 , "DAY", "", "TARGET2", "", MyStrategyID);
STOP1 moves to the correct price and Target1 also moves to its correct price however Target2 is cancelled as is STOP2, the relevant section of the Ninja log is below;
Date Category Message
04/08/2009 10:35 Order Order='faa4f7e4d7d94786856c650093a45d00/Impulse' Name='Target1' New State=Cancelled Instrument='ES 09-09' Action=Sell Limit price=996.25 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='cddf1bf9891147b79a7dedebe91d5309/Impulse' Name='Stop1' New State=Cancelled Instrument='ES 09-09' Action=Sell Limit price=986.25 Stop price=991.25 Quantity=1 Type=StopLimit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='3f7b206692714aaf9b5983a8aee9aebc/Impulse' Name='Target1' New State=Working Instrument='ES 09-09' Action=Sell Limit price=998.5 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='3f7b206692714aaf9b5983a8aee9aebc/Impulse' Name='Target1' New State=Accepted Instrument='ES 09-09' Action=Sell Limit price=998.5 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='4e07ca6914f449699520ec9b2b4459ad/Impulse' Name='Stop2' New State=Cancelled Instrument='ES 09-09' Action=Sell Limit price=988 Stop price=993 Quantity=1 Type=StopLimit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='967847423d5443a19fc35c7ac17e02bc/Impulse' Name='Target2' New State=Cancelled Instrument='ES 09-09' Action=Sell Limit price=1000.25 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='cddf1bf9891147b79a7dedebe91d5309/Impulse' Name='Stop1' New State=PendingCancel Instrument='ES 09-09' Action=Sell Limit price=986.25 Stop price=991.25 Quantity=1 Type=StopLimit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='faa4f7e4d7d94786856c650093a45d00/Impulse' Name='Target1' New State=PendingCancel Instrument='ES 09-09' Action=Sell Limit price=996.25 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='faa4f7e4d7d94786856c650093a45d00/Impulse' Name='Target1' New State=Working Instrument='ES 09-09' Action=Sell Limit price=996.25 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='faa4f7e4d7d94786856c650093a45d00/Impulse' Name='Target1' New State=Accepted Instrument='ES 09-09' Action=Sell Limit price=996.25 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='cddf1bf9891147b79a7dedebe91d5309/Impulse' Name='Stop1' New State=Accepted Instrument='ES 09-09' Action=Sell Limit price=986.25 Stop price=991.25 Quantity=1 Type=StopLimit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='cb79829c1028430a9d1a2969657db55c/Impulse' Name='Stop1' New State=Accepted Instrument='ES 09-09' Action=Sell Limit price=986.25 Stop price=991.25 Quantity=1 Type=StopLimit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 ATI AT
04/08/2009 10:35 Order Order='3f7b206692714aaf9b5983a8aee9aebc/Impulse' Name='Target1' New State=PendingChange Instrument='ES 09-09' Action=Sell Limit price=998.5 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 ATI AT
04/08/2009 10:35 ATI AT
04/08/2009 10:35 Order Order='faa4f7e4d7d94786856c650093a45d00/Impulse' Name='Target1' New State=PendingSubmit Instrument='ES 09-09' Action=Sell Limit price=996.25 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='cddf1bf9891147b79a7dedebe91d5309/Impulse' Name='Stop1' New State=PendingSubmit Instrument='ES 09-09' Action=Sell Limit price=986.25 Stop price=991.25 Quantity=1 Type=StopLimit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='967847423d5443a19fc35c7ac17e02bc/Impulse' Name='Target2' New State=PendingCancel Instrument='ES 09-09' Action=Sell Limit price=1000.25 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='4e07ca6914f449699520ec9b2b4459ad/Impulse' Name='Stop2' New State=PendingCancel Instrument='ES 09-09' Action=Sell Limit price=988 Stop price=993 Quantity=1 Type=StopLimit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='cb79829c1028430a9d1a2969657db55c/Impulse' Name='Stop1' New State=PendingChange Instrument='ES 09-09' Action=Sell Limit price=986.25 Stop price=991.25 Quantity=1 Type=StopLimit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 ATI AT
04/08/2009 10:35 Order Order='967847423d5443a19fc35c7ac17e02bc/Impulse' Name='Target2' New State=Working Instrument='ES 09-09' Action=Sell Limit price=1000.25 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='967847423d5443a19fc35c7ac17e02bc/Impulse' Name='Target2' New State=Accepted Instrument='ES 09-09' Action=Sell Limit price=1000.25 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='4e07ca6914f449699520ec9b2b4459ad/Impulse' Name='Stop2' New State=Accepted Instrument='ES 09-09' Action=Sell Limit price=988 Stop price=993 Quantity=1 Type=StopLimit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='3f7b206692714aaf9b5983a8aee9aebc/Impulse' Name='Target1' New State=Working Instrument='ES 09-09' Action=Sell Limit price=996.25 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='3f7b206692714aaf9b5983a8aee9aebc/Impulse' Name='Target1' New State=Accepted Instrument='ES 09-09' Action=Sell Limit price=996.25 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='cb79829c1028430a9d1a2969657db55c/Impulse' Name='Stop1' New State=Accepted Instrument='ES 09-09' Action=Sell Limit price=988 Stop price=993 Quantity=1 Type=StopLimit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='967847423d5443a19fc35c7ac17e02bc/Impulse' Name='Target2' New State=PendingSubmit Instrument='ES 09-09' Action=Sell Limit price=1000.25 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='4e07ca6914f449699520ec9b2b4459ad/Impulse' Name='Stop2' New State=PendingSubmit Instrument='ES 09-09' Action=Sell Limit price=988 Stop price=993 Quantity=1 Type=StopLimit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='3f7b206692714aaf9b5983a8aee9aebc/Impulse' Name='Target1' New State=PendingSubmit Instrument='ES 09-09' Action=Sell Limit price=996.25 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Order Order='cb79829c1028430a9d1a2969657db55c/Impulse' Name='Stop1' New State=PendingSubmit Instrument='ES 09-09' Action=Sell Limit price=988 Stop price=993 Quantity=1 Type=StopLimit Filled=0 Fill price=0 Error=NoError Native error=''
04/08/2009 10:35 Position Instrument='ES 09-09' Account='Impulse' Avg price=994 Quantity=2 Market position=Long Operation=Update Currency=Unknown
04/08/2009 10:35 Execution Execution='89d8c2538ae244af9137603fee07b054' Instrument='ES 09-09' Account='Impulse' Exchange=Default Price=994 Quantity=1 Market position=Long Operation=Insert Order='843ee9d72a3140c9a27cb93e73afd507' Time='04/08/2009 10:35:48'
04/08/2009 10:35 Order Order='843ee9d72a3140c9a27cb93e73afd507/Impulse' Name='Entry' New State=Filled Instrument='ES 09-09' Action=Buy Limit price=0 Stop price=0 Quantity=2 Type=Market Filled=2 Fill price=994 Error=NoError Native error=''
04/08/2009 10:35 Position Instrument='ES 09-09' Account='Impulse' Avg price=994 Quantity=1 Market position=Long Operation=Insert Currency=Unknown
04/08/2009 10:35 Execution Execution='d072cd34748141fead2c0fe5a55c2b3b' Instrument='ES 09-09' Account='Impulse' Exchange=Default Price=994 Quantity=1 Market position=Long Operation=Insert Order='843ee9d72a3140c9a27cb93e73afd507' Time='04/08/2009 10:35:48'
04/08/2009 10:35 Order Order='843ee9d72a3140c9a27cb93e73afd507/Impulse' Name='Entry' New State=PartFilled Instrument='ES 09-09' Action=Buy Limit price=0 Stop price=0 Quantity=2 Type=Market Filled=1 Fill price=994 Error=NoError Native error=''
04/08/2009 10:35 Order Order='843ee9d72a3140c9a27cb93e73afd507/Impulse' Name='Entry' New State=Working Instrument='ES 09-09' Action=Buy Limit price=0 Stop price=0 Quantity=2 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
Please advise,
Thanks
Kevin.
Comment