Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Indicator for ratio of symbol/SMA200

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

    Indicator for ratio of symbol/SMA200

    Dear All,
    I tried to search but could not find an indicator so this post.
    I request an indicator which calculates value of "Symbol/Symbol's SMA200". Currently, Ratio indicator available supports "Symbol SMA200/Symbol" which gives me inverse value :-(.
    Any help will be appreciated.

    #2
    Hello,

    Thank you for your post and welcome to the NinjaTrader forums!

    Just to clarify, the indicator you are looking for would take the following actions.

    Have a secondary data series of a different instrument added as a parameter.

    The closing price of the primary dataseries divided by the close price of the secondary dataseries would be calculated and then saved to a third custom data series.

    An SMA(200) would then be called using this third custom data series the input and this would then be plotted on the chart.

    Is this correct?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      NinjaTrader_ChelseaB,
      I am requesting following:
      1. Take Dow Jones's value which is 16,449.25 as of Apr 21, 2014.
      2. Take Dow Jones's SMA(200) which is say today 15773.69.
      3. Do 16449.25/15773.69 = 1.042

      I want 1.042 as result value in indicator.
      Now check ratio indicator available. Problem with current Ratio indicator is you can do only 15773.69/16449.25 = 0.958 NOT the other way round. I hope you got my problem.

      Comment


        #4
        Hi jigneshkakkad,

        Thanks for your patience.

        This script would be fairly simple to create.

        The important code would be:

        Value.Set( SMA(Close, 200)[0] / Close[0]);

        Attached is a example of this.
        Attached Files
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by RubenCazorla, 08-30-2022, 06:36 AM
        3 responses
        77 views
        0 likes
        Last Post PaulMohn  
        Started by f.saeidi, Yesterday, 12:14 PM
        9 responses
        23 views
        0 likes
        Last Post f.saeidi  
        Started by Tim-c, Today, 03:54 AM
        0 responses
        3 views
        0 likes
        Last Post Tim-c
        by Tim-c
         
        Started by FrancisMorro, Today, 03:24 AM
        0 responses
        5 views
        0 likes
        Last Post FrancisMorro  
        Started by Segwin, 05-07-2018, 02:15 PM
        10 responses
        1,772 views
        0 likes
        Last Post Leafcutter  
        Working...
        X