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

DashStyle.Style enum?

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

    DashStyle.Style enum?

    tying to include an option in the "Parameters" section of the Indicator Window to select the DashStyle options along with the Color options that I already have which work correctly

    Code:
    [FONT=Courier New][SIZE=2][COLOR=#0000ff]#region[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] Variables[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2][COLOR=#008000]// Wizard generated variables[/COLOR][/SIZE][/FONT]
    [FONT=Courier New][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] Color lineColor = Color.Cyan;[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] line_Size = [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2];[/SIZE][/FONT]
    [FONT=Courier New][SIZE=2][COLOR=red][B]private[/B][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=red][B] DashStyle style = DashStyle.Custom;[/B][/COLOR][/SIZE][/FONT]
    Code:
    [FONT=Courier New][SIZE=2][COLOR=#008000]// Serialize our Color object[/COLOR][/SIZE][/FONT]
    [FONT=Courier New][SIZE=2][Browsable([/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2])][/SIZE][/FONT]
    [FONT=Courier New][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] StyleSerialize[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
    [FONT=Courier New][SIZE=2][COLOR=#0000ff]get[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] { [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] NinjaTrader.Gui.Design.Serializable[COLOR=red][B]DashStyle[/B][/COLOR].ToString([COLOR=red]style[/COLOR]); }[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000]//SerializableColor[/COLOR][/SIZE][/FONT]
    [FONT=Courier New][SIZE=2][COLOR=#0000ff]set[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] { [COLOR=red]style[/COLOR] = NinjaTrader.Gui.Design.Serializable[COLOR=red]DashStyle[/COLOR].FromString(value); }[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]

    #2
    duck_CA,

    Unfortunately this is outside the scope of what we can offer support for. Thank you for understanding.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      No Problem

      I understand Josh...Ninja has been extremely helpful and appreciate it...

      Can you tell me if this is even possible?

      Thanks again

      Comment


        #4
        Technically, yes, but unfortunately I just don't have any information on how you could proceed to realize it though.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thanks Josh

          where this is a will...there's a way...lol

          Comment


            #6
            DashStyle is an enumeration, is that true, duck_CA? If so, wouldn't an enumeration serialised by the C#- compiler automaticaly? I thought so. Have you tried just to define a property for your dash style to see, how it works?

            Regards
            Ralph

            Comment


              #7
              Thanks Ralph

              Sorry but I can't seem to understand what you mean as this stuff is very challenging for me...

              I need somehow to try and do what you had mentioned but not sure where to start

              thanks

              Comment


                #8
                I understand. In the reference sample section is an example, how to define an own enum to be used with the property grid. I would try to install it and to modify it for your dash style.



                Regards
                Ralph

                Comment


                  #9
                  Thanks

                  Thank you for pointing me in the right direction Ralph !

                  Comment


                    #10
                    If you don't get it working that (simple) way, post it again. We will find a solution.

                    Regards
                    Ralph

                    Comment


                      #11
                      I think this should work

                      Ralph...
                      Thanks for everything...This seems to work

                      jason
                      Code:
                      [FONT=Courier New][SIZE=2][COLOR=#0000ff]#region[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] Variables[/SIZE][/FONT]
                      [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] DashStyle hlinestyle = DashStyle.Solid; [/SIZE][/FONT]
                      [/SIZE][/FONT]
                      Code:
                      [SIZE=2][FONT=Courier New][COLOR=#0000ff]protected[/COLOR][/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] OnBarUpdate()[/SIZE][/FONT]
                      [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]{[/SIZE][/FONT]
                      DrawHorizontalLine([/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000]"Current_price"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2],Close[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]],LineColor,[COLOR=red][B]HorizLineStyle[/B][/COLOR],line_Size);[/SIZE][/FONT]
                      [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]}[/SIZE][/FONT]
                      [/SIZE][/FONT][/SIZE][/FONT]
                      Code:
                      [FONT=Courier New][SIZE=2][COLOR=#0000ff]#region[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] Properties[/SIZE][/FONT]
                       
                      [SIZE=2][FONT=Courier New][Description([/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800000]"Horizontal line style"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2])][/SIZE][/FONT]
                      [SIZE=2][FONT=Courier New][Category([/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800000]"Parameters"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2])][/SIZE][/FONT]
                      [FONT=Courier New][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] [COLOR=red]DashStyle HorizLineStyle[/COLOR][/SIZE][/FONT]
                      [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
                      [FONT=Courier New][SIZE=2][COLOR=#0000ff]get[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] { [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] [COLOR=red]hlinestyle[/COLOR]; }[/SIZE][/FONT]
                      [FONT=Courier New][SIZE=2][COLOR=#0000ff]set[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] { [COLOR=red]hlinestyle[/COLOR] = value; }[/SIZE][/FONT]
                      [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]

                      Comment


                        #12
                        Looks good, I would have done the same.

                        Regards
                        Ralph

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by judysamnt7, 03-13-2023, 09:11 AM
                        4 responses
                        59 views
                        0 likes
                        Last Post DynamicTest  
                        Started by ScottWalsh, Today, 06:52 PM
                        4 responses
                        36 views
                        0 likes
                        Last Post ScottWalsh  
                        Started by olisav57, Today, 07:39 PM
                        0 responses
                        7 views
                        0 likes
                        Last Post olisav57  
                        Started by trilliantrader, Today, 03:01 PM
                        2 responses
                        21 views
                        0 likes
                        Last Post helpwanted  
                        Started by cre8able, Today, 07:24 PM
                        0 responses
                        10 views
                        0 likes
                        Last Post cre8able  
                        Working...
                        X