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

volume question

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

    volume question

    Could someone please explain the difference between var1[0] and var2[0]? Will the values be the same?

    Thank you.

    var1[0] = Volume[0];

    var2[0] = GetCurrentAskVolume() + GetCurrentBidVolume();

    #2
    Hello imalil,

    Thanks for writing in to our Support team.

    These values will not be the same - Volume[0] retrieves the volume of the current bar which is equal to the number of shares traded during the interval defined for that bar. For instance, the Volume[0] value of a 60 minute bar would be much greater than the Volume[0] value of a 1 minute bar.

    GetCurrentAskVolume() and GetCurrentBidVolume() retrieve the volume of contracts being traded at the ask/bid price, and this is independent of the interval you are viewing the data series on.

    You can view more information in our help guide here:

    Volume[0] - http://ninjatrader.com/support/helpG...ies_volume.htm
    VOL() - http://ninjatrader.com/support/helpG...-us/volume.htm
    GetCurrentAskVolume() - http://ninjatrader.com/support/helpG...taskvolume.htm
    GetCurrentBidVolume() - http://ninjatrader.com/support/helpG...tbidvolume.htm

    Please let me know if I may be of any further assistance.
    Alan S.NinjaTrader Customer Service

    Comment


      #3
      One more point of clarification:

      If I'm using calcOnBarClose, is the GetCurrentAskVolume() that I see only the ask vol during the last tick of the most recent bar? So if I want to see all the ask vols from the beginning of the bar in order to add them up I have to run a script for that?

      Thank you.

      Comment


        #4
        Hello imalil,

        Thanks for your reply.

        The volume retrieved when calling GetCurrentAskVolume() and setting CalculateOnBarClose to true will be whatever the ask volume is at the close of the bar - or whatever the ask volume was for the last recorded tick of the bar. If you would want to add each ask volume value you would have to save those values to a variable and update the value on each tick - alternatively you could look at the Volume[0] which will report the total volume of contracts traded.

        Please let me know if I may be of any further assistance.
        Alan S.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cls71, Today, 04:45 AM
        0 responses
        1 view
        0 likes
        Last Post cls71
        by cls71
         
        Started by mjairg, 07-20-2023, 11:57 PM
        3 responses
        213 views
        1 like
        Last Post PaulMohn  
        Started by TheWhiteDragon, 01-21-2019, 12:44 PM
        4 responses
        544 views
        0 likes
        Last Post PaulMohn  
        Started by GLFX005, Today, 03:23 AM
        0 responses
        3 views
        0 likes
        Last Post GLFX005
        by GLFX005
         
        Started by XXtrader, Yesterday, 11:30 PM
        2 responses
        12 views
        0 likes
        Last Post XXtrader  
        Working...
        X