Login Page - Create Account

Support Board


Date/Time: Wed, 08 May 2024 16:08:59 +0000



[User Discussion] - Larry Williams GSV indicator

View Count: 2923

[2018-12-02 04:59:00]
User517020 - Posts: 7
I am wondering if you could create an indicator of Larry Williams. Larry Williams introduces this as a concept in his book Long-Term Seecrets To Short-Term Trading. He calls it as a Greatest Swing Value (GSV). This value is calculated as the distance between open and high (long side) or open and low (short side). He takes the four day average of this value. But it is bit more complicated than that. For the long side he counts only the difference (high-open) for bars that close down. And for the short side he counts only the difference (high-open) for bars that close higher). If this is something you guys could add, I would really appreciate it.

In case I didn't explain that clearly enough, I've copied and pasted an explanation of the indicator from someplace else:

Consider a single day of trading in a futures market. The session will have an open, and at some stage it will make both a high and a low. So the high can be thought of as the maximum level above the open to which the bulls were able to drive price during the day, while the low represents the maximum level below the open to which the bulls were able to move the market.

Here we have a simple measure of the relative power of both buyers and sellers on that day.

The distance between the open and the high is called the ‘buy swing’.

The distance between the open and the low is called the ‘sell swing’.

Now consider the next trading day. If price moves below this day’s open by an amount greater than yesterday’s sell swing, then this indicates that we have a new amount of sellers in the marketplace today. By the same token, if price moves above the open by an amount that is greater than yesterday’s buy swing then new buying power must have entered the market.

If we take an average of all the buy swings over a previous number of days we will have an idea of the amount of buying pressure in the market over a slightly longer (and more representative) period. If price is able to move above its open by an amount that at exceeds this, then it would seem fair to assume that something has changed. Obviously the reverse will be true for sell swings.

There is one final improvement to be made before we have a useable concept. By considering sell swing values for only those days where price closed above the open (in effect the days on where the bulls ‘won’), then we will have arrived at a measure of the amount by which price could decline without triggering a sell-off. These swings represent the bear’s ‘failed’ attempts at sell-offs, and as such we call them ‘failure swings’. Similarly, we can identify buy failure swings by considering only days with a down close.

It is an average of these values that we will use in our setup.
[2018-12-05 18:50:09]
SC Support Tom - Posts: 450
I have just finished reading Chapter 8 of Williams' book, the chapter in which he describes the Greatest Swing Value. I have attempted to translate his verbal description into equations. Please see the attached file and let me know if my understanding of this indicator is correct. If so, then this will be easy for me to code.
attachmentGSV Math.pdf - Attached On 2018-12-05 18:48:39 UTC - Size: 87.17 KB - 560 views
Attachment Deleted.
[2018-12-05 19:09:30]
User517020 - Posts: 7
I apologize in advance if my math/logic is faulty, but just wanted to double check something --

In the "Buy Swing", for example, when the close is an up day, you give the result a value of O. Doesn't this affect the value of the moving average you calculate in step 2? By adding zeroes to your numerator and dividing by n days in the denominator your resulting average would be lower than if you had simply ignored any days that close up and only added the values of the down days and divided by the n of down days. (Everything reversed for "Sell Swing" of course. Does that make sense?

Otherwise, everything else looks perfect!
[2018-12-05 19:22:10]
User517020 - Posts: 7
I will reduce the above reply to fewer words:

The goal for "Buy Swing" is to only sum the (high-open) for down days and divide by the number of down days to get the average point value of an attempting "up" a down day. All up days should be ignored -- affecting neither the numerator or the denominator. (Vice versa for Sell Swing)
[2018-12-05 19:30:27]
SC Support Tom - Posts: 450

In the "Buy Swing", for example, when the close is an up day, you give the result a value of O. Doesn't this affect the value of the moving average you calculate in step 2? By adding zeroes to your numerator and dividing by n days in the denominator your resulting average would be lower than if you had simply ignored any days that close up and only added the values of the down days and divided by the n of down days.

Yes, those zero values would lower the value of the Simple Moving Average. Williams' description of the indicator does not give clear instructions on what to do with up days that occur in the 4-day window for the Buy Swing calculation (or vice versa for down days in the Sell Swing calculation). This was my guess.


The goal for "Buy Swing" is to only sum the (high-open) for down days and divide by the number of down days to get the average point value of an attempting "up" a down day. All up days should be ignored -- affecting neither the numerator or the denominator. (Vice versa for Sell Swing)

It sounds like I could achieve that by replacing the Simple Moving Average with Simple Moving Average - Skip Zeros, which is described here:

Moving Average - Simple Skip Zeros

For example, if in a 4-day window there are 2 down days and 2 up days, then the sum of the 2 down days would be divided by 2 for the average Buy Swing, and the sum of the 2 up days would be divided by 2 for the average Sell Swing over the same period. Does that sound more like it?
[2018-12-05 19:34:58]
User517020 - Posts: 7
Yes, perfect!
[2018-12-05 19:35:40]
SC Support Tom - Posts: 450
Ok, this will be easy to add. I will work on it now.
[2018-12-05 20:37:23]
SC Support Tom - Posts: 450
I have finished coding the indicator, though I have made one small correction to my math. When calculating the Buy and Sell Prices in Step 3, I should have used the averages from the previous day (Index t - 1, not t). Also, there was a typo that I've fixed (BS-Bar should have been SS-Bar in the formula for the Sell Price). The code reflects the math in this corrected document.
attachmentGSV Math - Corrected.pdf - Attached On 2018-12-05 20:37:19 UTC - Size: 115.9 KB - 755 views
[2018-12-05 20:43:45]
User517020 - Posts: 7
Ah, good catch on the previous day and the typo. Thanks again!

How do I find the indicator? Do you add it to custom indicators or do you send me a file and I upload it?
[2018-12-05 20:46:40]
SC Support Tom - Posts: 450
I will send the code to Sierra Chart Engineering for them to add to the repository. Once that is done, it will be found in the list of built-in studies. This will appear in the next release.
[2018-12-05 20:50:26]
User517020 - Posts: 7
Do you happen to know what it will be called? "Williams GSV" or something else? I just want to know what to look for.

And may I ask how I got so lucky that my request was handled at all let alone so quickly and efficiently? I'm really impressed.
[2018-12-05 21:00:00]
Sierra Chart Engineering - Posts: 104368
The name will be Greatest Swing Value.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2022-06-05 17:24:24]
User702340 - Posts: 12
Hello there,

I am totally dumb with tech, but would like to try the following 2 studies. Wonder if you may help for coding it for me and putting on the 'add custom study' section for me so that I can try them.

1st study called 'proxy 1'=
Moving Average (Open - Close, 9 Bars used in average)/ Moving Average (High - Low, 9 Bars used in average)*100

- open - close with the choice of absolute value or sign value
- bars in average may vary in setting

2nd study called 'proxy 2' =
MovingAvg (open - close, 9 bars used in average)/MovingAvg (high - low, 9 bars in average)*50 + 50

thank you for your help
[2022-11-19 05:52:42]
DayTraderEsad - Posts: 116
User702340,

This can be written using SC Spreadhseets - let me know if you already did this otherwise I can write it out.

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

Login

Login Page - Create Account