piespe

basic fixed fraction strategy

One of the most common trading strategy is to invest a certain percentage in an asset, and keep the percentage fixed. For example you invest 2% in a stock, and as the value goes up you sell. And as the value goes down you buy. Always trying to keep the value of how much you have invested in that asset at 2%.

This works very well with assets that are stable. If you have something that fluctuates around a value, you will find yourself that each time it has gone back to the value in which you entered, you have actually gained something. With an asset that grows it also works. But in general you might find that more aggressive investments are more profitable. On the other side if there is a bubble, and you invest from the beginning using this strategy you will find yourself at the end of the bubble having gained something. Not as much as having bought all at the beginning and having sold all at the end, but still you will have sold going up, and bought going down. Plus you will have gained in the fluctuation.

Where is instead very dangerous is in stock and assets that go to zero. This because you might invest just 2% in an investment. But then as the strategy works you keep investing more as you are trying to keep 2%. You basically can lose all your money in this way (like if you were invested 100% in an asset). Very dangerous. This is why you should only use this with assets that you are sure cannot go to zero (an ETF on S & P 500 could be a good example).

So I coded this strategy on TradingView. basically it will ask you what percentage you want to invest. Then starts with entering with an order of that amount, and will then keep sitself at the same percentage. The system is discrete, as it can only buy a discrete number of contract.

Note that if you use this for cryptocurrency (where you can buy a fraction of a coin, like 0.01 btc) then you should multiply the money that you have by 10, 100, 1000 ... depending on how many digits after the comma your exchange permit you to trade.

If you are using this for forex or crypto it is quite easy that the number of order will explode. As such I added the date range taken from Allanster great script

One way to use Fixed Fractioning is to calculate the Kelly Index of an asset (which will give you a percentage), and then invest half or a quarter of the kelly in that coin, and then keep this fixed.

Another way (which goes well beyond what this script can do alone) to use the Fixed Fractioning is, if you have two assets that are anticorrelated (has a negative correlation), then investing a certain percentage of your capital in one and another percentage in another. And then each time one goes up (and the other goes down) you sell the one that is going up, and buy the one that is going down to keep the percentages fixed.

Something else, it is pretty common for people to invest around 80% of their money in an ETF that follows tha S&P500. This is why here we use 80%. Generally I have seen a more common investment strategy to be around 2%.

As everybody says: I am not responsible for your money. Study before investing.
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?