TradingView
kevinmck100
2022년 9월 10일 오전 11시 48분

Risk Management Strategy Template 

ETHUSDT SPOTBybit

설명

This strategy is intended to be used as a base template for building new strategies.

It incorporates the following features:

Risk management:
  • Configurable X% loss per stop loss
  • Configurable R:R ratio


Trade entry:
  • Calculated position size based on risk tolerance


Trade exit:
  • Stop Loss currently configurable ATR multiplier but can be replaced based on strategy
  • Take Profit calculated from Stop Loss using R:R ratio


Backtesting:
  • Configurable backtesting range by date


Trade drawings:
  • TP/SL boxes drawn for all trades. Can be turned on and off
  • Trade exit information labels. Can be turned on and off
  • NOTE: Trade drawings will only be applicable when using overlay strategies


Debugging:
  • Includes section with useful debugging techniques


Strategy conditions

Trade entry:
LONG
  • C1: Price is above EMA line
  • C2: RSI is crossing out of oversold area

SHORT
  • C1: Price is below EMA line
  • C2: RSI is crossing out of overbought area


Trade exit:
  • Stop Loss: Stop Loss ATR multiplier is hit
  • Take Profit: R:R multiplier * Stop Loss is hit


The idea is to use RSI to catch pullbacks within the main trend.

Note that this strategy is intended to be a simple base strategy for building upon. It was not designed to be traded in its current form.
코멘트
FLASHBACK
I get a weird error, any ideas pls guys?

Cannot call 'printTradeExitLabel' with argument 'y'='call 'math.max' (series float)'. An argument of 'series float' type was used but a 'simple float' is expected.

code is unchanged
Ether2020
Super! Thank you my dear friend!
kevinmck100
@Ether2020, You're very welcome
carmen_guerrero
Absolutely amazing script. I managed to change the strategy and include mine, but there is something I did not managed to reach: how to include a partial TP. I've tried many ways to do it, but no one has properly worked. My goal was to have a 3:1 RR, and then a first TP at half way (1,5:1 RR, moving the SL at the entry point). If later, you decide to include these features, I'd be happy to try it. Thanks again for the strategy :-)
kevinmck100
@carmen_guerrero, Thanks for the comment and I'm glad to hear the strategy has been useful for you. My hope was to keep this template as simple as possible as it's intended to be a base script for people to build on top of. However, if you do need some help with the coding aspect of integrating your strategy with this script please reach out in a DM and we can discuss it
BuDana22
Ohh Nice THing, do you have a quick documentation on how to use it with our strategy?
kevinmck100
@BuDana22, Thanks. Yeah, I've tried my best to document that throughout the code itself. Anything inside the "Replaceable section" blocks are designed to be stripped out and replaced with your own indicators/conditions
Flyte-X
This is Fan-fricken-tastic!
wujishequ
Is this a redrawing of metrics?
kevinmck100
@wujishequ, No there should be no repaint. Remember this is just a template to give a starting point to build your own strategies with proper risk management. The template just uses a simple EMA and RSI strategy but the idea is to swap that out with whatever strategy conditions you'd like
더보기