I'm primarily interested in testing my code for handling Order Rejected events due to such things and Market Closed errors from Interactive Brokers.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Test Harness for generating error events?
Collapse
X
-
Test Harness for generating error events?
Is there a way I can generate error events to test my error handling code?
I'm primarily interested in testing my code for handling Order Rejected events due to such things and Market Closed errors from Interactive Brokers.Tags: None
-
Thank you for responding, but how to debug is not the question I asked.
I wish to exercise my code for handling errors before letting in run autonomously on a live market, to do this I need a way of generating ninjatrader error events. What is the recommended method of doing this type of testing?
Originally posted by NinjaTrader_Joydeep View Post
Comment
-
Originally posted by itsnotme View PostThank you for responding, but how to debug is not the question I asked.
I wish to exercise my code for handling errors before letting in run autonomously on a live market, to do this I need a way of generating ninjatrader error events. What is the recommended method of doing this type of testing?
The other method would be to use a Try/Catch block and generate your own exception. Heck, you could even just use a code block/function to throw your own exceptions at will if you want.Last edited by koganam; 06-05-2012, 07:26 PM.
Comment
-
Hello itsnotme,
As koganam said you have to submit some invalid orders (like buy stop at below current market close etc).
You can use the OnOrderUpdate event to capture the order state.
Code:protected override void OnOrderUpdate(IOrder order) { if (order.OrderState == OrderState.Rejected) { //do something } }
Please let me know if I can assist you any further.JoydeepNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by warreng86, 11-10-2020, 02:04 PM
|
7 responses
1,360 views
0 likes
|
Last Post Today, 09:41 PM | ||
Started by Perr0Grande, Today, 08:16 PM
|
0 responses
5 views
0 likes
|
Last Post
by Perr0Grande
Today, 08:16 PM
|
||
Started by elderan, Today, 08:03 PM
|
0 responses
9 views
0 likes
|
Last Post
by elderan
Today, 08:03 PM
|
||
Started by algospoke, Today, 06:40 PM
|
0 responses
10 views
0 likes
|
Last Post
by algospoke
Today, 06:40 PM
|
||
Started by maybeimnotrader, Today, 05:46 PM
|
0 responses
14 views
0 likes
|
Last Post Today, 05:46 PM |
Comment