Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to hide bars but make executions text and markers visible?

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

    How to hide bars but make executions text and markers visible?

    Hello.

    I made indicator that plots custom candles over existing bars.
    To make it independent of ChartStyles changes, in State.DataLoaded on each call of OnRender() I did this:
    PHP Code:
    ChartBars.Properties.ChartStyle.IsVisible = false; 
    
    but it hides executions text and markers, so I tried this:

    PHP Code:
    Chart_Execution_Style = ChartBars.Properties.PlotExecutions;
    ChartBars.Properties.ChartStyle.IsVisible = false;
    ChartBars.Properties.PlotExecutions = Chart_Execution_Style; 
    
    still no executions on chart.

    So I tried this:

    PHP Code:
    ChartBars.Properties.ChartStyle.DownBrush    = WmBrushes.Transparent;
    ChartBars.Properties.ChartStyle.UpBrush        = WmBrushes.Transparent;
    CandleOutlineBrushes[0] = WmBrushes.Transparent; 
    
    This is less elegant, but it helps.

    But, I still can see Kagi lines, and need to move chart to trigger OnRender() to make brushes transparent again after ChartStyle changed. This is the brief video: http://somup.com/cqieQmnWRX
    And I am sure new surprises coming on this way.

    So, what ways may You to advise?

    UPD:
    Does NT have something like ChartStyle.Changed event:?
    Last edited by fx.practic; 07-03-2019, 04:48 AM.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Hello fx.practic,

    What you provided would basically be the solution to hide the bars. Depending on which chart style is being used, it may use additional brushes for its custom view which you have accounted for with the Up and Down brush.

    To cover the full range, you can additionally use:


    Code:
    BarBrush = Brushes.Transparent;
    CandleOutlineBrush= Brushes.Transparent;
    I see that with Kagi there is actually a reason the bar is shown there, the code is missing a condition.

    We have:

    Code:
    RenderTarget.DrawLine(point0, point1, Stroke.BrushDX, Stroke.Width, Stroke.StrokeStyle);
    Where this very likely should be like the other render points including the override brush:

    Code:
    RenderTarget.DrawLine(point0, point1, [B]overriddenBrush ?? (thickLine ? Stroke.BrushDX : Stroke2.BrushDX)[/B], thickLine ? Stroke.Width : Stroke2.Width, thickLine ? Stroke.StrokeStyle : Stroke2.StrokeStyle);
    I will report this to development for review. It seems that not having the override brush used here allows the style to work normally except in this use case.

    Had you noted any other chart styles which were still visible after using a transparent brush? If so, I can put requests in for those as well.

    ​​​​​​​Does NT have something like ChartStyle.Changed event:?
    There is not a specific NinjaScript ChartStyle.Changed event, the next best solution would be using OnRender as you had shown in the video. It will have a short delay due to waiting on a render pass.

    I look forward to being of further assistance.




    Comment


      #3
      Still love NT support.
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment


        #4
        I test all bars I have and Kagi is one only BarStyle that don't want to disappear entirely on my orders.
        fx.practic
        NinjaTrader Ecosystem Vendor - fx.practic

        Comment


          #5
          Hello fx.practic,

          Thank you for checking for other abnormalities, I will put this in to development as just the kagi style as that is all I see as well.

          I look forward to being of further assistance.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          597 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          343 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          556 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          555 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X