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!
See more
See less

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 DJ888, 04-16-2024, 06:09 PM
        4 responses
        12 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by terofs, Today, 04:18 PM
        0 responses
        7 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by nandhumca, Today, 03:41 PM
        0 responses
        6 views
        0 likes
        Last Post nandhumca  
        Started by The_Sec, Today, 03:37 PM
        0 responses
        3 views
        0 likes
        Last Post The_Sec
        by The_Sec
         
        Started by GwFutures1988, Today, 02:48 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Working...
        X