Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Update Appearance on Shape Across Charts

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

    Update Appearance on Shape Across Charts

    Hi-

    I couldnt find the answer to this....I have created a custom rectangle that allows me to use the keyboard to choose a preset appearance of the Area color. If I have the shape set to All Charts, so its visible across all, when I update the shapes appearance, it only updates on the current chart. I would like it to be a global update but not sure how I can achieve this?

    Thanks!

    Nick.

    #2
    Hello ptpatrader,

    Thanks for your post.

    It would be expected that NinjaScript changes to a global drawing object would not propagate to all charts.

    However, this can be worked around by doing something like the following, but note that this will change the owner of the drawing object.

    Code:
    foreach (DrawingTool dt in DrawObjects)
    {
        if (dt is HorizontalLine && dt.IsGlobalDrawingTool)
        {
            (dt as NinjaTrader.NinjaScript.DrawingTools.Line).Stroke. Brush = CurrentBar % 2 == 0 ? Brushes.Purple : Brushes.Crimson;
            DrawingTool.SetDrawingToolCommonValues(dt, (dt as IDrawingTool).Tag, (dt as IDrawingTool).IsAutoScale, this, true);
        }
    }
    That being said, I have added a vote on your behalf for an existing feature request to support this. This request is being tracked under the number SFT-4438.

    As with all feature requests, interest is tracked before implementation is considered, so we cannot offer an ETA or promise of fulfillment. If implemented, it will be noted in the Release Notes page of the Help Guide.

    Release Notes — https://ninjatrader.com/support/help...ease_notes.htm

    Please let us know if we may be of further assistance to you.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Thanks Brandon for your help. If I update a shape on any chart, it updates on all charts, so its definitely disappointing that from code that same process doesnt exist, but understood.

      Thanks for submitting the change request.
      Nick.

      Comment


        #4
        Hey Brandon,

        So my shape is a descendent of ShapeBase. That code logic you have there takes a DrawingTool - does this mean that in my shape I cannot cast myself to a drawingtool?

        My shape receives a hotkey press, and then applies an appearance style to its Area which is on ShapeBase:

        AreaBrush = SupplyStrongAreaColor;
        OutlineStroke = SupplyStrongOutlineStroke;

        This works and updates the current chart. I was thinking that I could cast myself as a IDrawingTool. That doesnt work because arg 4 of SetDrawingTools is expecting the NinjaScriptBase but this is happening in a ShapeBase child class.

        I am assuming your code is running in a NinjaScript - I am just using the Ninja Editor so its impossible to reflect the types here. The code you shared seems to be only executable from an indicator not a shape....if I could gain access to a script or just the DrawingTool interface somehow that would work...

        Comment


          #5
          Hello ptpatrader,

          Thanks for your note.

          ShapeBase inherits from DrawingTool and can be cast as a DrawingTool or could be cast to ShapeBase if you wanted.

          You could view the Shapes.cs file located in the DrawingTools folder of the NinjaScript Editor window. On line 21 of this file, we can see the ShapeBase inherits from DrawingTool.

          Let us know if we may assist further.
          <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          647 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          368 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          571 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          573 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X