Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Create chart from multiple charts

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

    Create chart from multiple charts

    I would like to create a chart or indicator that is actually a combination of 2 stocks.
    eg if stock 1 is at $200
    And stock 2 is at $50
    The chart/indicator should actually plot a value of 250.
    Ideally it should have candles as well.
    Is this possible?

    #2
    Hello quertyjjj,

    Thank you for your reply.

    There would not be a built-in way to do this in the platform. To clarify, when you say "Ideally it should have candles as well", do you mean you want candles for both series plotted on the chart and then a indicator plot showing a line with the total value, or were you wanting candles made from the indicator value? What would be the OHLC of the bars if so, since you've only specified a single value that's just the total of the two values?

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Kate View Post
      Hello quertyjjj,

      Thank you for your reply.

      There would not be a built-in way to do this in the platform. To clarify, when you say "Ideally it should have candles as well", do you mean you want candles for both series plotted on the chart and then a indicator plot showing a line with the total value, or were you wanting candles made from the indicator value? What would be the OHLC of the bars if so, since you've only specified a single value that's just the total of the two values?

      Thanks in advance; I look forward to assisting you further.
      Hi
      yes candles of ohlc.
      Just one candle for each time setting.
      If if I open a 15 min chart
      Stock 1 o 200 h 210 l 190 c 200
      Stock 2 o 50 h 55 l 45 c 50

      The chart should show an ohlc candle with
      O 250 h 265 l 235 c 250

      Ideally I want a chart that shows this. The only reason for the indicator is that I assumed a custom chart was not possible so I would have to build the chart in an indicator instead

      Comment


        #4
        Hello qwertyjjj,

        Thank you for your reply.

        You could definitely do this in an indicator. This indicator from our User App Share provides a basic outline of creating an indicator that plots candlesticks:

        This is a sample of how to create an indicator in Candlestick (OHLC), which was tooked from the Spread Indicator with Candlesticks developed by kdoren and originally coded for the NinjaTrader 7 platform by NinjaTrader_AdamP.


        This could be easily modified to add a second data series using AddDataSeries() (https://ninjatrader.com/support/help...dataseries.htm) and then add the opens/highs/lows/closes together and then would plot those added values. In the example it's just a single data series, and just uses the OHLC for that series to plot in an indicator panel, but all you'd really have to do to modify it is add the secondary series and then do something like:

        IndOpen[0] = Opens[0][0] + Opens[1][0];
        IndHigh[0] = Highs[0][0] + Highs[1][0];
        IndLow[0] = Lows[0][0] + Lows[1][0];
        IndClose[0] = Closes[0][0] + Closes[1][0];

        The rest of the existing code in the example would take care of the plotting part for you.

        Keep in mind that this would only properly function on time based bars, as with tick based/custom bar types the bars wouldn't be at the same times and you'd get some odd values.

        Please let us know if we may be of further assistance to you.

        The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by bortz, 11-06-2023, 08:04 AM
        47 responses
        1,610 views
        0 likes
        Last Post aligator  
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        9 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        19 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        6 views
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        22 views
        0 likes
        Last Post Javierw.ok  
        Working...
        X