• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.
    JimNinjaTrader Customer Service

    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.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rickyblah12, Today, 08:17 PM
        0 responses
        4 views
        0 likes
        Last Post rickyblah12  
        Started by mrlucky1x, Today, 08:07 PM
        0 responses
        2 views
        0 likes
        Last Post mrlucky1x  
        Started by uday12, Today, 07:21 PM
        0 responses
        3 views
        0 likes
        Last Post uday12
        by uday12
         
        Started by voltlon, Today, 05:18 PM
        0 responses
        6 views
        0 likes
        Last Post voltlon
        by voltlon
         
        Started by Bobisam, Today, 04:57 PM
        0 responses
        8 views
        0 likes
        Last Post Bobisam
        by Bobisam
         
        Working...
        X