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

Indicator using GetCurrentAsk

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

    Indicator using GetCurrentAsk

    hi

    one of my indicator uses GetCurrentAsk(2) and GetCurrentAsk(1) to plot values on a chart. I've noticed that for historical values (any value that is not present.. including a second prior to adding the indicator onthe chart) the values that are actually being plotted are historical Closes rather than GetCurrentAsk. But once i've added the indicator, it starts plotting Ask values from that point forward. But If i refresh the chart, it plots closes again. Any idea why this happens and what I can do to get historical getcurrentask data? Is it because I don't have getcurrentask data saved in my data aggregator?

    #2
    Originally posted by calhawk01 View Post
    hi

    one of my indicator uses GetCurrentAsk(2) and GetCurrentAsk(1) to plot values on a chart. I've noticed that for historical values (any value that is not present.. including a second prior to adding the indicator onthe chart) the values that are actually being plotted are historical Closes rather than GetCurrentAsk. But once i've added the indicator, it starts plotting Ask values from that point forward. But If i refresh the chart, it plots closes again. Any idea why this happens and what I can do to get historical getcurrentask data? Is it because I don't have getcurrentask data saved in my data aggregator?
    That's what this method will substitute with historical data
    Ref: http://www.ninjatrader.com/support/h...currentask.htm

    Comment


      #3
      Hello,

      Calonious is correct. When you pass a bar index into GetCurrentAsk(), it will return the close price of the referenced bar. There are a few ways that you can get around this. If you are only working with your strategy in real-time, you could add a secondary data series that uses Ask prices, then use that data series for your indicator calculations.

      If you would like to backtest the strategy, then you will only have historical close data to work with. In this case, you could create a custom data series that would store ask prices in real-time, which you could then reference later for your calculations.

      Please let me know if I can assist further.
      Dave I.NinjaTrader Product Management

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by hazylizard, Today, 08:38 AM
      2 responses
      8 views
      0 likes
      Last Post hazylizard  
      Started by geddyisodin, Today, 05:20 AM
      2 responses
      18 views
      0 likes
      Last Post geddyisodin  
      Started by Max238, Today, 01:28 AM
      5 responses
      47 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by giulyko00, Yesterday, 12:03 PM
      3 responses
      13 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by habeebft, Today, 07:27 AM
      1 response
      16 views
      0 likes
      Last Post NinjaTrader_ChristopherS  
      Working...
      X