PDA

View Full Version : Coding the Active Boundaries indicator



acepsut
08-01-2014, 08:35 AM
I have read chapter two "Price and value" a lot of times, and the expectation concept it is clear to me, the idea is very well explained and I found it very interesting.

I would like to code it and I wonder if there is someone so kind to help me in how to proceed step by step: other than the book, I have searched through this forum and in the archive section too, and I found some info.

The basis of the AB is clear, it is the average gain or loss of the last x million traded shares. But how to face the coding process?

Let's suppose I have, in example, 1 minute data for the last 200 trading days of the stock Y.

1) I have to find the TotalFloat, and this info is always known since is a public stock information, let's suppose TotalFlow = 100 million shares
2) Subtract shares held from institutional or locked shares from this amount, i.e.20 millions so our float is now 80 million shares
3) Ok now I have my 200 days 1 minute data and I can start building the Active Boundaries starting from 80 million fixed shares.

How to proceed?

My idea: starting with first data (the older one), I should find a window of rows where the total volume is <= 80 millions.

Inside this window, for each closing price (i.e., for every minute), I should calculate the profit or loss compared to the last closing value.

I am not sure if this is the right way to calculate the AB, so any help or suggestions are really very much appreciated.

Thanks all

Alberto

Pascal
08-01-2014, 09:27 AM
AB is a very straightforward calculation, as far as you have the ActiveFloat right.

If your activeFloat is 80M shares, then what you need to do is calculate the average price of the past 80M shares that have been traded and compare it to the price of the final minute of trading. That will be in percentage the average gain of shareholders measured at the final trading minute.

Then, you go back one minute and do the same for the past 80M shares. In reality, there are only a few shares that are trading at a different price. You need to compute the small chnage and then go down one minute, for the last 6 months. That makes a lot of calculation, but the coding takes only a few lines.



Pascal

acepsut
08-01-2014, 01:35 PM
So, if I understood correctly, here is an example:

I have set the Active Float to 4 millions: the red rectangle hold the minutes so that its total volume is <= 4 millions.

Calculate the average close price (1.3415) and then compared this average price with the latest close price (1.341).

The result is -0.0348%. Is this process correct?

Or should I have to calculate for every single close price inside this 4 millions rectangle and compare to the latest close price, and then take the average?

25271

Thanks

Alberto

acepsut
08-04-2014, 12:36 PM
Is there anyone that has been able to properly code the Active Boundaries Indicator?

I am not sure if my previous example is correct, is there anyone willing to help?

Thanks.

Pascal
08-05-2014, 01:22 AM
I think that what you are asking is technically too difficult for non-developers to come up with an easy response.
The AB calculation is similar to a VWAP calculation. A VWAP uses the Volume to calculate the average price. (Volume weighted Average price.) AB also needs to use the number of shares that were exchanges at each price level: this is also a volume weighted average price and not a simple average price.

Below is the minute data for the company X and the Active Boundaries graph as of last night.
The best is that you try your different ideas and see which comes close to the pattern below.
The, the answer will be obvious.


Pascal

25307

acepsut
08-05-2014, 03:10 AM
Pascal,

thank you very much for your support. The txt file and the plotted AB is what I need in order to have a reference for my developement.

I will study the WVAP in details and will try to code the AB.

Regards,

Alberto

acepsut
08-25-2014, 10:14 AM
I think that what you are asking is technically too difficult for non-developers to come up with an easy response.
The AB calculation is similar to a VWAP calculation. A VWAP uses the Volume to calculate the average price. (Volume weighted Average price.) AB also needs to use the number of shares that were exchanges at each price level: this is also a volume weighted average price and not a simple average price.

Below is the minute data for the company X and the Active Boundaries graph as of last night.
The best is that you try your different ideas and see which comes close to the pattern below.
The, the answer will be obvious.


Pascal

25307


Hi Pascal,

I am working in coding the Active Boundaries, and in order to accomplish it as more correct as possible, I am asking if it is possibile to have the output of the Active Boundaries for the X company as from your previous graph.

This would help a lot.

Thanks

acepsut
09-03-2014, 06:01 AM
It seems I have been succesfull with my Java implementation for the Active Boundaries indicator

25679


Although your result it is smoother than mine (do you smooth the AB with EMA or any other filter?), the overall path seems quite similar


25680

I am using the second method you propose at pag.110

Thanks

Harry
09-03-2014, 07:11 AM
Congrats acepsut!

Harry

acepsut
09-03-2014, 07:28 AM
Congrats acepsut!

Harry

Thanks Harry.

Pascal
09-03-2014, 07:49 AM
Looks good indeed.
I filter with a 3MA. Looks better that way.


Pascal

acepsut
09-03-2014, 10:01 AM
Looks good indeed.
I filter with a 3MA. Looks better that way.


Pascal

Thanks, I will try to filter with a 3 period MA.

As a test, I have also added the Bollinger Bands: below are some entry signals based on the BB (50, 2.5).

25689

jagin
09-28-2015, 01:41 AM
Hi Pascal,

i'm also working on the indicators from your excelent book 'Value In Time'. Would be possible to get a picture of Effective Volume of minute data for the company X for the comparison purpose. I would be very greatfull.

Thanks

Jarek


I think that what you are asking is technically too difficult for non-developers to come up with an easy response.
The AB calculation is similar to a VWAP calculation. A VWAP uses the Volume to calculate the average price. (Volume weighted Average price.) AB also needs to use the number of shares that were exchanges at each price level: this is also a volume weighted average price and not a simple average price.

Below is the minute data for the company X and the Active Boundaries graph as of last night.
The best is that you try your different ideas and see which comes close to the pattern below.
The, the answer will be obvious.


Pascal

25307

