How do you recommend gracefully exiting a bar type, and notifying the user with a popup or Draw.Text on the chart?
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
How to prevent custom bar type from running
Collapse
X
-
How to prevent custom bar type from running
I'm looking for the proper way to disable/hide/terminate a custom bar type from executing on a chart...and I want to notify the user that the bar type is unavailable.
How do you recommend gracefully exiting a bar type, and notifying the user with a popup or Draw.Text on the chart? -
Hello sbgtrading,
Thanks for your inquiry.
Testing with SetState(State.Terminated); did not disable the BarType, and I am not aware of a supported method to abort the BarType and alert the user.
One solution I could think of would be to create an AddOn for an NTWindow and then to open that window in OnDataPoint() instead of processing the data.
There are some examples on the forums that demonstrate creating an NTWindow and opening an NTWindow from an indicator. I would suggest to use the "SetIndicatorValueFromAddonWindowExample" package for opening an AddOn window from another NinjaScript.
AddOn Window samples - https://ninjatrader.com/support/foru...059#post477059
Documentation on an NTWindow can be referenced here: https://ninjatrader.com/support/help...s/ntwindow.htm
Please let me know if I may be of further assistance.JimNinjaTrader Customer Service
-
Thanks for your quick response...
Unfortunately, not much success.
I'm working on using a static class to share BarType error messages with associated indicators...so the indicators can notify the user when BarType errors have occurred.
Don't you think there needs to be a simple way for us to:
1) Invalidate a bar type
2) Notify the user, from a bar type, about status updates from the execution of that bar type
Comment
-
Hello sbgtrading,
I can understand if a vendor would want to invalidate or disable a bar after a certain period of time to ensure that the NinjaScript stops working after a certain period of time in addition to the license check that is placed in the NinjaScript's constructor.
The idea for a BarType is to customize the way data is presented on a chart. I would imagine that the BarType should always have a result visible to the user or it should not add a bar. Could you elaborate more on an instance where a BarsType should be invalidated and the user should be notified?
I'll be happy to submit a feature request for you with some further detail.JimNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by ScottWalsh, 04-16-2024, 04:29 PM
|
7 responses
34 views
0 likes
|
Last Post Today, 05:15 AM | ||
Started by cls71, Today, 04:45 AM
|
0 responses
5 views
0 likes
|
Last Post
by cls71
Today, 04:45 AM
|
||
Started by mjairg, 07-20-2023, 11:57 PM
|
3 responses
214 views
1 like
|
Last Post
by PaulMohn
Today, 04:22 AM
|
||
Started by TheWhiteDragon, 01-21-2019, 12:44 PM
|
4 responses
547 views
0 likes
|
Last Post
by PaulMohn
Today, 04:09 AM
|
||
Started by GLFX005, Today, 03:23 AM
|
0 responses
3 views
0 likes
|
Last Post
by GLFX005
Today, 03:23 AM
|
Comment