Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to create a OHLC data serie

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

    How to create a OHLC data serie

    Hi everyone,

    I'm looking to create a OHLC data serie. Anyone can help me ?

    Many Thanks!
    Eros

    #2
    Hello Eros Lima,

    Thanks for your post.

    You could simply use PriceSeries which is already available to access OHLC values instead of creating your own. PriceSeries holds the OHLC values of a bar and more.

    A Series<T> consists of one value per bar. Note that you should use multiple series for multiple values instead of trying to make one series with multiple values.

    See the help guide documentation below for more information.
    PriceSeries: https://ninjatrader.com/support/help...riceseries.htm

    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


      #3
      Hello Brandon,

      My main goal is to put the indicator´s values in a candle representation.

      I think that it´s possible adding a new serie (AddPlot) in indicator file, and them assign the values Open, High, Low and Close with value indicators

      What you think about ? Sound ´s good ?

      Thanks for your reply and attention.
      Eros

      Comment


        #4
        Hello Eros Lima,

        Thanks for your note.

        I am not quite sure I understand your goal.

        The bars on a chart already contain Open, High, Low, and Close prices so you would not need to create your own bars (candles). These prices could be accessed using the PriceSeries as mentioned in my previous post.

        Bars (candles) are considered BarsTypes and BarsTypes cannot be created using the AddPlot() method. AddPlot() would be used to add plots to the chart, not candles. Note that creating a custom BarsType would require advanced programming knowledge.

        The Current Day OHL indicator and Prior Day OHLC indicator that comes default with NinjaTrader are great examples of plotting the Open, High, Low, and Close to a chart. You could see this by adding these indicators to a chart window and viewing the plots they make.

        If you are wanting to create a custom BarsType, see this section of the help guide: https://ninjatrader.com/support/help.../bars_type.htm

        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


          #5
          Brandon,

          I know that bars price contains Open, High, Low, Close and Volume. But I wanna make a new OHLC serie, to show in a chart, with data (OHLC) of an Indicator.

          For example, we have candle of price, but I like to show the candle of an Indicator, with Open, High, Low and Close of values of this indicator.

          I wrote: "I think that it´s possible adding a new serie (AddPlot) in indicator file, and them assign the values Open, High, Low and Close with value indicators"

          You wrote: "Bars (candles) are considered BarsTypes and BarsTypes cannot be created using the AddPlot() method. AddPlot() would be used to add plots to the chart, not candles. Note that creating a custom BarsType would require advanced programming knowledge."

          I am not looking to create a Bar (candle), but a Serie that I can show in a chart, with a CandleStick Style.

          In this case, I need create a Serie (OHLC) and them populate it. Then, I use in a chart.

          It´s possible, or I´m dreaming a lot ?

          Eros




          Comment


            #6
            Hello Eros Lima,

            Thanks for your note.

            It seems like you are wanting to make a BarsType that uses an indicator. It would not be possible to call an indicator in a BarsType.

            Something you could do is use an indicator and OnRender() to make "candles" of whatever values you wanted. If these values are Open, High, Low, and Close, you would need to create 4 series or plots. One series or plot for each value.

            You could view the OnRender() section of the CandleStyle ChartStyle to see how to draw a candle in OnRender(). To view the CandleStyle script, open a New > NinjaScript Editor window, open the ChartStyles folder, and select the CandleStyle script.

            OnRender(): https://ninjatrader.com/support/help...8/onrender.htm

            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


              #7
              Hi Brandon !!!

              Many Thanks !!! I will take a look and I make my candle of my indicator.

              Eros

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              648 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              369 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
              572 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              574 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X