Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How do I get price data into my indicator?

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

    How do I get price data into my indicator?

    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Gui;
    using NinjaTrader.Gui.Chart;
    using NinjaTrader.Gui.SuperDom;
    using NinjaTrader.Data;
    using NinjaTrader.NinjaScript;
    using NinjaTrader.Core.FloatingPoint;
    using NinjaTrader.NinjaScript.DrawingTools;
    These are my declarations.
    How am I able to access price data in my indicator?
    Example: close, bid, ask, median, etc

    #2
    Hello ezrollin,

    Thank you for your post.

    When an indicator is applied to a chart, the data series of that chart is automatically subscribed to as the primary series for the indicator. Price data for that series can be accessed by using the various price series:

    https://ninjatrader.com/support/help...indicators.htm

    https://ninjatrader.com/support/help...ice_series.htm

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

    Comment


      #3
      I'm not able to compile. I'm getting a "The name "close" does not exist in the current context"

      Comment


        #4
        Hello ezrollin,

        Thank you for your reply.

        If you're not capitalizing the C in Close that's an issue - these are case sensitive. You'll also need a bar index to access the close price of specific bars. Close[0] would return the close price of the current bar.

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        57 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        78 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        41 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        101 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        61 views
        0 likes
        Last Post PaulMohn  
        Working...
        X