Supertrend Robotu + Trailing Stop — Strategy by ozerh07
By ozerh07
Performance Metrics
- Author: ozerh07
- Symbol: BIST:ASTOR
- Timeframe: 1 day
- Net P&L: +1,827.60 TRY (+18.28%)
- Win Rate: 83.3%
- Profit Factor: 18.961
- Max Drawdown: 113.48 TRY (1.03%)
- Total Trades: 6
Description
I have converted your original indicator into a fully functional Trading Strategy (Bot). In Pine Script, while an indicator only displays data, a strategy can execute backtests, calculate profits, and manage risk.Here is the English explanation of the features and the updated code.Key EnhancementsTrailing Stop Loss (TSL): I added a dynamic Trailing Stop. It follows the price upward at a percentage distance you define. If the price drops to this level, the bot exits the trade to protect your capital.Backtesting Engine: Since it is now a strategy, you can see your Net Profit, Win Rate, and Drawdown in the "Strategy Tester" tab at the bottom of Trading View.Filtered Entry: The bot doesn't just buy when Supertrend turns green; it also checks if the MACD is bullish to filter out "fake" signals.Automatic Period Handling: The bot automatically adapts to whatever timeframe you are currently viewing (1m, 15m, 1h, etc.).How to use this:Paste the code into the Pine Editor on TradingView.Click "Add to Chart".Trailing Stop: Look for the thin Blue line on the chart while in a trade; that is your Trailing Stop. You can adjust the sensitivity in the "Settings" menu of the strategy.Auto-Period: You don't need to change anything in the code to change timeframes. Simply switch your chart from 15m to 1h, and the bot will recalculate everything instantly.Release NotesHere is the English translation of the optimization table and the reasoning behind the adjustments.Optimized Trading Bot ParametersParameterDefaultOptimizedReason / LogicSupertrend Multiplier3.04.0Produces fewer but higher-quality signals; protects against "choppy" (sideways) markets.Supertrend Period1012Smooths out the impact of sudden price volatility.Trailing Stop (TSL)2.0%1.5% - 2.5%The ideal range for locking in profits while giving the trend room to breathe.MACD Fast/Slow12 / 2612 / 26The standard