Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom Instument

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

    Custom Instument

    Hi

    I wish to create a chart with a Custom Instument to give me the p/e ratio of the sp500 index. The problem is I need to put in a static number, presently around $250.00, to use in the instument and then "pair" it with the sp500 index to give me the ratio. I don't know how to do this. Can anyone help ?

    Thanks

    David.​​

    #2
    Hello David,

    A custom instrument would not allow you calculate data. Instrument data has to come directly from the connected data provider.

    Instead, I recommend you create an indicator.

    Below are links to indicators in the User App Share that calculate a value from an underlying instrument.
    NYSE Advancing Issues/Declining Issues Uses historical tick data to calculate the ^ADV index minus the ^DECL index to give a simulation of the ^ADD index. Requires a data feed that supports indexes and provides data for the ^ADV (NYSE Advancing Issues) and ^DECL (NYSE Declining Issues). Update June 16th, 2020 – Corrected stroke attributes to […]

    HeikenAshi technique discussed in the article ‘Using Heiken-Ashi Technique’ in February 2004 issue of TASC magazine. NinjaTrader 8 natively provides Heiken Ashi as a bar type for most common bar types (minute, tick, volume, second, day, week, month, year). This Heiken Ashi indicator is provided for the Range, Renko and any custom bar types that […]

    Plots the Spread of two instruments The first instrument is the primary chart data series. The secondary instrument is specified by the parameter "Symbol2". The Parameters "Qty1" and "Qty2" are multipliers which are applied to each instrument's price before adding the two; default values are "Qty1=1" and "Qty2=‐1" which will simply plot the difference between […]

    This is a conversion of the Spread Indicator with Candlesticks. Please contact the original author for any questions or comments.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi

      Thanks, but how do I get a static number into these ?

      David.

      Comment


        #4
        Hello David,

        You could hardcode the value into the script code.
        You could make an input and type in a value.
        You could read a value from a text file.
        You could calculate a value..

        How do you want to put the value in?

        As an example of an input:

        [NinjaScriptProperty]
        [Display(Name = "My Static Number")]
        public double MyStaticNumber
        { get; set; }
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi,

          Sorry, I don't know coding. I just would like to be able to input into a box, the static number, and pair it(ratio) with an instrument, in this case the SP500, and have it create an instrument (or indicator) I can chart in Ninja as any other instrument.

          Thanks,

          David​

          Comment


            #6
            Hello David,

            Unfortunately, this would not be possible without creating an indicator to do so.

            The spread indicator I've provided a link to allows for a multiplier on one of the instruments if this helps.

            You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            557 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            324 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            545 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            547 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X