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

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.
    Kate W.NinjaTrader Customer Service

    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.
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by marcus2300, Today, 10:21 AM
        1 response
        1 view
        0 likes
        Last Post marcus2300  
        Started by DawnTreader, 05-08-2024, 05:58 PM
        10 responses
        38 views
        0 likes
        Last Post DawnTreader  
        Started by gaz0001, Today, 10:09 AM
        0 responses
        2 views
        0 likes
        Last Post gaz0001
        by gaz0001
         
        Started by proptradingshop, Today, 10:07 AM
        0 responses
        3 views
        0 likes
        Last Post proptradingshop  
        Started by franatas, Today, 09:49 AM
        1 response
        2 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X