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

Changing paremeters of an IRay object

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

    Changing paremeters of an IRay object

    Hi,

    Is it possible to change the Tag and EndTime of a certain IRay object?

    If not, is it possible to get all properties of the IRay, and recreate another one with different Tag and EndTime, but rest of the properties the same?

    Thanks a lot for any help.

    #2
    Originally posted by zaza5000 View Post
    Hi,

    Is it possible to change the Tag and EndTime of a certain IRay object?

    If not, is it possible to get all properties of the IRay, and recreate another one with different Tag and EndTime, but rest of the properties the same?

    Thanks a lot for any help.
    For any DrawObject, if you want to later access the properties, make sure that you assign the DrawObject an identity when you create it.

    Code:
    private iDrawObject = drawobject;
    
    drawobject = DrawObjectType(signature)
    After that you can use dot notation to change any of the properties.

    Code:
    drawobject.propery = newValue;

    Comment


      #3
      Is there a way to systematically create variables?
      For example within a loop i: 1 to 20
      drawobject1, drawobject2.... drawobject20 would be used as the new variable name?

      Or is there a way of calling an IRay object through its tag? I think the tag is always unique right?

      Because I don't have a specific amount of IRay's in my code, they're drawn and erased at certain times within the code, but there is no limit to how many of them there will be...

      I just want to add a certain property to the code that will change the endtime of certain rays in some situations...
      Last edited by zaza5000; 03-20-2011, 07:20 PM.

      Comment


        #4
        Originally posted by zaza5000 View Post
        Is there a way to systematically create variables?
        For example within a loop i: 1 to 20
        drawobject1, drawobject2.... drawobject20 would be used as the new variable name?

        Or is there a way of calling an IRay object through its tag? I think the tag is always unique right?

        Because I don't have a specific amount of IRay's in my code, they're drawn and erased at certain times within the code, but there is no limit to how many of them there will be...

        I just want to add a certain property to the code that will change the endtime of certain rays in some situations...
        You seem to be saying that you will be creating an initially unknown number of drawobjects, and then may want to modify them. In that case, I think your only option would be to iterate through the drawobjects collection and modify what you seek.

        ref: http://www.ninjatrader.com/support/h...rawobjects.htm

        Comment


          #5
          Thanks a lot, that is exactly what I was looking for.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by f.saeidi, Today, 12:14 PM
          2 responses
          5 views
          0 likes
          Last Post f.saeidi  
          Started by TradeForge, 04-19-2024, 02:09 AM
          2 responses
          28 views
          0 likes
          Last Post TradeForge  
          Started by aprilfool, 12-03-2022, 03:01 PM
          3 responses
          327 views
          0 likes
          Last Post NinjaTrader_Adrian  
          Started by giulyko00, Today, 12:03 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by AnnBarnes, Today, 12:17 PM
          1 response
          2 views
          0 likes
          Last Post NinjaTrader_Zachary  
          Working...
          X