Trailing Buy — Strategy by jason5480
By freyadog
Performance Metrics
- Author: freyadog
- Symbol: BINANCE:BTCUSDT
- Timeframe: 4 hours
- Net P&L: −7,475.20 USDT (−7.48%)
- Win Rate: 30.8%
- Profit Factor: 0.802
- Max Drawdown: 30,219.72 USDT (24.70%)
- Total Trades: 13
- Sharpe Ratio: −0.135
Description
Feb 13, 2022This script demonstrates how to do trailing buy. With this approach, given an entry signal, instead of buying directly, you just follow the price downwards (for long positions) and you buy when the price increases by a small percentage. The order will be executed when the next bar is closed. This approach may increase the profits (slightly) in some strategies! This script can be used as a template for your own strategy. Be aware that the simulated data may produce unrealistic results.Feb 24, 2022Release Notes Fix some bugs in some edge cases Refactor the code to better reflect what it does Feb 24, 2022Release NotesFix minor typosJun 30, 2022Release NotesUse stop orders when trailing instead of market orders at the start of the next candle (suggestion by freyadog)Use time_filter library Jul 2, 2022Release NotesMinor code clean upChange color schemeJul 3, 2022Release NotesUpdate time_filters libraryJul 9, 2022Release NotesReplace deprecated "when=" with if statements in strategy callsJul 13, 2022Release NotesChange fastMA default color to yellowChange trailing entry price default color to blueJul 29, 2022Release NotesIncrease max labels to 150Minor refactoringAug 9, 2022Release NotesUpdate time_filters librarySep 2, 2022Release NotesChange the settings so the order type (market, stop-limit) is independent from the trailingSome minor label/color changesSep 28, 2022Release NotesAdded option for limit ordersJan 10, 2023Release Notessmall refactoringJan 17, 2023Release NotesUpdate time_filters library versionMar 19, 2023Release Notes Update time_filters library versionNov 22, 2023Release NotesUse the 'chrono_utils' library for the date-time window filterSep 19, 2024Release NotesAdd different alert messages per eventUpdate 'chrono_utils' libraryMar 1Release Notes Update to pinescript version 6