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

Access parameter description and name in onstrategy change

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

    Access parameter description and name in onstrategy change

    Hello Is it possible to access values such as Description and name in parameters?

    Code:
            [Display(ResourceType = typeof(Custom.Resource), Name = "Kontrakty", GroupName = filterMoneyManagement, Order = filterMoneyManagementOrder, Description = "Počet kontraktů, které se budou obchodovat")]
            public int ContractsSet1 {
                get { return iContractsSet[0]; }
                set { iContractsSet[0] = value; }
            }
    ​

    #2
    Hi kujista, I found one answer to this question here, though I am not able to test this out due to going out of the scope of support I am able to provide on the subject:
    public class Class1 { [DisplayName("Something To Name")] public virtual string Name { get; set; } } How to get the value of DisplayName attribute in C# ?
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi Chris,
      Is there a way to echo properties values and names in State.DataLoaded code using similiar code to:
      https://ninjatrader.com/support/help...a_typeconverte r_to_custo.htm

      In this part I need to get all values of all properties and echo them to console. and in example above it does not show anything :-/ even if there is
      Code:
      foreach (PropertyDescriptor property in propertyDescriptorCollection)
                      {
                          // do something with a specific property
      
                          // cannot call Print() here
                          // but you can call the static Output window "Process()"
                          NinjaTrader.Code.Output.Process(property.Name, PrintTo.OutputTab1);
                      }​

      Comment


        #4
        Why can't you call Print() in State.DataLoaded? I do that and it works fine.
        Bruce DeVault
        QuantKey Trading Vendor Services
        NinjaTrader Ecosystem Vendor - QuantKey

        Comment


          #5
          Hi kujista, I answered on the other forum thread here:

          Hi, is it possible when I change value of 1 parameter in strategy settings to set other values to predefined values? so i do not need to do this manually? I want to change value on top, and when i do so, it will change values of other fields.. ​ ​


          Please post there if you have any questions.
          Chris L.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by futtrader, 04-21-2024, 01:50 AM
          4 responses
          41 views
          0 likes
          Last Post futtrader  
          Started by Option Whisperer, Today, 09:55 AM
          1 response
          11 views
          0 likes
          Last Post bltdavid  
          Started by port119, Today, 02:43 PM
          0 responses
          3 views
          0 likes
          Last Post port119
          by port119
           
          Started by Philippe56140, Today, 02:35 PM
          0 responses
          4 views
          0 likes
          Last Post Philippe56140  
          Started by 00nevest, Today, 02:27 PM
          0 responses
          2 views
          0 likes
          Last Post 00nevest  
          Working...
          X