Sweettz

Strategy Template + Performance & Returns table + Extras

Sweettz 업데이트됨   
A script I've been working on since summer 2022. A template for any strategy so you just have to write or paste the code and go straight into risk management settings

Features:

>Signal only Longs/only Shorts/Both
>Leverage system
>Proper fees calculation (even with leverage on)

>Different Stop Loss systems: Simple percentage, 4 different "move to Break Even" systems and Scaling SL after each TP order (read the disclaimer at the bottom regarding this and the TV % profitable metric)
>2 Take Profit systems: Simple percentages, or Risk/reward ratios based on SL level
>Additional option on TP so last one "rides free" until closure of position or Stoploss is hit (for more than 1 orders)
>Up to 5 TP orders
>Show or hide SL/TP levels on demand

>2 date filters. Manual filter is nothing new, enter two dates/hours and filter will turn on. BUT automatic filter is another thing (thanks to user @bfr_ for his help in codingthis feature)
>AUTOMATIC DATE FILTER. Allows you to split all historical data on the chart in X periods, then choose the range of periods used. Up to 10 but that can be changed, instructions included. Useful for WalkForward simulations, haven't seen a script in TradingView that allows you to do this and test your strategy on "unseen data" automatically

EXTRA SETTINGS
Besides, some additions I like to add to my codes:

>Returns table for monthly and weekly performance. Requires recalculation on every tick. This is a modified version of @QuantNomad's work. May add lower TF options later on
>Volume Based S/R system. Original work from @shtcoinr
>One feature that was made by me, the "portfolio table". Yields info and metrics of your strategy, current position and balance. You're able to turn it off and change its size

Should anyone find an error, or have any idea on how to improve this code, please contact me. Future updates could come, stay tuned

DISCLAIMER:
In order to have accurate StopLoss hit, I had to change the previous system, which was a "close position on candle close" instead at actual stoploss level. It was fixed, but resulted on inflation of the number of trading orders, thus reducing the percent profitable and making it strongly biased and unreal. Keep that in mind, that "real" profitability could be 2x or 3x the metric TradingView says. If your strategy has a really high trading frequency, resulting in 3000+ orders, might be a problem. Try to make use of the automatic/manual date filter as workaround, I have no means of changing this, seems it is not a bug but an intended design of the PineScript Code
릴리즈 노트:
Added a new option so we're able to change the location of the portfolio table, for both personal taste and being able to use weekly/monthly returns also.
Besides, changed the "Active ROI" cell so instead of showing return of current position divided by the whole portfolio, it'll show returns of current position. Which was my initial intention, but somehow it slipped through. Should be ok now.
릴리즈 노트:
Set a default comission value as 0.02% (usual level for futures on crypto exchanges), so you'll see a real performance instead of these unrealistic ones.
Moved the code for the date filter down, so the options don't show above the indicator inputs. Just a matter of personal taste.
Added a supertrend filter by default, just one with default settings, you can add the input function to filter it.
릴리즈 노트:
Fixed a minor typo in group string
오픈 소스 스크립트

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

면책사항

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

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