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 04-03-2011, 05:15 PM   #1
AlgoNaute
Member
 
Join Date: Apr 2011
Posts: 31
Thanks: 0
Thanked 0 times in 0 posts
Default Unmanaged Sell Limit orders not appearing in Orders window

Hello everyone,

I am currently programming an automated strategy using unmanaged ordrs to be able to place Sell and Buy limit ordres in the same time.

My problem is that the initial sell limit order never appears on the "orders" window of NinjaTrader, despite the fact that the logs indicates me no errors and after that, the limit price of the trade is logged, trade status is "working" and I can sucessfully update the limite price.

Ths problem does not appear on the buy limit, and no problems too if I open manually a sell limit.

I am using Ninja 7.4, with a Zenfire feed from a Mirrus demo account.
Issue is appearing on live execution with simulated datafeed or zenfire one.

Backtests are fine and sell limit order appears on the report with no problems.

This issues begins to drive me crazy so I would be very grateful if someone would have a clue on what happens.

Many thaks!
AlgoNaute is offline  
Reply With Quote
Old 04-03-2011, 07:01 PM   #2
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

Thanks for that information.

When you run the strategy live is it going to a green state in the control center strategies tab indicating it is active.

Also, If you add TraceOrders = True in the Initialize Method you will be able to trace the orders to see what is happening.

http://www.ninjatrader-support.com/H...aceOrders.html


Please let me know the trace output from here if there is any.

I look forward to assisting you further.
NinjaTrader_Brett is offline  
Reply With Quote
Old 04-04-2011, 05:36 AM   #3
AlgoNaute
Member
 
Join Date: Apr 2011
Posts: 31
Thanks: 0
Thanked 0 times in 0 posts
Default

Thank you for your help.

Yes the strategy goes green and I activated the trace. The trace reports the order creation wihtout any errors. I will be able to send the logs only later.
The state of the ghost trade printed in logs is "working"...
AlgoNaute is offline  
Reply With Quote
Old 04-04-2011, 06:26 AM   #4
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

THanks for that, and we are sure this is a live order not a historical order correct?

I look forward to assisting you further.
NinjaTrader_Brett is offline  
Reply With Quote
Old 04-04-2011, 06:32 AM   #5
AlgoNaute
Member
 
Join Date: Apr 2011
Posts: 31
Thanks: 0
Thanked 0 times in 0 posts
Default

Actually you maybe touch a interesting point here.
I launch the strategy via the Strategy window. Whre can we be sure it is executing on live data and not historical one.
I am not using Strategy Analyser here (and it is working on the analyseer by the way).

Thanks
AlgoNaute is offline  
Reply With Quote
Old 04-04-2011, 07:29 AM   #6
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

It is seemless from historical to live. The strategy actually would not know the difference. You would just need to check the order times in the output window. If the order time is less then the start time of the strategy -> Historical. Vice Versa.

Let me know if I can be of further assistance.
NinjaTrader_Brett is offline  
Reply With Quote
Old 04-04-2011, 04:31 PM   #7
AlgoNaute
Member
 
Join Date: Apr 2011
Posts: 31
Thanks: 0
Thanked 0 times in 0 posts
Default

Here are some traces at the sell and buy limit order opening :

Code:
Place init orders
01/04/2011 13:20:07 Entered internal SubmitOrder() method at 01/04/2011 13:20:07: Action=Sell OrderType=Limit Quantity=1 LimitPrice=1.4259 StopPrice=0 OcoId='' Name='Strat1ShortLimitI'
Working
01/04/2011 13:20:07 Entered internal SubmitOrder() method at 01/04/2011 13:20:07: Action=Buy OrderType=Limit Quantity=1 LimitPrice=1.3979 StopPrice=0 OcoId='' Name='Strat1LongLimitI'
Opening Long Limit order: 1.3979
Opening Short Limit order: 1.4259
The working status and limit prace are taken through the trade object, indicating that the trade is successfully entered.
AlgoNaute is offline  
Reply With Quote
Old 04-05-2011, 06:27 AM   #8
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

RIght but what was the starting time of the strategy. It should time stamp the time at the top of the output window when you enable the strategy.
NinjaTrader_Brett is offline  
Reply With Quote
Old 04-05-2011, 06:43 AM   #9
AlgoNaute
Member
 
Join Date: Apr 2011
Posts: 31
Thanks: 0
Thanked 0 times in 0 posts
Default

I run it yesterday, so this data are indeed past data.
AlgoNaute is offline  
Reply With Quote
Old 04-05-2011, 06:53 AM   #10
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

Ok if you run it again today can you please post the start times and order times of the strategy it is here we will be able to identify they are historical orders.

Which we most likely will. At that point you simply need to wait for a live order to be submitted. Also you will want to make sure you read up on this document.

Strategy Position vs. Account Position:
http://www.ninjatrader-support2.com/...ead.php?t=4033
1st solution:
You can include the following statement in your code to avoid the strategy to be calculated on historical data.
// Only run on real-time data
if (Historical)
return;
Add the statement to the top of OnBarUpdate()
2nd solution:
You can set 'On starting a real-time strategy' to 'Wait until flat before executing live'.
This option can be found at Tools-->Options-->Strategies-->NinjaScript-tab.
3rd solution, would be submitting manual orders to sync the strategy and account positions described in the link
4th solution, would be to enable Sync account position to true.
http://www.ninjatrader.com/support/h..._positions.htm
NinjaTrader_Brett 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
Rejected Order - Sell stop limit orders can't be placed.... TradingDreamer General Programming 4 12-09-2009 06:59 AM
Entering Buy/Sell Limit orders before Market opens scjohn SuperDOM and other Order Entry Windows 1 01-22-2009 08:56 AM
Turn off prompt to confirm 'buy/sell stop limit' orders.. newbouldm Miscellaneous Support 2 01-16-2008 03:52 PM
Limit orders - book position kept when new orders are generated Fabrice Automated Trading 6 10-13-2007 03:16 PM
Placing resting limit BUY & SELL orders on the DOM Nelson1980 Miscellaneous Support 2 06-02-2006 12:06 AM


All times are GMT -6. The time now is 07:36 AM.