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

ShartStyle changed event.

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

    ShartStyle changed event.

    Hello.

    Can
    the indicator be notified about ChartStyle changing?
    Something like OnChartStyleChanged event, may be?
    OnStateChange() of indicator not triggered at all while ChartStyle changed.

    Thank You.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Hello fx.practic,

    There isn't anything documented for this.

    But you might be able to apply a property changed event for the custom chart style event.

    Here is a link to a post you may find helpful.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank You.
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment


        #4
        After reviewing thread You pointed I found one only related snippet:
        PHP Code:
        foreach(ChartScale cs in cp.Scales)
        {
              
        cs.ChartObjects.CollectionChanged += myCollectionChanged;                        


        Does NT have same event related for ChartStyle changing, say BarColors.Chanded, or ChartScale.Changed?
        Last edited by fx.practic; 07-03-2019, 04:47 AM.
        fx.practic
        NinjaTrader Ecosystem Vendor - fx.practic

        Comment


          #5
          Hello fx.practic,

          Hmm, this doesn't seem to be the actual script I was thinking it was.

          I wasn't even able to find the script from Matthew with the PropertyChangedEventHandler on the forums..

          I was able to find the script on our internal shared server and I'm happy to share it.

          The undocumented (unsupported) relevant code is:
          Code:
          public class SamplePropertyChangedDrawingTool : Line, INotifyPropertyChanged
          
          
          // this event will be subscribed from the indicator and updated anytime those properties call DoPropertyChanged
          public event PropertyChangedEventHandler PropertyChanged;
          
          // send the property name to the event so you can detect which property changed
          protected void DoPropertyChanged(string propertyName)
          {
              PropertyChangedEvent(new PropertyChangedEventArgs(propertyName));
          }
          
          // propagate drawing tools PropertyChanged to the indicator
          protected void PropertyChangedEvent(PropertyChangedEventArgs e)
          {
              if (PropertyChanged != null)
                  PropertyChanged(this, e);
          }
          Attached Files
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Thank You, Chelsea.
            Not sure it will help. but examples are useful.
            fx.practic
            NinjaTrader Ecosystem Vendor - fx.practic

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            1 view
            0 likes
            Last Post Javierw.ok  
            Started by timmbbo, Today, 08:59 AM
            2 responses
            10 views
            0 likes
            Last Post bltdavid  
            Started by alifarahani, Today, 09:40 AM
            6 responses
            40 views
            0 likes
            Last Post alifarahani  
            Started by Waxavi, Today, 02:10 AM
            1 response
            18 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by Kaledus, Today, 01:29 PM
            5 responses
            15 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X