Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ChartStyle From Candlestick Bars to OHLC Bars

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

    ChartStyle From Candlestick Bars to OHLC Bars

    I have got this ChartStyle in attachment which works for Candlestick Bars (it allows for custom coloring of wicks)

    How can we apply it to OHLC bars?
    Attached Files

    #2
    Hi Paul, thanks for posting.

    OHLC and Chandlestick are already ChartStyle scripts, you can not apply a ChartStyle to another ChartStyle in one chart. See the "CandleStick" and "OHLC" ChartStyle scripts within NinjaScript Editor>Chart Style.


    Best regards,
    -ChrisL

    Comment


      #3
      Hello Chris and thanks for the suggestion.

      I found that the CandleStyle ChartStyle (built in NT8) uses
      Code:
      ChartStyleType = ChartStyleType.CandleStick;
      in OnStateChange

      Code:
       protected override void OnStateChange()
      {
      if (State == State.SetDefaults)
      {
      Name = Custom.Resource.NinjaScriptChartStyleCandlestick;
      ChartStyleType = ChartStyleType.CandleStick;

      The bbb ChartStyle shared in previous post uses
      Code:
      ChartStyleType = (ChartStyleType) 122345;
      custom code

      Code:
       protected override void OnStateChange()
      {
      if (State == State.SetDefaults)
      {
      Name = @"bbb";
      Description = "Plots customizable outline, wicks and bar opacity Candlesticks";
      ChartStyleType = (ChartStyleType) 122345;

      And the OhlcStyle ChartStyle (built in NT8) uses
      Code:
      ChartStyleType = ChartStyleType.OHLC
      in OnStateChange

      Code:
       protected override void OnStateChange()
      {
      if (State == State.SetDefaults)
      {
      Name = Custom.Resource.NinjaScriptChartStyleOHLC;
      ChartStyleType = ChartStyleType.OHLC

      What would you recommend to get the OhlcStyle applied to the bbb ChartStyle?

      I though of
      Code:
      ChartStyleType = (ChartStyleType.OHLC) 122345;
      custom code

      Code:
       protected override void OnStateChange()
      {
      if (State == State.SetDefaults)
      {
      Name = @"bbb";
      Description = "Plots customizable outline, wicks and bar opacity Candlesticks";
      ChartStyleType = (ChartStyleType.OHLC) 122345;
      Is this correct? If not, what else would you recommend?

      Comment


        #4
        Hi Paul, thanks for your reply.

        The ChartStyleType is used to uniquely identify a chart style, it does not apply other properties from other chart style types. See the documentation here:


        You would need similar logic from the CandleStick chart style type within your custom chart style to replicate its visual style. I recommended a way to make a copy of the script in my other post.

        Best regards,
        -ChrisL

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        633 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 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
        567 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