Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Customization drawing tool “HorizontalRay Label”

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

    Customization drawing tool “HorizontalRay Label”

    Hello everyone,
    I will need your help to customize the horizontal ray drawing tool.
    I want to be able to add to the code the change in color and font size of the label and the price tag independently.

    ​​
    Attached Files

    #2
    Hello flomeunier,

    I'm note quite sure what you are meaning.

    The label is the price tag..

    If you want the text color different than the line color, add an addition public Stroke property (or Brush and Int property) within the scope of the class (and set a default in State.SetDefaults of OnStateChange()).

    You will also need to create a TextFormat() object to set the FontSize.

    SharpDX.DirectWrite.TextFormat newTextFormat = new SharpDX.DirectWrite.TextFormat(Core.Globals.Direct WriteFactory, textFormat.FontFamilyName, textFormat.FontWeight, textFormat.FontStyle, NewStrokeName.Width);

    Supply this instead of textFormat and NewStrokeName.BrushDX to the RenderTarget.DrawTextLayout() call.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello,
      Thank you for your response.
      In this indicator there is the display of the price label and in addition I can add a personalized label (text) to the horizontal ray. So I want to be able to change the color and font size of the price label and label text​

      Comment


        #4
        Hello flomeunier,

        Sure you can render your own text as a label with your own RenderTarget.DrawTextLayout() call.
        Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.


        The direction with using a new stroke (or int and brush) would still apply.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks for your answer but I can't do that

          Comment


            #6
            Hello everyone,

            I am coming back to you following my publication in which I sought to make the display of the price label optional and to be able to independently modify the color and writing size of the price label and the text label.
            So I managed to make these modifications, so you will find attached to this comment the drawing tools with the modifications, and it works.
            I hope it can be useful.​
            Attached Files

            Comment


              #7
              Hello flomeunier
              Thanks for your excellent tool.
              I wanted to ask you if in this version, it was possible to make the adjustments shown in the images.

              Click image for larger version

Name:	PRUEBA.jpg
Views:	157
Size:	807.7 KB
ID:	1335589

              Comment


                #8
                Hello ingresoscontalento I'm sorry but the version I shared with you contains errors, particularly when saving templates.
                Here is an updated version that works perfectly.​
                Attached Files

                Comment


                  #9
                  Hi flomeunier
                  excellent work. thank you.

                  Comment


                    #10
                    Hi @ingresoscontalento​ Does it work for you?

                    Comment


                      #11
                      Hi flomeunier
                      Working perfectly. excellent work. thank you.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      558 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      324 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      101 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      545 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      547 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X