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

BuySellVolume Bid/Ask Data not Plotting - NT8.0.15.1

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

    BuySellVolume Bid/Ask Data not Plotting - NT8.0.15.1

    Dear Support,

    The Bid/Ask volume is used for default BuySellVolume indicator. If I am correct, Ninja saves Bid/Ask data that is supposed to be available for the indicator to use. However, when this indicator is applied, the Buy Sell Volume begins to plot at the current bar and progresses afterward.

    Now if the chart is modified (adding another indicator, changing time frame, etc.) the BuySellVolume indicator starts from the current time again and the history is lost. Is this normal?

    I recall, for Gom indicators we needed to record bid/ask data during the session so that the bid/ask data was available to plot. But with the NT8 recording is not needed. So why the bid/ask data is lost once a chart is modified?

    Thanks.
    Last edited by aligator; 08-13-2018, 12:11 PM.

    #2
    Hello aligator,

    Thank you for your note.

    It is expected that changing the instrument would cause the history to be lost.
    The reason for this is that the BuySellVolume indicator counts the buy/sell volume in OnMarketData and saves it to a variable. Values are not built from historical Bid/Ask series and thus only works in real time. Changing the series would reset the buys and sells variables and the data would be lost.

    It’s possible to build a version of this indicator which pulls Bid/Ask historical data series so that it would work on instrument change. You would want to see the following section of the helpguide for adding bid/ask historical data series.



    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thank you Alan,

      But I am not changing the instrument, just adding another price indicator to the chart. Why that should affect the Buy Sell Volume.

      However, I can understand that in Ninja once a change is made to a chart all indicators will be reloaded, a logic that does not seem to be necessary if the instrument is not changed.

      p.s. Is it possible to use a combination of live and historical bid/ask data with a switch at the current bar?

      Thanks.

      Originally posted by NinjaTrader_AlanP View Post
      Hello aligator,

      Thank you for your note.

      It is expected that changing the instrument would cause the history to be lost.
      The reason for this is that the BuySellVolume indicator counts the buy/sell volume in OnMarketData and saves it to a variable. Values are not built from historical Bid/Ask series and thus only works in real time. Changing the series would reset the buys and sells variables and the data would be lost.

      It’s possible to build a version of this indicator which pulls Bid/Ask historical data series so that it would work on instrument change. You would want to see the following section of the helpguide for adding bid/ask historical data series.



      Please let us know if you need further assistance.
      Last edited by aligator; 08-13-2018, 12:26 PM.

      Comment


        #4
        Hello aligator,

        Your understanding is correct, a change would reload all indicators. I will put in a feature request that adding an indicator to a chart does not reload all other indicators.

        Yes it would be possible to modify the indicator so that it would use historical bid/ask series for historical values, and then use OnMarketData to calculate realtime values, although you could probably just use the bid ask added data series for both realtime and historical.

        You would need 2 AddDataSeries calls, one for the bid series and 1 for the ask, see


        You would also need to use the State object to differentiate between real time and historical,


        Below would be a framework you could use in OnBarUpdate,

        Code:
        if (State == State.Historical)
        {
        //Use Historical Bid/Ask Series
        }
        if (State == State.Realtime)
        {
        //Use OnMarketData
        }
        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by BarzTrading, Today, 07:25 AM
        2 responses
        20 views
        1 like
        Last Post BarzTrading  
        Started by devatechnologies, 04-14-2024, 02:58 PM
        3 responses
        20 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by tkaboris, Today, 08:01 AM
        0 responses
        4 views
        0 likes
        Last Post tkaboris  
        Started by EB Worx, 04-04-2023, 02:34 AM
        7 responses
        163 views
        0 likes
        Last Post VFI26
        by VFI26
         
        Started by Mizzouman1, Today, 07:35 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X