Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Chart the Ratio of two instruments

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

    Chart the Ratio of two instruments

    Hello,

    Has anyone developed ninja script that can produce a single chart that plots the result of two instruments, one divided by the other?

    Example Platinum / Gold ratio or the Gold / Silver ratio

    Thanks
    Frank

    #2
    Hello Trader_Frank,

    Thank you for your post.

    Unfortunately, I am not aware of a NinjaScript that plots the result of two instruments divided by one another. Something you could do is modify a Swing indicator from the NinjaTrader Ecosystem User App Share center to accomplish this.

    User App Share center - https://ninjatraderecosystem.com/user-app-share

    Please note that dynamically adding a data series is not fully supported and there would be limitations with Optimizations specifically. If issues are seen, we suggest hardcoding the data series as a first step.

    See the help guide documentation below for more information about adding a data series.
    AddDataSeries() - https://ninjatrader.com/support/help...dataseries.htm

    Let us know if we may assist further

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

    Comment


      #3
      Cheers Brandon, will give it a try.

      Comment


        #4
        I did that one - here's a submission from me!
        Attached Files

        Comment


          #5
          Originally posted by catinabag View Post
          I did that one - here's a submission from me!
          Hello

          I tried to open and use the indicator 'Ratio_two_symbols' but it doesn't plot anything

          Does it need any special input? Could you please upload a capture to see how it plots the ratio in a chart

          Thank you

          Comment


            #6
            hi, sorry for my late response! there are 2 things which may be affecting the chart's ability to calculate:


            #1. the key thing is to ensure the two securities whose ratio you are calculating [eg, SPY / QQQ] are compatible with the chart's timeframe

            for example:

            if your underlying chart is ES [which trades a longer time period than stocks] and you're calculating SPY / QQQ, you won't get any output. set the ES to "US Equities RTH" and it will work.


            #2. furthermore, there is a "Parameter" when you click the "Indicators" section and see this indicator. The parameter is called "Period." Period must be set to the same number of minutes as the chart.

            for example:

            if your underlying chart is 5 minutes, Period must be 5.

            or

            if your underlying chart is daily, Period should be 1440.

            just holler if this still does not work for you. i will check back on this. i hope this helped somewhat!

            Comment


              #7
              hey, catinabang, do you know why the indicator doesnt react to colour changes. it is just red when I use it, but I'd prefer to change the colour to use multiple ratios in the same chart.

              thank you for the addition, too, it has been extemely helpful.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by GussJ, 03-04-2020, 03:11 PM
              15 responses
              3,271 views
              0 likes
              Last Post xiinteractive  
              Started by Tim-c, Today, 02:10 PM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by Taddypole, Today, 02:47 PM
              0 responses
              2 views
              0 likes
              Last Post Taddypole  
              Started by chbruno, 04-24-2024, 04:10 PM
              4 responses
              51 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Started by TraderG23, 12-08-2023, 07:56 AM
              10 responses
              403 views
              1 like
              Last Post beobast
              by beobast
               
              Working...
              X