View Full Version : Strategy not submiting orders
04-09-2007, 02:45 AM
I am testing my strategy live today.
On the action block, I have the following lines to print an arrow and enter the trade.
if (shortstuff blah)
DrawArrowDown("My down arrow" + CurrentBar, 0, High + 2 * TickSize, Color.Orchid);
This worked in historical testing , other than the 1 bar lag. (will be nice to have that intrabar backtester !)
But today, in real time I'm seeing the arrow print, but no orders.
And there's only one spot in my code that will draw an arrow, so I know it's a valid entery.
If I stop/restart the strategy , both the arrows and signals are there.
The live account is with IB, non is sim mode, and I' verified I can place oders via a DOM I started.
Very confused !
Attached screenshot of YM
04-09-2007, 02:49 AM
This means the EnterShort() method is being entered but being ignored. You can enable TraceOrder = true in the Initialize() method which will trace info why this method is being ignored. This will help you in debug.
There is a known bug with Beta 10 where if TraceOrders is true and you have SetStop/Target called in Initialize() you will get an exception.
04-09-2007, 02:59 AM
I set my stops dynamically in OnBarUpdate as per http://ninjatrader.mywowbb.com/forum20/1521.html
I have turned on that trace and will let you know
04-09-2007, 03:36 AM
Ok, have trace
Attached in word doc in zip file
Pls let me know if want to look at the strategy and I'll pm it to you.
04-09-2007, 03:51 AM
Misunderstanding, I did not mean that I would debug. The TraceOrder property is there also for users to debug to understand why a strategy may not behave as you expect.
That being said, I took a look at your file. I suspect that when you run your strategy, you are already in a position? You can check on the Strategies tab in the Control Center window. You have a setting that says "WaitUntilFlat" before executing live. If your strategy is not flat at first run, NT will wait until its flat before executing.
Could this be the case?
04-09-2007, 04:02 AM
Didn't expect you to debug ! Just suggested looking at my code if you wanted to understand why
I;m just wanting to understand why it wasn't placed.
However the strategy IS flat...
04-09-2007, 04:10 AM
Can you try the following:
ES 10 second chart, 4 days lookback
Run your strategy live on Sim101 account
--> Confirm that orders do not execute
Same as above except under Tools > Options > Strategies, set "Immediately submit live..."
--> Do order execute or same behaviour as above
04-09-2007, 04:57 AM
Ok, will do.. but I will need to modify my strat so it will make trades on a 10sec chart...
On my existing charts, I added an Email and Alert
Curiously, they do not execute either.
DrawArrowUp("My up arrow" + CurrentBar, 0, Low + -2 * TickSize, Color.Yellow);
Alert("S2Long", NinjaTrader.Cbi.Priority.High, "Reached Breakout", "C:\\Data\\SOUNDS\\cowbell.wav", 10, Color.Lime, Color.Black);
SendMail("firstname.lastname@example.org", "S2@winners.com", "Trade Alert", "Buy ");
So the apearance is that nothing after the drawarrow is executed.
04-09-2007, 05:28 AM
Emails and alerts only trigger in real-time, they are ignored against historical data. I suspect that there may be some issue when you have WaitTilFlat set.
I will check here as well.
04-09-2007, 05:40 AM
Disregard further tests. I can confirm an issue related to the setting "Wait until flat...". Thanks for your patience and co-operation. Will have this resolved for the next update.