![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Member
Join Date: Jul 2008
Posts: 57
Thanks: 0
Thanked 0 times in 0 posts
|
In backtesting a new strategy, I had the following error message in the log file “A SellShort stop order placed at '2/12/2010 1:00:00 AM' has been ignored since the stop price is greater than or equal to close price of the current bar. This is an invalid order and subsequent orders may also be ignored. Please fix your strategy.”
If this strategy was running live instead of being backtested, does NT block this order from going over the brokerage (MBT in my case) and give this error message or would the order go to the brokerage and come back with an order status of rejected? |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Hello TraderVick,
NinjaTrader will detect that this is an invalid order and it will not be sent to the broker.
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Jul 2008
Posts: 57
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks for the reply. Another question. I am testing this new strategy in NT7, where I can set up a mail alert. Is this error log message an alert type?
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Creating mail alerts can be done in the strategy wizard. As one of your potential actions, you choose Misc > Send mail.
http://www.ninjatrader-support.com/H...SendMail1.html The message you received isn't part of an alert. You would have to work with Iorder objects and check that the state of your order has been rejected. This is assuming you want to create an email alert based on its status. If this isn't your intention let us know. http://www.ninjatrader-support.com/H...V6/IOrder.html
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Jul 2008
Posts: 57
Thanks: 0
Thanked 0 times in 0 posts
|
From what I can tell, NT detected that the order was invalid and the OnOrderUpdate logic wasn't executed. OnOrderUpdate is where I check for the order state being rejected. Should I check for this state in the OnExecution section?
|
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
That's true, and no, OnExecution() will not receive the event either. You will have to check that the price is valid prior to submitting your order.
For Longs: Code:
if (stopOrderPrice >= GetCurrentBid())
{
//Submit order
}
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Member
Join Date: Jul 2008
Posts: 57
Thanks: 0
Thanked 0 times in 0 posts
|
Got it. Thanks for help!
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Scary Error Message In Live Trading - Help | Gorlitsky.dan | ATM Strategies (Discretionary Trading) | 1 | 08-13-2009 11:05 AM |
| ATM error message in Live but not Sim | vail55 | ATM Strategies (Discretionary Trading) | 1 | 08-04-2009 08:28 AM |
| Is this a broker generated error message? | BT_Techsupport | SuperDOM and other Order Entry Windows | 1 | 05-12-2009 02:27 AM |
| Error Message when executing order | Edgar V. | SuperDOM and other Order Entry Windows | 4 | 03-25-2008 02:47 PM |
| error message after placing live order | mreis | Miscellaneous Support | 7 | 01-18-2006 05:08 PM |