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 Barry Milan, Yesterday, 10:35 PM
        5 responses
        16 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by DanielSanMartin, Yesterday, 02:37 PM
        2 responses
        13 views
        0 likes
        Last Post DanielSanMartin  
        Started by DJ888, 04-16-2024, 06:09 PM
        4 responses
        13 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by terofs, Today, 04:18 PM
        0 responses
        12 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by nandhumca, Today, 03:41 PM
        0 responses
        8 views
        0 likes
        Last Post nandhumca  
        Working...
        X