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

why can ZOrder be the same on subsequently applied indicators?

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

    why can ZOrder be the same on subsequently applied indicators?

    We've got strange issue with ZOrder being the same on subsequently applied indicators. Indicator uses ZOrder as unique identifier for some processing.
    While on one computer (intel core2-duo win7 ultimate x64) this works Ok, but on another (core-i7 win7 pro x64) it first worked well too on clean NT7 install, but later after adding some other indicators it broke and now ZOrder is the same (equal to 10002).
    I wonder how that can happen and how to avoid it?
    What else could be used as a unique number/ID of running indicators?

    #2
    nickbilak,

    How are you assigning the Z-order? Is this programmatically?
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      I do not assign it. I just read it as this.ZOrder and use the value. On one computer each new indicator on chart has different ZOrder values and on another computer all values are the same.

      Comment


        #4
        Nick,

        I have not heard of that before. Is there anything else different between the two PC's like using different indicators, etc?

        I understand you are using this.ZOrder, how are you using it? I.e. are you trying to pass ZOrder's between indicators?

        Likely I would need a code sample to see what's going on. You can programmatically set the ZOrder :

        Code:
        protected override void Initialize()
        {
        
        ZOrder = 10;
        
        //other code here
        
        }
        Is this what you are doing or are you using the default ZOrder set by the chart?
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          Yes, the other computer has some more indicators. We are trying to locate which one messes this up.
          I use the default indicator's Zorder.

          protected override void OnBarUpdate()
          {
          Print(this.ZOrder.ToString()+" ZOrder OnBarUpdate");
          }

          this code prints the same ZOrder values in 3 applied indicators on the same chart.

          Comment


            #6
            Nick, first of all to clarify : working with ZOrder programmatically is not an officially supported concept - you would need to isolate which addition breaks it, I would start with a new chart / workspace and add your indicators one by one to see.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Well, I don't have much time now to investigate what breaks it. As a workaround, for my goals, I get the unique ID of indicator on a chart, as follows:
              Code:
                      private int myID = 0;
              
                      protected override void OnStartUp()
                      {
                          for (int i=0; i<ChartControl.Indicators.Length; i++) {
                              if (ChartControl.Indicators[i] == this) {
                                  myID=i;
                                  break;
                              }
                          }
                       }

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by r68cervera, Today, 05:29 AM
              0 responses
              3 views
              0 likes
              Last Post r68cervera  
              Started by geddyisodin, Today, 05:20 AM
              0 responses
              4 views
              0 likes
              Last Post geddyisodin  
              Started by JonesJoker, 04-22-2024, 12:23 PM
              6 responses
              35 views
              0 likes
              Last Post JonesJoker  
              Started by GussJ, 03-04-2020, 03:11 PM
              12 responses
              3,239 views
              0 likes
              Last Post Leafcutter  
              Started by AveryFlynn, Today, 04:57 AM
              0 responses
              6 views
              0 likes
              Last Post AveryFlynn  
              Working...
              X