OPEN-SOURCE SCRIPT

5 SMA and 200 SMA Strategy with 1:3 Target and SL

181
Stop Loss (SL) and Target (1:3 Risk/Reward):

Long Position:
The stop loss is set at 1% below the entry price (longSL = strategy.position_avg_price * 0.99).
The take profit target is set at 3% above the entry price (longTarget = strategy.position_avg_price * (1 + 0.03)).
Short Position:
The stop loss is set at 1% above the entry price (shortSL = strategy.position_avg_price * 1.01).
The take profit target is set at 3% below the entry price (shortTarget = strategy.position_avg_price * (1 - 0.03)).
1:3 Risk-to-Reward:

The ratio between the stop loss and target is set to 1:3, meaning for each trade, the take profit is 3 times the distance of the stop loss.
How it works:
When a long or short trade is triggered, the script will place a stop loss 1% away from the entry price.
The take profit target will be placed 3% away from the entry price (in the favorable direction).
Feel free to adjust the stop loss and target percentages as needed.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.