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

CandleOutlineBrushes set as a GlobalDrawingTool

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

    CandleOutlineBrushes set as a GlobalDrawingTool

    Hello,

    I'm trying to set up CandleOutlineBrushes to draw on all charts globally.
    Code:
    CandleOutlineBrush = Brushes.Magenta;
    Is there an easier way to add it?

    Thank you​

    #2
    Hello nzag555,

    Thanks for your post.

    CandleOutlineBrush sets the outline Brush of a candlestick. This property cannot be set globally as it does not have a parameter available that lets you specify for it to be used globally across all charts. It will only apply to the instrument/chart that the indicator calling CandleOutlineBrush is applied to.

    CandleOutlineBrush: https://ninjatrader.com/support/help...tlinebrush.htm

    Please let me know if I may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hey Brandon,


      In order to bypass the CandleOutlineBrush issue, I made a rectangle that imitates the same concept.
      Code:
      Rectangle myRec = Draw.Rectangle(this, "Absorption" + CurrentBar.ToString(), Time [1].AddSeconds(60), Low[0] - 0.5 * TickSize, Time [1].AddSeconds(17), High[0] + 0.5 * TickSize, true, null);
      myRec.AreaBrush = Brushes.Transparent;
      myRec.OutlineStroke.Brush = Brushes.Magenta;

      The rectangle ideally, would need to start drawing at the current bar (0) and finish the drawing when the bar completes to form (just like CandleOutlineBrush would do).
      Unfortunately, it draws it like a vertical line instead of a square. I had to AddSeconds before the bar and after it to get a square type.
      Any creative solution how to make it draw as I mentioned earlier?
      The current solution makes the chart look very messy and inaccurate.

      * The script is set up on a volume chart and not a time chart.

      Comment


        #4
        Hello nzag555,

        Thanks for your note.

        We do not have any supported workarounds for creating a Global CandleOutlineBrush. The solution you came up with would be the closest workaround for this.

        I have submitted a feature request to the Development team to add an isGlobal property for CandleOutlineBrush for you. This request is being tracked under the number SFT-5737.

        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.​
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          We already figured CandleOutlineBrush cannot be set globally in your first note.
          What I am asking is how the Rectangle anchors can be modified so the drawing starts at the beginning of the bar and finishes at the end instead of starting / ending in the middle?
          If you have a post that relates to this information it'd be greatly appreciated.

          Comment


            #6
            Hello nzag555,

            Thanks for your note.

            We do not have any documentation or reference samples for how that could be accomplished. The Draw.Rectangle() method is designed to be drawn from the center of a bar to the center of another bar.

            This would likely require custom rendering in OnRender() using custom x and y values converted from the bar times.

            See the forum thread below for a link to an example script that could help get you started with custom rendering: https://ninjatrader.com/support/foru...955#post819955

            And, see this help guide page for more information about using SharpDX for custom rendering: https://ninjatrader.com/support/help...=using+sharpdx

            You may also view the SampleCustomRender indicator script that comes default with NinjaTrader for an example of custom rendering objects. To view the script, open a New > NinjaScript Editor window, open the Indicators folder, and double-click on the SampleCustomRender file.

            Please let me know if I may assist further.
            Brandon H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by mmenigma, Yesterday, 03:25 PM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by kujista, Today, 05:44 AM
            0 responses
            6 views
            0 likes
            Last Post kujista
            by kujista
             
            Started by ZenCortexCLICK, Today, 04:58 AM
            0 responses
            9 views
            0 likes
            Last Post ZenCortexCLICK  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            172 responses
            2,281 views
            0 likes
            Last Post sidlercom80  
            Started by Irukandji, Yesterday, 02:53 AM
            2 responses
            18 views
            0 likes
            Last Post Irukandji  
            Working...
            X