Position sizing based on Yhang-Zhan variation of Garman-Klass volatility

Position sizing based on Yhang-Zhan variation of Garman-Klass volatility

This code has to be used in conjunction with a screener, that I will post soon, in order to build a weighted portfolio based on volatility and momentum. You can choose to use the EWMA (Exponential Weighted Moving Average) or the most sophisticated Yang-Zhang variation of the Garman-Klass volatility to build your positioning. Just multiply the number the graph is showing for the basic import you are normally investing. Let’s say for example that you normally invest 1000 Euros per trade per stock and the code gives you the number 9 for stock A and 5 for stock B. You would want to buy 9000 stocks A and 5000 stocks B (or a different number but always weighted 9 to 5).

This positioning works excellent in portfolios with 20-30 stocks minimum.

Blue skies!!

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Abz • 09/13/2017 #

    Hello,

    could you explain a little bit more about this , what numbers are you refering to 9 and 5 ? i have added the screener that works with this is the 9 – 5 the sharp index you are refering to?

  2. gabri • 09/13/2017 #

    ABZ,
    the 9 and 5 I was referring to are JUST EXAMPLES. You need to use this indicator when building portfolios in order to give a weight-based-on-volatility positioning to every stock.

    Let’s use another example. Let’s use ENEL, ENI,FCA as an example with yesterday close – 16th Sept 2017. We find that the YZidx (Yhang Zhan Index) for these titles are respectively 40.139 for ENEL, 65.129 for ENI and 6.10 for FCA. That means that you will have to buy more ENI than FCA. You can do that in a few ways. You can multiply these index for a minimum value – say 1000 Euros – and get 40.139×1000=40139 Euros of Enel, 65.129×1000=65129 Euros of ENI and 6.10×1000=6100 Euros of FCA.
    Or you can build the folio with [40.139/(40.139+65.129+6.10)]*100=36% stocks of ENEL, [65.129/(40.139+65.129+6.10)]*100=58,5% of ENI’s stocks and with [6.1/(40.139+65.129+6.10)]*100=5.5% of FCA’s stocks.

    • Abz • 09/13/2017 #

      Thanks gabri

  3. Mattzi • 09/13/2017 #

    In your opinion is less than 20 stocks a bad idea? Thank you.

  4. gabri • 09/13/2017 #

    No, you can pick as many or as little as you want. The portfolio composition depends on many factors. I like to use more portfolios with a number of titles varying from 20 to 50 (it depends on the period)

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar
Related users ' posts
Bard Problems with Safari latest s/ware and this site and links and adding code. Let me add the...
grimweasel47 Ok thanks Nicolas - could this be adapted to take into account MFI and then have price, volu...
Nicolas I don't understand what you mean exactly, would be better to open a topic about this idea wi...
jissey Bonjour Bolsatrilera,j'essaie de vous contacter pour le cm rsi ;je le trouve interessant, m...
jissey J'essaie de vous contacter pour l'indicateur"cm rsi"....
joobeng Sorry, I solved the problem. I have add the CBL indicator using the spanner icon on the pric...
Nicolas Adjust the price settings for the Y Axis to use the price only.
XXXXVII Hello Your indicator is interesting. However, I can't see the orange line. Do you have ...
jebus89 Big thanks for sharing this :) Seems to work as expected, good stuff.
flodefacebook Merci Nicolas pour cet indicateur. Très utile dans une technique de retournement.
HeikinAshi thank you for this very interesting indicator Nicolas! did you define a tradable setup fo...
christophe11560 salut gabri, Je n'ai pas de commentaire sur "s*s", c'est ton choix personnel. Je me posais...
gabri Hi, the SQRT(254) it is used to annualize the value. In terms of the "s*s" I just used the s...
christophe11560 Merci pour ton retour
guillermus69 is this " a= log(close/close[1])" better than a = ((close/close[1]) -1) *100 . I ...
gildaslm Hi gabri, thanks very much for your work, it helps me a lot. Have you ever tried to make the...
gandolfi thanks for your screener. Do you have the code for original Sharp ratio in order to compare ...
xel Hi! I found myself that the indicator posted here contain an error, I want to edit or fix i...
Lotech123 Thanks for this indicator. Working on a 3 M timeframe with the DJI, it can produce some inte...
JSTAR PRODUCTIONS Hi there, I downloaded the Indicator but the indicator does not show up on my charts. Am...
JSTAR PRODUCTIONS Hi, Worked it out. Thanks
poonsl2828 Hi! Francesco I have test it on GBP/USD but it only have a trade on 9 Jun which i backtes...
ullle73 why not use 1h chart? has 95% hitrate
ullle73 i see most of positions are only 1 pip before exit?
Francesco78 Hi Pepmartorell, please let's continue the discussion on the forum thread so that we can sha...
Francesco78 Hi Pepmartorell, please let's continue the discussion on the forum thread so that we can sha...
Jusmih1 Hi there, i am looking at your Strategy however when you put in automatic trading mode its ...
bruces Hi. Thank you that is what I am looking for. As well as the chart, I want to also add to a...
Jodal Bonjour Nicolas, Merci pour cet indicateur! Est-ce possible de configurer une alerte pou...
Nicolas Merci pour le post dans le forum en respectant les règles de publication énoncées dans le ca...
Dron De lo mejorcito
fabio407 Thanks, Nicolas. Very useful. Would you tell me where to find what result conveys the functi...
Nicolas This is not an instruction of the programming language but a variable from this indicator (l...
fabio407 OK. I didn't notice it. Many thanks, Nicolas!
Wilko And not only readable.... makes it much easier to iterate different entry/exit-conditions, d...
IGOSNELL Hi Interesting strategy, when I used $ M-R Dif EURUSD M15 Long if does not enter any positi...
ilvillans HI, I modified the system, from good results but from this error: Replace the variables wit...
Nicolas Restart your platform in order to be sure to use the last version, there was a version rollb...
bertrandpinoy bonjour voud pouvez m envoyer le code modifier par vous?
Nicolas Désolé , je ne comprends pas votre question.

Top