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

GetCurrentBid vs GetCurrentAsk on T&S AND OTHER

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

    GetCurrentBid vs GetCurrentAsk on T&S AND OTHER

    I creaated an indecator for searching blocks realtime but i am confused in one area

    I have getgetcurrentbid and get current ask but sometimes it is neither, what are the other volume criteria. ?

    #2
    Hello ballboy11,
    Thanks for your post.

    What do you mean by "sometimes it is neither"? Are you not getting values for those methods in some cases?

    There is also no volume criteria for these methods that I am aware of. Even when volume is low there should be a current ask/bid price.

    I look forward to your reply.
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Basically i check if the block volume is greater than my parameter then i do this condition. the weird thing i thought it would only give ask or bid but sometimes it gives neigher and i have to print just volume. check the picture below



      if(Close[0] == GetCurrentBid())

      {
      // print bid volume
      }
      else
      if(Close[0] == GetCurrentAsk())

      {
      // .print ask volume
      }

      else
      {

      // print volume
      }
      Attached Files
      Last edited by ballboy11; 04-11-2018, 10:05 AM.

      Comment


        #4
        Hello ballboy11,

        What Calculate setting are you using?

        I would not expect you to see this if you are using OnEachTick.

        I look forward to your reply.
        Josh G.NinjaTrader Customer Service

        Comment


          #5
          Yes I am on Each tick that is the weird thing.

          Comment


            #6
            I see the same thing. I think what's happening is Ask/Bid is changing in between getting a Last price. You may be able to compare these values more accurately by storing them as variables.

            I also recommend take a look at the code for the NinjaTrader built-in VolumeProfiles indicator. It uses sorted dictionaries to accomplish what I think you are looking for.
            Josh G.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            44 views
            0 likes
            Last Post jeronymite  
            Started by Barry Milan, Yesterday, 10:35 PM
            7 responses
            20 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by AttiM, 02-14-2024, 05:20 PM
            10 responses
            179 views
            0 likes
            Last Post jeronymite  
            Started by ghoul, Today, 06:02 PM
            0 responses
            9 views
            0 likes
            Last Post ghoul
            by ghoul
             
            Started by DanielSanMartin, Yesterday, 02:37 PM
            2 responses
            13 views
            0 likes
            Last Post DanielSanMartin  
            Working...
            X