![]() |
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
|
|||||||
| 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. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Apr 2011
Posts: 31
Thanks: 0
Thanked 0 times in 0 posts
|
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! |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
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.
Brett
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Apr 2011
Posts: 31
Thanks: 0
Thanked 0 times in 0 posts
|
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"... |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
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.
Brett
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Apr 2011
Posts: 31
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
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.
Brett
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Member
Join Date: Apr 2011
Posts: 31
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#8 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
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.
Brett
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
Member
Join Date: Apr 2011
Posts: 31
Thanks: 0
Thanked 0 times in 0 posts
|
I run it yesterday, so this data are indeed past data.
|
|
|
|
|
|
#10 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
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
Brett
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |