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 lightsun47, Today, 03:51 PM
        0 responses
        5 views
        0 likes
        Last Post lightsun47  
        Started by 00nevest, Today, 02:27 PM
        1 response
        10 views
        0 likes
        Last Post 00nevest  
        Started by futtrader, 04-21-2024, 01:50 AM
        4 responses
        46 views
        0 likes
        Last Post futtrader  
        Started by Option Whisperer, Today, 09:55 AM
        1 response
        14 views
        0 likes
        Last Post bltdavid  
        Started by port119, Today, 02:43 PM
        0 responses
        10 views
        0 likes
        Last Post port119
        by port119
         
        Working...
        X