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

Historical bid/ask spread for Tick Replay

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

    Historical bid/ask spread for Tick Replay

    I need to get average spread (bid/ask) of last 5min for a strategy that's running on TickReplay.

    How can that be done? Could share an example snippet?

    Your doc says following would give past bidAsk, but cannot be used for TickReplay type. What would happen if one tries to access Ask series during tick replay?

    eg. AddDataSeries("AAPL", BarsPeriodType.Minute, 30, MarketDataType.Ask);
    from https://ninjatrader.com/support/help...20English.html

    https://ninjatrader.com/support/help...ick_replay.htm
    Warning: A Tick Replay indicator or strategy CANNOT use a MarketDataType.Ask or MarketDataType.Bid series.
    Tick Replay was only ONLY designed to work with MarketDataType.Last. A TickReplay indicator or strategy should NOT be mixed with a MarketDataType.Ask or MarketDataType.Bid series


    #2
    Hello yubo27,

    Thanks for your post.

    As stated in the help guide link and snippet you shared, TickReplay can only be used to work with MarketDataType.Last, not MarketDataType.Ask or MarketDataType.Bid.

    You could view the BuySellVolume indicator that comes default with NinjaTrader to see how to get the Ask or Bid price from OnMarketData() when MarketDataType == MarketDataType.Last. To view the script, open a New > NinjaScript Editor window, open the Indicators folder, and double-click on the BuySellVolume indicator.

    OnMarketData(): https://ninjatrader.com/support/help...marketdata.htm

    Let me know if I may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by futtrader, Today, 01:16 PM
    0 responses
    4 views
    0 likes
    Last Post futtrader  
    Started by Segwin, 05-07-2018, 02:15 PM
    14 responses
    1,789 views
    0 likes
    Last Post aligator  
    Started by Jimmyk, 01-26-2018, 05:19 AM
    6 responses
    838 views
    0 likes
    Last Post emuns
    by emuns
     
    Started by jxs_xrj, 01-12-2020, 09:49 AM
    6 responses
    3,294 views
    1 like
    Last Post jgualdronc  
    Started by Touch-Ups, Today, 10:36 AM
    0 responses
    13 views
    0 likes
    Last Post Touch-Ups  
    Working...
    X