Login Page - Create Account

Support Board


Date/Time: Thu, 28 Nov 2024 06:50:25 +0000



[Programming Help] - how to see total bid and ask volume for each price of a candle

View Count: 764

[2023-05-29 17:54:12]
af_99 - Posts: 22
Hi,

Let's say I have 5 minutes bars and I want to have, in the spreadsheetstudy (no matter how), the total bid volume and total ask volume (separated, not total both together) for each price that the candle has reached. For example, let's say the candle went from 200 to 201 price, then I'd like to have total bid and total ask for 200.25, 200.50, 200.75 and finally 201. Do you think of any way to achieve it? If I mark the "Output Volume at Price Data" option in the spreadsheet study settings, it gives me the volume but all together, not split into bid and ask.

I have been thinking in lot of ways to try to do that but can´t find any valid solution...

Thank you very much in advance.
Date Time Of Last Edit: 2023-05-29 17:55:54
[2023-05-30 02:30:51]
j4ytr4der_ - Posts: 938
Look at the Numbers Bars Calculated Values study. It provides two subgraphs, SG4 and SG5, Positive Delta Sum and Negative Delta Sum. I think that's what you're looking for.
[2023-05-30 15:11:34]
af_99 - Posts: 22
Thank you j4ytr4der_ but those values give you the sum (cummulative) values for the whole candle, and I need them split into the different price levels (200.25, 200.50,...) that the 5min candle as reached, not all together.

Any ideas?

Thanks
[2023-05-30 15:35:46]
j4ytr4der_ - Posts: 938
Ahhh ok you want delta at price. I don't believe there is any way to get that in a spreadsheet without a custom study to expose the data the way you would want.

I do this on a much smaller scale using Spreadsheet Formulas (the study, not a spreadsheet) and AVAP minus BVAP.
[2023-05-30 15:56:18]
af_99 - Posts: 22
Thank you j4ytr4der.

I do this on a much smaller scale using Spreadsheet Formulas (the study, not a spreadsheet) and AVAP minus BVAP.

Could you explain me in more details this please?? I'm really interested.
[2023-05-30 16:17:17]
j4ytr4der_ - Posts: 938
Sure thing.

There are two functions, AVAP and BVAP (also just VAP), that return the Ask Volume at Price, and Bid Volume at Price. You can read about them here:

Study/Chart Alerts And Scanning: VAP

The way I'm using them is to look at the VAP Delta at current price, and also a tick or two off price. So like:

AVAP(C - (TICKSIZE * 2),0) - BVAP(C - (TICKSIZE * 2),0)

or

AVAP(C - TICKSIZE,0) - BVAP(C - TICKSIZE,0)

In these examples first I'm looking at the delta 2 ticks below price, and the delta 1 tick below. You can alter the formulas of course to get the delta for any price level, relative to current price, or the high or low, etc.

Note that these don't work in a spreadsheet, they only work in the Spreadsheet Formula study.

By sheer coincidence, I'm leading a free class this weekend and this is a critical component of what I'll be talking about. You might want to check it out.

Register for free at: https://trgp.nl/49n
Date Time Of Last Edit: 2023-05-30 16:18:18
[2023-05-30 16:30:41]
af_99 - Posts: 22
That's very useful j4ytr4der_. Thank you very much.

By the way, you said "these don't work in a spreadsheet", but what if I use a Spreadsheet Formula study and then I check the box "Include in Spreadsheet" in Subgraphs tab inside the Spreadsheet Formula study? That will work, isn´t it?
[2023-05-30 17:43:20]
j4ytr4der_ - Posts: 938
Yes, the Spreadsheet Formula result is accessible in the spreadsheet, you just can't use AVAP or BVAP themselves, directly in the sheet. I wish you could but... such is life.
[2023-06-01 18:27:55]
af_99 - Posts: 22
Thank you very much j4tr4der_

Last question... do you think is possible to have the same approach with AVAP and BVAP but taking only into account trades of a volume >=20 ?? I mean, now if you use AVAP at 201.50 for example, it will give you the total ask volume at price 201.50. But... could that volume be the sum of the volume but only for trades with volumen >=20?? (I'm trying to take into account just strong hands in the market).

Thank you.
[2023-06-01 21:10:24]
j4ytr4der_ - Posts: 938
I'm sure it's possible but that would be arbitrary. Why 20 and not 30? 50? 100? 5? You set it to 20 and you miss the trader who splits their 100 lot into chunks of 10... etc. Rather than order size, I'm more interested in total delta at price, and from that I can tell if it's passive limit orders, or aggressive market orders, and by combining that with an overall directional bias, correlation, etc. then I know which way I should be looking to trade and can plan accordingly.

It sounds like you're thinking the right way in general. I think you might really enjoy my talk on Saturday, try to make it if you can. Or just register even if you can't since it will be recorded.
[2023-06-02 08:06:49]
af_99 - Posts: 22
It sounds like you're thinking the right way in general. I think you might really enjoy my talk on Saturday, try to make it if you can. Or just register even if you can't since it will be recorded.
Done.

Actually I agree with you in everything... just one thing I don´t undersand:

I'm more interested in total delta at price, and from that I can tell if it's passive limit orders, or aggressive market orders
total delta at price only reflects aggresive buyers/sellers, isn´t it? How do you know then if they are "passive limit orders"? You have to use DOM to do that, isn´t it?

On the other hand, don´t you think it's more interesting to measure delta in diagonal bid/size and not in the same price point? I mean, the difference between bid in a price level and ask in the same price level+1tick, better than the difference between bid and ask at the same price level.

Really interested in your opinion. DM if you don´t want to explain here :)
Date Time Of Last Edit: 2023-06-02 08:08:35
[2023-06-02 10:56:19]
Dean Roberts - Posts: 79
Hi Guys

j4ytr4der - I've signed up for tomorrow. I was a member of the pit previously.

Do you know if it is possible to combine a calculation in a 'Trading System Based on Alert Condition' with a trigger entry level using a band added to a level...

So, am using a crossfrombelow/above to create a buy/sell when a band placed 12 ticks away from a VWAP line. Could I have a check on there to say if BVAP<>AVAP by a particular percentage then enter the trade?

i.e. =AND(CROSSFROMABOVE(L,IDvwap+12ticks), BVAP>=AVWP*1.5) - I'm terrible at code so I'm sure that is wrong but I am trying to enter a buy order if candle low crosses the band I have added to VWAP (12ticks in this case) and Bid volume is above Ask volume by 150% of Ask volum.

Hope that makes sense

Looking forward to the webinar Jay.

Cad
[2023-06-03 21:12:12]
j4ytr4der_ - Posts: 938
Sorry just saw this message.

You are right that you only see aggressive buyers/sellers via delta. Now, ask yourself the following question:

Who sold to or bought from them?

=)

In general almost anything is possible somehow. I personally don't like crossfromabove or below however, because they are about the BAR and not PRICE. As long as the BAR has gone above the level, then it will register as true for crossfromabove, for example. It's not "when price crosses above".

But yes you can certainly check what the volume at price a certain distance away from current price is, and act accordingly. It would take a little bit of basic math to work it out and turn it into a formula to compare against, but I don't see why it would be all that difficult to do.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account