View Full Version : OnOrderStatus()
04-04-2007, 03:30 AM
NT 6 beta 10.
The help file mentions OnOrderStatus() and OnExecutionsUpdate() however there is no documention on what I assume are these Event handlers.
I'm assuming OnOrderStatus() is fired every time an Order Status Change occures. This would be very usefull for NinjaScript coderswho want to write some code in reposonse to Status changes realtime and the same thing for Executions.
As I understand Ninjascript after having read the help file and looked at the example script files, we are supposed to put all of our realtime code in the OnBarUpdate() event handler. This limits all realtime update code to only fire when a new tick comes in instead of when the actual event occured.
Do we have OnOrderStatus() available to use and how do we use it?
04-04-2007, 03:44 AM
Where in the Help Guide did you find references to this? I ask since it should be removed. At this time, we do not provide support for coding against any other method/even other than OnBarUpdate(). Although we agree this is useful, we are not in a position to expose and provide support at this level at this time.
04-04-2007, 07:00 AM
Shared Data Methods and Properties - Historical
2. If your strategy uses more than just the OnBarUpdate() method for processing real-time events such as OnOrderStatus(). Only the OnBarUpdate() method can be coded against for backtesting therefore, you could have different logic branches dependant on if the strategy is processing historical or real-time data.
I sure like what this implies :). I assume one of the objectives of Ninjascript is to jump past the limitations of Easylanguage. This would sure do it. Why not allow something like the following:
protected override void OnBarUpdate()
//Executes tick by tick or bar by bar.
// Same as Easylanguage.
protected override void OnOrderStatus()
//Executes every time an order status event occures.
// Easylanguage has nothing like this.
//Here we could perhaps update our global variables that we can
// access in OnBarUpdate. And/or perhaps manipulation orders.
I realize this would introduce more support issues but hey ;).
Also in Release Notes:
NinjaTrader Version 6 Beta 2 - November 28, 2006
Fixed: StrategyBase class now only calls OnExecutionUpdate() and OnOrderStatus() for orders and executions local to the strategy instance "
04-04-2007, 07:05 AM
Thanks for pointing it out.
Providing support at that level is an entirely different animal than providing support for the convenience layer known as NinjaScript. In time we will expose more functionality that will be within the supported and documented feature list.
04-04-2007, 07:52 AM
FWIW, I would like to see Ninjascriptbe a relatively thin abstraction layerabove theInteractive Brokers API and Patsystems API. I realize where to put this abstraction is a basic architecture design decision. As a minimum I would like the major events these api's generate be exposed.
With Ninjascript you are already introducing the concept of Object Oriented Programming (at least to Easylanguage programmers) so why not also introduce the concept of Event Programming which is a fundamental concept all the modern OOP development environments use - Delphi, VB, C#.
For example, I would like to be able to write code to respond to a Lost Connection Event and Connection Reestablished Event.
04-04-2007, 05:58 PM
Our primary targeted audience for NinjaScript is people who are used to e.g. TradeStation EasyLanguage.
At a later point in time we may decide to expose the low level functionality of NinjaTrader you are looking for, but - as Ray said - this for the most part is a matter of support bandwidth.
Thanks for your understanding.