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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        144 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        71 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        125 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        79 views
        0 likes
        Last Post PaulMohn  
        Working...
        X