Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT 8 - Custom Bar Type - ChartStyle Listing

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

    NT 8 - Custom Bar Type - ChartStyle Listing

    In NT 7, There is a "Chart Style Type Override" feature in the chart code that allows a developer to limit the drop-down selection listing for chart styles for a specific chart. (Shown below)

    public override Gui.Chart.ChartStyleType[] ChartStyleTypesSupported { }

    In NT 8, it appears that this ability is no longer available. In NT 8, All Chart Styles appear to be available on all chart types.

    This means that one vender's custom chart style will show up on all other venders custom bars charts style listings selection menu's.

    Can something similar to "Chart Style Type Override" be added to NT 8 chart type code to allow programmers to deal with this issue?

    Thanks
    RJay
    NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

    #2
    Any chart style can be used with any bars type which was a design decision made for NinjaTrader 8. We've removed the concept of restricting chart styles for bars types.

    You can set the DefaultChartStyle to ensure users are using your desired chart style when selecting your bars type.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Originally posted by NinjaTrader_Matthew View Post
      Any chart style can be used with any bars type which was a design decision made for NinjaTrader 8. We've removed the concept of restricting chart styles for bars types.

      You can set the DefaultChartStyle to ensure users are using your desired chart style when selecting your bars type.
      I am having compile issues defining the DefaultChartStyle as a "custom chart style" and currently no supporting documentation is available.

      Could you provide a DefaultChartStyle sample for a "custom chart style" that might work?

      ChartStyle Info needed for code is as follows:

      protected override void OnStateChange()
      {
      if (State == State.SetDefaults)
      {
      Name = "Test Candles";
      ChartStyleType = (ChartStyleType) 801;
      }


      Below are the KagiLine DefaultChartStyle that compiles and a custom DefaultChartStyle not compiling.

      // DefaultChartStyle = Gui.Chart.ChartStyleType.KagiLine;
      // DefaultChartStyle = Gui.Chart.ChartStyleType.801;

      I have tried many versions with no results.

      Any suggestions are appreciated.
      RJay
      NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

      Comment


        #4
        You would need to cast the default chart style if you're using something that is not pre-registered (such as you observed with Kagi)

        Code:
        MyCustomChartStyle : ChartStyle
        ...
        ChartStyleType		= (ChartStyleType) 8;
        Code:
        MyCustomBarsType : BarsType
        ...
        DefaultChartStyle = (ChartStyleType) 8;
        Hope that helps.
        Last edited by NinjaTrader_Matthew; 05-18-2015, 10:05 AM.
        MatthewNinjaTrader Product Management

        Comment


          #5
          NinjaTrader NT 8.002 Problem still there.

          NinjaTrader NT 8.002

          I am still having issues with setting a DefaultChartStyle to a custom chart.

          I have separately tried both the lines of code below.

          -----------------------------------------------------------------------------------------------------------------------

          DefaultChartStyle = NinjaTrader.NinjaScript.ChartStyles.RJayXRayCandle Style;

          DefaultChartStyle = NinjaTrader.NinjaScript.ChartStyles.OpenCloseStyle ;

          -----------------------------------------------------------------------------------------------------------------------

          Neither compile and display the following error.

          "NinjaTrader.NinjaScript.ChartStyle is a type, which is not valid in the given context."

          Any suggestions or code samples?



          Originally posted by RJay View Post
          I am having compile issues defining the DefaultChartStyle as a "custom chart style" and currently no supporting documentation is available.

          Could you provide a DefaultChartStyle sample for a "custom chart style" that might work?

          ChartStyle Info needed for code is as follows:

          protected override void OnStateChange()
          {
          if (State == State.SetDefaults)
          {
          Name = "Test Candles";
          ChartStyleType = (ChartStyleType) 801;
          }


          Below are the KagiLine DefaultChartStyle that compiles and a custom DefaultChartStyle not compiling.

          // DefaultChartStyle = Gui.Chart.ChartStyleType.KagiLine;
          // DefaultChartStyle = Gui.Chart.ChartStyleType.801;

          I have tried many versions with no results.

          Any suggestions are appreciated.
          RJay
          NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

          Comment


            #6
            Originally posted by RJay View Post
            NinjaTrader NT 8.002

            I am still having issues with setting a DefaultChartStyle to a custom chart.

            I have separately tried both the lines of code below.

            -----------------------------------------------------------------------------------------------------------------------

            DefaultChartStyle = NinjaTrader.NinjaScript.ChartStyles.RJayXRayCandle Style;

            DefaultChartStyle = NinjaTrader.NinjaScript.ChartStyles.OpenCloseStyle ;

            -----------------------------------------------------------------------------------------------------------------------

            Neither compile and display the following error.

            "NinjaTrader.NinjaScript.ChartStyle is a type, which is not valid in the given context."

            Any suggestions or code samples?
            Try:

            DefaultChartStyle = (ChartStyleType) 801; //or whatewer number you are using for your chart style
            ArtSenior Software Developer

            Comment


              #7
              Hello,
              I've tried to write my own custom BarType and it seemed working fine.
              However I have two unexpected issues :
              1. Regarding the new BarType declaration if I cast my new bartype with the number 14, everything is fine :
              Code:
              //Code working fine
              BarsPeriod = new BarsPeriod { BarsPeriodType = (BarsPeriodType) [B]14[/B], BarsPeriodTypeName = "MyBartType", Value = 8 };
              If I use 15 or another number, the code compile but then I have an unhandled exception (see attachement). It also remove my custom settings in the new interval selector.
              Code:
              //Code not working
              BarsPeriod = new BarsPeriod { BarsPeriodType = (BarsPeriodType) [B]15[/B], BarsPeriodTypeName = "MyBartType", Value = 8 };
              Also, I have a question regarding this number. If a custom bartype already use this number (14 or whatever), will my new bartype override it? In this case do we have to check the available numbers, not used by any custom bartype ?

              2. Regarding the "Break at EOD" option, is it possible to disable it by code. It is enabled by default and I have an issue with this option when it is enabled.

              3. Last thing regarding the new "Interval Selector". Is it possible to save my settings in a template ? I don't find where I can do that.


              Originally posted by NinjaTrader_Art View Post
              Try:
              DefaultChartStyle = (ChartStyleType) 801; //or whatewer number you are using for your chart style
              Thanks in advance,

              -----------------------------------------------
              Christophe - Ninja-Addons.com
              CEO Azur Investment Technologies "AzurITEC" sas

              3rd Party Add-On Vendor
              Attached Files

              Comment


                #8
                Originally posted by NinjaTrader_Art View Post
                Try:

                DefaultChartStyle = (ChartStyleType) 801; //or whatewer number you are using for your chart style

                Thanks for the help. I have the DefaultChartStyle feature working.

                I have another request? I need to be able to determine which ChartStyleType has been selected for a chart from inside the ChartType program code?

                I have been unable to find/build code to extract this information. Can you help?
                RJay
                NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

                Comment


                  #9
                  Originally posted by AzurITec_Chris View Post
                  If I use 15 or another number, the code compile but then I have an unhandled exception (see attachement).
                  Thanks for the report - I have sent this bug to development and is tracking using #8357

                  Originally posted by AzurITec_Chris View Post
                  It also remove my custom settings in the new interval selector.
                  This would currently be expected as the interval selector is built from the enum value... if you change the underlying value there would be no way to recover those settings and transfer to another bar type you are essentially recreating.

                  Originally posted by AzurITec_Chris View Post
                  Also, I have a question regarding this number. If a custom bartype already use this number (14 or whatever), will my new bartype override it? In this case do we have to check the available numbers, not used by any custom bartype ?
                  If multiple bar types are found on compliation, it will ignore one of the conflicting bar types. There is not a repository that is currently available to check against. One would need to check their log for errors if there are any conflicts found.


                  Originally posted by AzurITec_Chris View Post
                  2. Regarding the "Break at EOD" option, is it possible to disable it by code. It is enabled by default and I have an issue with this option when it is enabled.
                  I do not immediately see a way to detect this, I will check with development and get back to you shortly

                  Originally posted by AzurITec_Chris View Post
                  3. Last thing regarding the new "Interval Selector". Is it possible to save my settings in a template ? I don't find where I can do that.
                  This is a user specific setting stored in the UI.xml file. I'm curious, are you asking to transfer from a personal computer to another, or were you planning on distributing your interval selector to clients/partners?
                  Last edited by NinjaTrader_Matthew; 06-04-2015, 08:27 AM.
                  MatthewNinjaTrader Product Management

                  Comment


                    #10
                    Originally posted by RJay View Post
                    Thanks for the help. I have the DefaultChartStyle feature working.

                    I have another request? I need to be able to determine which ChartStyleType has been selected for a chart from inside the ChartType program code?

                    I have been unable to find/build code to extract this information. Can you help?
                    No, this is not possible. Chart Styles and Bar Types are not related therefore would not be aware of each other.
                    MatthewNinjaTrader Product Management

                    Comment


                      #11
                      Originally posted by AzurITec_Chris View Post
                      2. Regarding the "Break at EOD" option, is it possible to disable it by code. It is enabled by default and I have an issue with this option when it is enabled.
                      Update: From any of the event handlers that expose the bars object, you can check bars.IsResetOnNewTradingDay. Please see the HeikenAshiBarsType for example on line #373
                      MatthewNinjaTrader Product Management

                      Comment


                        #12
                        Originally posted by NinjaTrader_Matthew View Post
                        This is a user specific setting stored in the UI.xml file. I'm curious, are you asking to transfer from a personal computer to another, or were you planning on distributing your interval selector to clients/partners?
                        Actually it could be both. But originally, I asked that because my bartType has 2 parameters Value and Value2, and I've found the way to set these 2 parameters in the Interval Selector using for example a pattern like : {@VALUE ; @VALUE2} but it is not really obvious at first sight.
                        It could be usefull to join a Template showing an example of how to configure the Interval Selector for my specific BarType when I distribute it.


                        -----------------------------------------------
                        Christophe - Ninja-Addons.com
                        CEO Azur Investment Technologies "AzurITEC" sas

                        3rd Party Add-On Vendor

                        Comment


                          #13
                          Thanks for the clarification. I've added your feedback to allow those to be saved in templates and can be tracked using ID # 437
                          MatthewNinjaTrader Product Management

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by RookieTrader, Today, 09:37 AM
                          3 responses
                          15 views
                          0 likes
                          Last Post NinjaTrader_ChelseaB  
                          Started by kulwinder73, Today, 10:31 AM
                          0 responses
                          5 views
                          0 likes
                          Last Post kulwinder73  
                          Started by terofs, Yesterday, 04:18 PM
                          1 response
                          23 views
                          0 likes
                          Last Post terofs
                          by terofs
                           
                          Started by CommonWhale, Today, 09:55 AM
                          1 response
                          4 views
                          0 likes
                          Last Post NinjaTrader_Erick  
                          Started by Gerik, Today, 09:40 AM
                          2 responses
                          7 views
                          0 likes
                          Last Post Gerik
                          by Gerik
                           
                          Working...
                          X