Pascal
09-28-2015, 07:39 AM
Here it is


Pascal

32373

jagin
09-28-2015, 08:15 AM
Thanks a lot!

Even though I was able to download only last 15 days from Yahoo finance it looks good.
I'm trying to test your indicators on Polish market and have no full access to minute bars of the US stocks.
I would be double glad :) if you would attach the last 40days data of X to be sure :)

Regards

Jarek


Here it is


Pascal

32373

Pascal
09-29-2015, 08:46 AM
Thanks a lot!

Even though I was able to download only last 15 days from Yahoo finance it looks good.
I'm trying to test your indicators on Polish market and have no full access to minute bars of the US stocks.
I would be double glad :) if you would attach the last 40days data of X to be sure :)

Regards

Jarek

here is the "X" data

Pascal

32396

jagin
09-29-2015, 12:27 PM
here is the "X" data

Pascal

32396

Double thanks Pascal :)
My indicator looks good all the way.

Regards

Jarek

rupiter
02-16-2016, 03:56 AM
Thank you, Mr. Pascal Willain for explanation. Here is what I got (I made calculation of Active Boundaries using Python, and imported the result into Amibroker).

Pascal
02-16-2016, 11:19 AM
Thank you, Mr. Pascal Willain for explanation. Here is what I got (I made calculation of Active Boundaries using Python, and imported the result into Amibroker).

Congratulations!

I hope that this will help your trading. Active Boundaries are a valuation tool. This tool works well if used in a wider range of tools that can measure the trading ecosystem. This is at least what I try to do.


Pascal

rupiter
02-18-2016, 03:22 AM
Congratulations!

I hope that this will help your trading. Active Boundaries are a valuation tool. This tool works well if used in a wider range of tools that can measure the trading ecosystem. This is at least what I try to do.

Pascal

Thank you! That’s what I’m trying to do now. My current task is figuring out Effective Volume formula.
The data file you provided in the post # 16 was of a great help. Actually I had little problem with EV itself but have some difficulties with understanding how Separation Volume was chosen. Can you help me clear the situation?

I did everything according to textbook.

For example, let’s have a look at one-day period on 06.08.2015. Total EV for that day was 5925757 shares. There were 353 trading minutes where EV was detected. Thus Separation Volume according to Average Separation Method would be 5925757 / 353 = 16787 shares. (I calculated it just for comparison).

To determine Separation Volume with Equi-Power Separation Method, I first arranged EV data in descending order and started to count running total until it was close to half of EV amount of that day (5925757 / 2 = 2962879 shares). On value of 24939 the running total was 2962810 which was pretty close to the goal. So I would say that Separation Volume should be some value between 24939 and next lower value in a row (which is 24631.38605). I chose 24938 as Separation Volume value.

34671

Then I compared my SVS / LVS with those values in the data file. As you can see on the picture at 10:01:00 EV was lower than my Separation Volume value so this EV should have been added to your SVS running total. But as it’s shown on the screenshot, that value was added to your LVS (to be precise, it was subtracted, because it was negative value).

34670

Tweaking the values, I found out that Separate Volume that was chosen by you, was something between 23546 and 23120.625. But it means that the pool of shares of the Large Effective Volume is bigger than the one of Small Effective Volume… Analyzing other minutes I saw similar situation – chosen Separation Volume value divided all shares unequally.

Why is that? Or maybe I missed something and my calculations are somewhere wrong? Thank you.

Pascal
02-18-2016, 04:55 AM
Yes, you are right. In my calculations, I am using SEV = 0.9 LEV. That way, I collect slightly more shares on the LEV side. The difference is not fundamental though. Both methods would give about similar results.

I tweaked the formula after the book was published.



Pascal

rupiter
02-19-2016, 01:30 AM
Yes, you are right. In my calculations, I am using SEV = 0.9 LEV. That way, I collect slightly more shares on the LEV side. The difference is not fundamental though. Both methods would give about similar results.

I tweaked the formula after the book was published.



Pascal

Thanks for the explanation! I guess now I'm fully ready to program the algorithms and experiment with real data.

Michael

John Snow
08-30-2016, 01:57 AM
Hi Pascal,

i'm also working on the indicators from your excelent book 'Value In Time'. Would be possible to get a picture of Effective Volume of minute data for the company X for the comparison purpose. I would be very greatfull.

Thanks

Jarek

do you have the codes for all the indicators yet(LEV , Active Boundaries)?

soleimani
01-18-2019, 04:44 PM
here is the "X" data

Pascal

32396

Dear Mr. Pascal,

In following column the effective value is calculated as 0 but as i calculate base on formula it shall be -216,082 it there any exception?

Date time Open High Low Close Vol Eff Vol

9/11/2015 16:00:00 14.14 14.15 14.09 14.11 432163 0

Regards,
Soleimani

Pascal
01-21-2019, 07:18 AM
Dear Mr. Pascal,

In following column the effective value is calculated as 0 but as i calculate base on formula it shall be -216,082 it there any exception?

Date time Open High Low Close Vol Eff Vol

9/11/2015 16:00:00 14.14 14.15 14.09 14.11 432163 0

Regards,
Soleimani

It is because I have set an option that filters out large one minute volume as "block trades"
I believe that I set the filter at 5%, but it could be 3%.

Pascal

soleimani
01-23-2019, 06:13 AM
It is because I have set an option that filters out large one minute volume as "block trades"
I believe that I set the filter at 5%, but it could be 3%.

Pascal

thanks a lot,
3% of that day volume?

Pascal
01-23-2019, 10:32 AM
thanks a lot,
3% of that day volume?

I checked and it is 5% of the day volume!
For the RT Effective Volume, of course the volume used for the 5% cut-off calculation is the trading volume upto calculation time.


Pascal