Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Settings in Grid - Array of Enums not supported ?

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

    Settings in Grid - Array of Enums not supported ?

    Hi guys,

    in NT7 - one could configure List/Array of enums in grid with settings.

    This is not possible to configure in NT8 anymore.
    The grid with enum settings display correct values set from code.
    User can change value for existing enum (existing enums = added from code),
    but one cannot add additional enum (or remove existing enum).
    But the Array / List of enums are expected to be configurable - the same way like it worked with NT7.

    See screenshot in NT8 and see,
    there is no way to Add / Remove from collection of selected enums.




    In NT7 it worked correctly this way:
    One could
    • Add enum
    • Remove enum
    • Modify enum to different value


    Attached Files
    Last edited by misova; 05-01-2017, 06:45 AM.

    #2
    Thank you for your question misova. I was unable to locate a FaAsset tool online for NinjaTrader. While we can not provide support for this custom software directly, it may help users familiar with this software if you could provide a link showing where you got this tool from in NinjaTrader 7 and NinjaTrader 8.

    If you are the developer of the FaAsset tool, I'd like to recommend reviewing the following links which should help you set up a custom properties grid in NT8.





    We are happy to help with any questions that come up.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Hi,

      this is misunderstanding.
      FaAsset is not an external tool - it is simple enum used in my custom strategy

      Code:
      public enum FaAsset
      {
              // Currencies
              USD, EUR, GBP, CHF, NZD, AUD, CAD, JPY, CNY,
              // Commodities - Metals
              GOLD, SILVER, COPPER,
              // Commodities - Energy
              CRUDE_OIL, HEATING_OIL, NATURAL_GAS,
              // Commodities - Grains
              CORN, SOYA_BEAN, WHEAT,
              // Commodities - Softs
              COFFEE, COCOA, COTTON, SUGAR, LUMBER, ORANGE_GUICE,
              // Commodities - Meat
              LEAN_HOGS, LIVE_CATTLE, FEEDER_CATTLE
      }

      My strategy exposes settings in - and one of the property is of type FaAsset.
      I simply exposed it as property of my strategy. This way in code

      Code:
      private FaAsset[] blockTrading_aroundFa_1_assets = new FaAsset[] { FaAsset.EUR, FaAsset.USD };
      
      [NinjaScriptProperty]
      [Display(GroupName = "2b1. Market context # Block trading around Fa - Volatility", Name = "Assets", Order = 2, Description = "")]
      public FaAsset[] BlockTrading_AroundFa_1_Assets
      {
         get { return blockTrading_aroundFa_1_assets; }
         set { blockTrading_aroundFa_1_assets = value; }
      }
      This is, what you see in screenshot.

      Please reproduce with attached strategy.
      I modified SampleMaCrossOver - so it demonstrates the problem in minimalistic example.

      Please try to add / remove element in the settings - and you will see, it is not possible. It is possible to only modify existing element - that was previously added from the code.

      Simply said, there NT8 does not have any working Collection / List / Array Editor in the Settings Grid, that could Add / Remove elements.

      The same scenario is correctly working in NT7 = it is possible to add / remove / modify any element in GUI settings.
      Attached Files
      Last edited by misova; 05-01-2017, 04:07 PM.

      Comment


        #4
        I can confirm, that official reference example also does not work for Collection editor.

        I attach oficial reference example indicator for reproducing the problem.
        (Source of this indicator is NT8 here: http://ninjatrader.com/support/forum...ad.php?t=97919 )

        Please use attached indicator - and check Scenario #5, which is editing Collection.
        It simply does not work and shows just empty box.

        This happens on current latest: NT8 v8.0.6.1

        Look at the problem on screenshot below

        Attached Files
        Last edited by misova; 05-01-2017, 04:24 PM.

        Comment


          #5
          As an aditional example, to show, that Collection editor does not work,
          I am attaching minimalistic example - modified @SampleMACrossOver.cs

          @SampleMACrossOver.cs

          Exception is thrown:

          Attached Files
          Last edited by misova; 05-01-2017, 04:52 PM.

          Comment


            #6
            Thank you misova. In my earlier post I had some posts related to this that I would like to add again to this post.





            For reference I was also able to locate on the internet the publicly available resource you were referencing in your first post



            The reason you are seeing this is because NT8 does not use WinForms technology the way the linked CodeProject sample does. Instead, NT8 uses WPF UI technology. Please review the three linked posts for examples on using the properties grid in NT8. As a convenience I have attached the SampleIndicatorTypeConverter_NT8.zip from the third link to this post directly.
            Attached Files
            Jessica P.NinjaTrader Customer Service

            Comment


              #7
              Thank you Jessica,

              I used SampleIndicatorTypeConverter_NT8.zip from your last post,
              and there is still the same problem.

              Confirm please, if you can reproduce the problem on NT8 v8.0.6.1

              I have reviewed provided links, but still cant make it work.
              If possible,provide me with some minimalistic working example, where collection editor works please.

              It just does not work correctly.
              See this screenshot please.

              Attached Files
              Last edited by misova; 05-02-2017, 01:59 PM.

              Comment


                #8
                Thank you misova. I have seen the same on our end. I am reviewing our code samples and will return when I have more information. In the meantime this page has the best explanation as to what is happening.

                Last edited by NinjaTrader_JessicaP; 05-02-2017, 02:23 PM.
                Jessica P.NinjaTrader Customer Service

                Comment


                  #9
                  Thank you Jessica, I am looking forward for the result,
                  because this is blocking our migration from NT7 to NT8.

                  Working CollectionEditor is a must have for configuration all of our strategies.

                  Comment


                    #10
                    I was able to determine that, between when that sample was posted and today, there was a code breaking change which keeps the sample from working. I have approached the responsible teams.

                    I have attached a working version of this tool to this post so you have it right away. Please let us know if there are any other ways we can help.
                    Attached Files
                    Last edited by NinjaTrader_JessicaP; 05-02-2017, 03:05 PM.
                    Jessica P.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_JessicaP View Post
                      I was able to determine that, between when that sample was posted and today, there was a code breaking change which keeps the sample from working. I have approached the responsible teams.

                      I have attached a working version of this tool to this post so you have it right away. Please let us know if there are any other ways we can help.
                      Excellent, thank you Jessica for providing us with the solution!

                      Comment


                        #12
                        Hi Jessica,

                        I tested provided solution.
                        • I can confirm - it works on Indicators really well.
                        • But it does not work, when applied to Strategies.


                        Result looks broken - there is no editing capabalities and it fails on exception finally.
                        See the screenshot


                        After closing the dialog, this exception is thrown:


                        Please
                        • download my minimalistic example = modified @SampleMACrossOver.cs,
                        • and confirm, if you can reproduce it.


                        If possible, it would be really nice, if you could provide us also with similar handy solution,
                        that works for Strategies, because they are of our primary concern in our transition from NT7 to NT8..

                        Best regards
                        Misova
                        Attached Files
                        Last edited by misova; 05-03-2017, 01:59 PM.

                        Comment


                          #13
                          This behavior was confirmed on our end. We will be investigating this further. Please keep an eye on the NinjaTrader 8 Release Notes page for updates and bugfixes.





                          Tracking ID:
                          NTEIGHT-11645
                          Jessica P.NinjaTrader Customer Service

                          Comment


                            #14
                            I have some more information regarding this. I have attached a work-around. There is an internal limitation similar to these :

                            Originally posted by http://ninjatrader.com/support/helpGuides/nt8/en-us/?ntwindow.htm
                            AddOn Classes which derive from NTWindow or implements IWorkspacePersistance CANNOT be a nested type of another class and MUST have a default constructor
                            Originally posted by http://ninjatrader.com/support/helpGuides/nt8/en-us/?iworkspacepersistence_interface.htm
                            Note: AddOn Classes which derive from NTWindow or implements IWorkspacePersistance CANNOT be a nested type of another class and MUST have a default constructor
                            The way to work around this is to move PercentWrapper directly into the Strategy namespace. The attached example does this.
                            Attached Files
                            Jessica P.NinjaTrader Customer Service

                            Comment


                              #15
                              Hi Jessica,

                              please add a request, that for enum classes should be handled automatically - without need to code custom Wrapper classes.

                              As enums are frequently used for selection and they are now supported in NT7 out of the box,
                              they should be supported also for NT8 out of the box = without need to write custom Wrappers around enum classes.

                              Coding custom wrappers make sense in case of our very custom classes, but not for standardized class like enums. Such basic scenario should be supported automatically for convenience of the developers, without requiring them more work, than is really needed..

                              Internal implementation can be:
                              Some default EnumWrapper should be automatically used, in case enum class is used, so there is no need to add our own Wrapper.
                              Last edited by misova; 05-07-2017, 01:15 PM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by chbruno, Today, 04:10 PM
                              0 responses
                              1 view
                              0 likes
                              Last Post chbruno
                              by chbruno
                               
                              Started by josh18955, 03-25-2023, 11:16 AM
                              6 responses
                              436 views
                              0 likes
                              Last Post Delerium  
                              Started by FAQtrader, Today, 03:35 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post FAQtrader  
                              Started by rocketman7, Today, 09:41 AM
                              5 responses
                              19 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by frslvr, 04-11-2024, 07:26 AM
                              9 responses
                              127 views
                              1 like
                              Last Post caryc123  
                              Working...
                              X