NinjaTrader Support Forum  
X

Attention!

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


Go Back   NinjaTrader Support Forum > Application Technical Support > Automated Trading

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.

Reply
 
Thread Tools Display Modes
Old 03-26-2009, 09:23 PM   #1
puppeye
Junior Member
 
Join Date: Dec 2008
Posts: 6
Thanks: 0
Thanked 0 times in 0 posts
Default Order Cancels itself automatically

Hi support,

I have an automated system coded (single instrument/timeframe). I am experiencing a technical problem in which my order cancels itself immediately after placing. This occurs randomly and therefore I am unable to reproduce the trace here now.

I have already set my liveuntilcanceled to true:

long_entry_order=EnterLongLimit(0,true,qty_1_first _target, entry_price, "long_signal");

SetStopLoss("long_signal", CalculationMode.Ticks, ticks_stoploss, false);


90% of the times it works perfectly but occassionally, it cancels my order immediately after it has been placed.

In order to rectify the problem, I have tried to resubmit the order when a cancelled order is detected:

protected override void OnOrderUpdate(IOrder order)
if(order.Name=="long_signal" && order.OrderState==OrderState.Cancelled )
{

long_entry_order=EnterLongLimit(0,true,qty_1_first _target, entry_price, "long_signal");

SetStopLoss("long_signal", CalculationMode.Ticks, ticks_stoploss, false);

}

The above doesnt work in live trading. The order wont re-submit. I tested the above in simulation mode by manually cancelling the order in superdom. It works fine under this situation, the order got resubmitted. However, it simply doesnt resubmit when the order was cancelled automatically and unexpectedly (as opposed to manual cancel in superdom).

I have searched the entire forum but couldnt find the solution. My major difficulty is that this error seems to be random, i dont know when it will happen.

I am living in GMT+8 timezone, my system trade for me while i am asleep so this error is critical to my trading.

Your help is much appreciated! Thank you.
Last edited by puppeye; 03-26-2009 at 11:41 PM.
puppeye is offline  
Reply With Quote
Old 03-27-2009, 02:35 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
Default

Hi puppeye, please test this again with TraceOrders = true in the Initialize of your strategy - http://www.ninjatrader-support.com/H...aceOrders.html

Then check the output for any insight why the orders get cancelled.
NinjaTrader_Bertrand is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Order Cancels Right Away heyligerb Strategy Analyzer 4 03-24-2009 10:41 AM
MACD Trigger Immediately? Loren1711 Strategy Development 8 02-25-2009 05:10 AM
Strategy Order Cancels heyligerb Automated Trading 2 02-11-2009 10:35 AM
NT cancels order for entry bobbethgoo SuperDOM and other Order Entry Windows 4 02-03-2009 12:54 PM
GetProfitLoss() cancels stop loss order??? wayneFH General Programming 6 03-29-2008 05:20 PM


All times are GMT -6. The time now is 12:50 AM.