Jump to content
Medved Trader Forums

Recommended Posts

  I think I looked for this a while back and could not find it.

  I'd like a script to be able to access the current  bid/ask size.   Can we currently do this?

 

Share this post


Link to post
Share on other sites

I never exposed that data to the scripts, mostly because not all data sources supply it and when/if they do, it is often not that accurate...

 

Share this post


Link to post
Share on other sites

hmmm. I can tell you IB is accurate, though amtd only shows the primary exchange, stupidly.   I'm not aware of any source that doesn't  supply b/a,

 

If possible, I'd like to have access to the b/a , hopefully its not a big deal to add that .

Share this post


Link to post
Share on other sites

Bid size working well.

 

Wondering how I would be able to track CHANGES in size over time.  Is that possible ?

Probably have to set up an array and do a compare is my guess, but could use some guidance.

Edited by stock777

Share this post


Link to post
Share on other sites

Changes in size are way too chaotic/frequent. You'd have to save it on every tick, not on every candle - and that's a lot of data.

You know how you have a FIFOQueue? I recently added a TimedQueue. Instead of saving N values, it stores N seconds' worth of values - each value (internally) has a timestamp and it gets removed as it goes out of the time scope. As it is now, you don't get to set the timestamp of the value, it gets set to the current system time at the time you're adding it.

This would allow you to store let's say 60 seconds minutes worth of bid/ask sizes and be able to analyze them.

Note that unlike FIFOQueue, you would not need to save/restore it as a state variable. Just keep adding the new values to it.

 

Share this post


Link to post
Share on other sites

This would be quite valuable. With every executed order that prints if we could pull the bid and ask and store it to say, measure how much the spread fluctuates over a given time frame... You could create an indicator to measure spread volatility. Might provide some really good insight into how dangerous a particular stock would be to trade.

Edited by Jason

Share this post


Link to post
Share on other sites

dealing with spreads is not a problem - bid/ask are stored. what isn't stored is the bid/ask size. That isn't likely to change

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×