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 adeelshahzad, Today, 03:54 AM
        5 responses
        32 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by stafe, 04-15-2024, 08:34 PM
        7 responses
        32 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by merzo, 06-25-2023, 02:19 AM
        10 responses
        823 views
        1 like
        Last Post NinjaTrader_ChristopherJ  
        Started by frankthearm, Today, 09:08 AM
        5 responses
        20 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        43 views
        0 likes
        Last Post jeronymite  
        Working...
        X