Why neither IDE, nor the NT documentation mentions this VERY useful state (it's sometimes only available way for doing things, which cant be done with `Terminated` state)?
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Why Documentation, and neither NT ide mentioned the "State" -"Finalized" ?
Collapse
X
-
Why Documentation, and neither NT ide mentioned the "State" -"Finalized" ?
I have accidentally cought the `State` value of "Finalized" (State==State.Finalize). I thought only these were available:
Why neither IDE, nor the NT documentation mentions this VERY useful state (it's sometimes only available way for doing things, which cant be done with `Terminated` state)?1 PhotoLast edited by ttodua; 02-27-2019, 03:16 AM.Tags: None
-
Hello TazoTodua,
Thanks for your post.
This state is not documented because it is not intended for regular use. Everything that you may wish to do in NinjaScript can be accomplished with an understanding of the NinjaScript Lifecycle and the documented states.
NinjaScript LifeCycle - https://ninjatrader.com/support/help...fecycle_of.htm
OnStateChange (Documented states) - https://ninjatrader.com/support/help...tatechange.htm
Could you provide an example where you have to use State.Finalized where you cannot use State.Terminated?
I look forward to being of further assistance.JimNinjaTrader Customer Service
Comment
-
NinjaTrader_Jim Yes, there are cases when FINALIZED makes the essential job, while others cant!
1) please see my another topic: https://ninjatrader.com/support/foru...dispose-mehtod
2) bind attaching i.e. mouse-click event to chart from EXTERNAL script (which has indicator's `this` instance passed to it), and then after removing the indicator from chart, that mouse-click event stays still on chart. Only state.Finalized is solution. Here example:
Code:class MyClass { Indicator indi ; public MyClass(Indicator instance) { indi = instance; indi.ChartPanel.MouseDown += this.OnMouseDownEvent; } private void OnMouseDownEvent(object sender, MouseButtonEventArgs e) { if (indi.State != State.Finalized) ... do desired action else (indi.State != State.Finalized) indi.ChartPanel.MouseDown -= this.OnMouseDownEvent; } } MyIndicator: OnStateChange->DataLoaded { new MyClass(this); }
3) and a surprise: a set of NT builting script also use this state (screenshot of TextCralwer, i like that app : https://i.imgur.com/pmi2oey.pngLast edited by ttodua; 02-27-2019, 10:05 AM.
Comment
-
-
Hello TazoTodua,
Thanks for providing the example.
NinjaTrader_Jesse had submitted a feature request in the thread where you were previously inquiring on State.Finalized to have this state documented. The ticket ID is SFT-3855.
Hooking up your indicator to an external script to attach handlers would not be a supported use of the software that we would recommend. Instead, we would advise to add the handlers in the script itself and then to unsubscribe and dispose of resources when the script reaches State.Terminated. As with other undocumented/unsupported code, you are welcome to use it if you find an application, but we will not be able to provide any further direction for usage.
Let us know if you have any additional questions.JimNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by algospoke, 04-17-2024, 06:40 PM
|
6 responses
49 views
0 likes
|
Last Post
by algospoke
Today, 06:18 PM
|
||
Started by arvidvanstaey, Today, 02:19 PM
|
4 responses
11 views
0 likes
|
Last Post Today, 04:08 PM | ||
Started by samish18, 04-17-2024, 08:57 AM
|
16 responses
61 views
0 likes
|
Last Post
by samish18
Today, 03:30 PM
|
||
Started by jordanq2, Today, 03:10 PM
|
2 responses
11 views
0 likes
|
Last Post
by jordanq2
Today, 03:23 PM
|
||
Started by traderqz, Today, 12:06 AM
|
10 responses
21 views
0 likes
|
Last Post
by traderqz
Today, 02:49 PM
|
Comment