Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to Reference a Previous Ask

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

    How to Reference a Previous Ask

    Hi,

    I'm pretty new to NT, and I was having a hard time trying to reference a previous ask price.

    For instance, I would like to know the difference between the ask price 20 bars ago versus the current ask price.

    Can someone assist me with this?

    #2
    Hello kdixon,

    Thank you for your note.

    You would need to add an underlying data series that is using ask price so that you can compare the ask price of now to 20 bars ago.

    In Initialize() -
    Code:
    Add("ES 06-15", PeriodType.Minute, 1, MarketDataType.Ask);
    http://www.ninjatrader.com/support/h..._ask_serie.htm


    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Okay excellent.

      So if I wanted to know the difference between an ask price 20 bars ago and the current ask price I could write something like:

      Math.Abs(Add("ES 06-15", PeriodType.Minute, 20, MarketDataType.Ask) - GetCurrentAsk());

      Would that be correct?

      Comment


        #4
        kdixon,

        No, the Add() will add an underlying data series in which you can access the data for this like using Close[0] but will use Closes[1][0] instead. This will be used in the Initialize() method.

        The Ask data will build like a candlestick just like your primary bar series.

        http://www.ninjatrader.com/support/h...nstruments.htm
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        4 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        12 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Yesterday, 07:51 PM
        0 responses
        13 views
        0 likes
        Last Post strategist007  
        Started by StockTrader88, 03-06-2021, 08:58 AM
        44 responses
        3,982 views
        3 likes
        Last Post jhudas88  
        Working...
        X