Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to prevent custom bar type from running

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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?

    #2
    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.

    Comment


      #3
      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


        #4
        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.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        558 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        324 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        545 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X