![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Feb 2006
Location: London U.K.
Posts: 152
Thanks: 3
Thanked 2 times in 2 posts
|
The following is a scrap of code from the OnExecution method.
// Resets the entryOrder object to null after the order has been filled or partially filled. if (execution.Order.OrderState != OrderState.PartFilled) { entryOrder = null; } The comment does not seem to match the conditional logic. In any event it seems to me that this conditional could never become true since it is contained within another conditional that has 'execution.Order.OrderState == OrderState.PartFilled' OR'd with other contitions. Am I missing something? |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
DaveS,
It works as intended as is. The overarching if-statement has many possible OrderStates. You want to reset the entryOrder to null on all OrderStates except the PartFilled one.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Feb 2006
Location: London U.K.
Posts: 152
Thanks: 3
Thanked 2 times in 2 posts
|
Yes, sorry, I misread the outer 'if' and that lead to a wrong expectation for the inner one - doh!
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| On Cancel and Fill logic in SampleOnOrderUpdate | binwang2 | Strategy Development | 1 | 02-12-2009 10:50 AM |
| SampleOnOrderUpdate | Mike Winfrey | Strategy Development | 2 | 12-29-2008 08:27 AM |