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

Using a Vector on Input Parameters on Ninja 8

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

    Using a Vector on Input Parameters on Ninja 8

    Hi...

    On Ninja 7 I used to input vectors ( string[] , int[] , etc ) on Properties, so the user had the option to input multiple values from same input parameter and even having the option to change the number of values adding/removing data

    Now I see on that on Ninja 8 using the same approach works but there is no way to add or remove data, just change each predefined value.

    Is there any easy solution I am not seeing ?

    Thanks !
    Attached Files
    pmaglio
    NinjaTrader Ecosystem Vendor - The Indicator Store

    #2
    Hello pmaglio,

    Thank you for the post.

    In nt7 an array would be listed like this due to how the NT7 property grid worked. Going forward, you would need to use a PropertyEditor to be able to make an editable list.

    We have a sample that demonstrates creating a custom list as a property along with some other customizations here: https://ninjatrader.com/support/foru...ad.php?t=97919

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi,
      Im using this TypeConverter method on some of my strategies and everything works fine, but just noticed that a strategy using, for example the PercentWrapper, after a compile and then a chart refresh, some warnings are shown and the strategy gets removed :

      2019-10-21 22:27:49:951 ERROR: Error on getting/setting property 'MyListValues' for NinjaScript 'SampleStrategyTypeConverter': Object of type 'System.Collections.ObjectModel.Collection`1[NinjaTrader.NinjaScript.Strategies.PercentWrapper]' cannot be converted to type 'System.Collections.ObjectModel.Collection`1[NinjaTrader.NinjaScript.Strategies.PercentWrapper]'.

      Not big deal, but not sure if something else is being affected..
      I include an example ( same example created by Bertrand but converted to Strategy )
      Can this be fixed in some way ?
      Thanks
      Pablo
      Attached Files
      pmaglio
      NinjaTrader Ecosystem Vendor - The Indicator Store

      Comment


        #4
        Hello pmaglio,

        Thank you for the post.

        This looks to be expected at this point when used from a strategy, currently the sample for Indicator type converter will only work correctly in an indicator. While you can create a strategy type converter it will suffer in this area during a re compile due to loss of identity between types. We are tracking this with the id: 13751. For the time being you would need to use a less complex property here, potentially an enum if this is a single selection from a list of values or possibly a set of bool properties which cover the range of values needed.

        The only other way to avoid that is to ensure you re apply the script after any compiles / try not to work on NinjaScript while the strategy is running.


        I look forward to being of further assistance.


        JesseNinjaTrader Customer Service

        Comment


          #5
          Thank for the quick response Jesse...
          Btw, I only need to allow the user to input a multiline input parameter, something that on ninja 7 can be done with string[] .
          Do you have any idea of an easy way to do that ?

          Thanks for the help !
          Pablo
          pmaglio
          NinjaTrader Ecosystem Vendor - The Indicator Store

          Comment


            #6
            Hello pmaglio,

            The type converter is the correct way however this will not work in that use case. This is being tracked and there is not specifically an alternative that I could suggest for the time.

            Very likely the input would need to be a normal string and then separated with a delimiter like a semi colon. In your logic you could split the string back into an array. You can also continue to use the type converter although it would have this as a side effect in this use case.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by cls71, Today, 04:45 AM
            2 responses
            9 views
            0 likes
            Last Post eDanny
            by eDanny
             
            Started by proptrade13, Today, 11:06 AM
            0 responses
            2 views
            0 likes
            Last Post proptrade13  
            Started by kulwinder73, Today, 10:31 AM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by RookieTrader, Today, 09:37 AM
            3 responses
            15 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by terofs, Yesterday, 04:18 PM
            1 response
            24 views
            0 likes
            Last Post terofs
            by terofs
             
            Working...
            X