OrcChieftain

Underworld Hunter Backtesting Algorhitm

This strategy is built to prove the profitability of my Underworld Hunter indicator. It tests two different strategies. I won't be going into the calculation again since it is part of the original script. I just made a few adjustments.

First one is clearly visual. It plots slimmer twin-coloured lines now and has a different colour for every extreme level. Second is less obvious - I switched Relative Strength Index for Commodity Channel Index.

Extreme levels are as follows: green 100 -► 120, yellow 120 -► 140, orange 140 -► 160, red 160 -► 180 and purple above 180, I will have a special separate algorithm for testing optimal CCI levels someday, in this script, these values are only meant to help you with manual operations and do not influence results of the strategy in any way.

#Trending strategy

The trending strategy opens a position whenever the price leaves the bands and holds it until two consecutive bars are closed within the bands. The picture shows one winning position that hasn't yet been resulted. It also shows a few fakeouts. For this strategy, you want to keep the length below 110, the deviation should be below 2 and you probably want to play lower timeframes.


#Within the bands

The second strategy is pretty much the opposite. It opens a position when the price reaches outer bands and holds it until two consecutive bars are closed within the bands and current bar closes below previous bars low in case of long. It is working on hourly timeframes and you need higher length and deviation to succeed. The picture shows a few positions on EURUSD. Each of them is profitable but would be much higher if you closed it manually when it was time. You need to enable this strategy, which automatically disables the other one.


When using my script, you need to bear in mind that the first strategy doesn't detect optimal levels to close the price. A trend is often followed by a less volatile and boring correction which causes bands to shrink and lower your profits if you don't close manually as it will take longer till bands are reached.

On the other hand, second script literally has no stop-loss. As long as the price is outside the range, it will never close which will cause major drawdowns, unless you control the trade manually. CCI is here to help you with both.

I also recommend combining this with Market Profile (on TW, there is only Volume Profile, which can be used in a similar way) and trading day theory (trending with multiple distributions, trending day, normal day, a variation on a normal day, non-trending day or neutral day). Always keep in mind that it is up to traders to be profitable, indicators can support a good trader, but they will not fix a bad one.




Skript med en öppen källkod

I sann TradingView-anda har författaren publicerat detta skript med öppen källkod så att andra handlare kan förstå och verifiera det. Hatten av för författaren! Du kan använda det gratis men återanvändning av den här koden i en publikation regleras av våra ordningsregler. Du kan ange den som favorit för att använda den i ett diagram.

Frånsägelse av ansvar

Informationen och publikationerna är inte avsedda att vara, och utgör inte heller finansiella, investerings-, handels- eller andra typer av råd eller rekommendationer som tillhandahålls eller stöds av TradingView. Läs mer i Användarvillkoren.

Vill du använda det här skriptet i ett diagram?