Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Candle outline thickness

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

    Candle outline thickness

    Hello guys,

    I understand that we can change the candle outline color using

    CandleOutlineBrush = Brushes.Black;

    But how I could change the candle outline line thickness?

    Thank you!

    #2
    Hello facuevasm,

    I was able to find the forum post below through a google search, which may have what you need. Note, this is undocumented.
    I'd like to configure chart candlesticks to have outline colors that can be specified for each bar condition, one color for up bars and another for down. Presently we have that option for the fill color of the candlestick only. I'm interested to have the fill transparent and only the outline showing the colors, one color for up
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you Chelsea, that is partially working. The thing now is that when I try to change the stroke from the indicator Properties, even that I change values on Color, Dash style and Width, they remain the same as the defaults values I set on (State == State.SetDefaults) originally set on the code.

      Please let me know what Im doing wrong.

      Kind regards,

      Felipe

      Comment


        #4
        Hello Felipe,

        To confirm you added a public stroke input?

        Are the variables re-assigned in State.Configure, State.DataLoaded, or OnBarUpdate()?

        Are you printing the value of the public variable in OnBarUpdate() after changing the input in the indicators window?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hello Chelsea,

          Yes I added a public stroke input:

          [Display(ResourceType = typeof(Custom.Resource), Name = "Outline", Order = 1, GroupName = "Bars")]
          public Stroke OutlineStroke { get; set; }


          The variables are re-assigned on State.SetDefults.

          OutlineStroke = new Stroke(Brushes.WhiteSmoke, DashStyleHelper.Solid, 2);

          Im printing the value but still I see the same dashstyle. It seems that my issue is update historical bars, as I change the settings.

          Do you have an email so I can send you the source code?

          Thank you Chelsea!​


          Comment


            #6
            Hello facuevasm,

            Make a test script with only the code you are investigating and you can post it on the forum instead of providing the entire script.

            That said, the Engineering Support email is scriptingsupport [at] ninjatrader.com.

            I am not able to reproduce.
            https://drive.google.com/file/d/1YAE...w?usp=drivesdk

            Attached is a test script.
            StrokeTest_NT8.zip
            Attached Files
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              I prefer to send you the entire script. I dont have problems with that. Can I send an email to scriptingsupport [at] ninjatrader.com ?

              Thank you!

              Felipe

              Comment


                #8
                Hello Felipe,

                Note, I will not be able to debug the script on your behalf. (This why it's good to create a simplified test script)

                May I confirm that the test script I provided you is behaving differently than what is shown in the video on your end?

                If you must send the script, yes, our email is scriptingsupport [at] ninjatrader.com.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Yes, the entire code is different. Its better if you check that one. I already sent it by email.

                  Thank you Chelsea!!!

                  Comment


                    #10
                    Hello facuevasm,

                    I was not able to confirm, is the test script I provided you having different behavior than shown in the video on your end?

                    In regards to setting the ChartBars.Properties.ChartStyle.Stroke, please note, this is not documented.

                    Further, there is no guarantee that the setting will take effect.

                    From the help guide:
                    "Warning: These are UI properties which are designed to be set by a user. Attempting to modify these values through a custom script is NOT guaranteed to take effect."
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Chelsea,

                      My problem is that ChartBars.ToIndex.Properties.ChartStyle.Stroke = InventoryOutlineStroke; updates every bar on the chart with that Stroke, but not just the current bar.

                      How I can handle to manipulate just the current bar?

                      Thank you!

                      Comment


                        #12
                        Hello facuevasm,

                        To confirm, from the test script the value printed from the stroke is changing as expected, is this correct?

                        If you want the last fully closed historical bar you can have a condition.
                        if (State == State.Historical && CurrentBar == Count - 2)
                        {
                        // this is the last historical bar processing
                        }
                        https://forum.ninjatrader.com/forum/...541#post811541

                        In realtime, each new bar becomes the current bar...
                        if (State == State.Realtime)
                        {
                        // this is the newest realtime bar processing
                        }
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          Yes is changing as expected. The issue is that is changing the stroke for every bar on chart, based on the condition that I code for just the current bar:

                          if(bodysize0 < (Threshold/100)*bar_range0)
                          {


                          ChartBars.ToIndex.Properties.ChartStyle.Stroke = InventoryOutlineStroke;
                          CandleOutlineBrushes[0] = InventoryOutlineStroke.Brush;

                          }


                          How in Realtime I can manage to change the stroke of just the current bar and not the entire set?​

                          Comment


                            #14
                            Hello facuevasm,

                            I'm not certain this will be possible. This is an undocumented and unsupported approach.

                            It may be this property sets the ChartStyle.Stroke for all chart bars.

                            You could choose to custom render the bars and then you would have full control of what is rendered.

                            Below are links to examples.
                            NinjaTrader 8 natively provides Heiken Ashi as a bar type for most common bar types (minute, tick, volume, second, day, week, month, year). This Heiken Ashi indicator is provided for the Range, Renko and any custom bar types that may be added. The indicator performs in the same manner as the NinjaTrader 7 version. 4-27-18 [&#8230;]

                            NYSE Advancing Issues/Declining Issues Uses historical tick data to calculate the ^ADV index minus the ^DECL index to give a simulation of the ^ADD index. Requires a data feed that supports indexes and provides data for the ^ADV (NYSE Advancing Issues) and ^DECL (NYSE Declining Issues). Update June 16th, 2020 &#8211; Corrected stroke attributes to [&#8230;]
                            Chelsea B.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                            0 responses
                            628 views
                            0 likes
                            Last Post Geovanny Suaza  
                            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                            0 responses
                            359 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by Mindset, 02-09-2026, 11:44 AM
                            0 responses
                            105 views
                            0 likes
                            Last Post Mindset
                            by Mindset
                             
                            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                            0 responses
                            562 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by RFrosty, 01-28-2026, 06:49 PM
                            0 responses
                            568 views
                            1 like
                            Last Post RFrosty
                            by RFrosty
                             
                            Working...
                            X