
Strategi Trailing Stop Loss Intelligent adalah strategi yang secara automatik menyesuaikan titik berhenti mengikut perubahan harga. Ia menggabungkan logik penunjuk SAR untuk mengesan dan menyesuaikan garis berhenti apabila harga mencapai titik tinggi atau rendah baru, untuk mencapai kawalan penarikan balik maksimum.
Logik teras strategi ini adalah untuk menyesuaikan garis stop secara automatik mengikut penunjuk SAR. Secara khusus, ia mentakrifkan 4 pembolehubah:
Apabila harga naik, barisan berhenti akan terus naik, menjejaki kenaikan harga; apabila harga bertukar menjadi turun, barisan berhenti akan kekal tidak berubah, sehingga bertukar menjadi tren naik lagi.
Amplitud penyesuaian barisan henti dikawal oleh faktor panjang langkah AF. AF akan meningkat apabila penyesuaian barisan henti baru berjaya ditetapkan, sehingga memperluas amplitud penyesuaian langkah seterusnya.
Kelebihan terbesar strategi ini adalah bahawa ia boleh menyesuaikan titik-titik berhenti dengan bijak mengikut turun naik pasaran, sambil memastikan ruang keuntungan yang mencukupi, tetapi juga meminimumkan penarikan balik maksimum. Berbanding dengan kaedah berhenti statik tradisional, ia dapat menangkap trend harga dengan lebih baik.
Secara khusus, terdapat beberapa kelebihan utama:
Strategi ini juga mempunyai risiko yang perlu diperhatikan:
Strategi ini juga boleh dioptimumkan dalam beberapa arah:
Strategi menghentikan kerugian yang cerdas dengan meniru logik operasi penunjuk SAR, menyesuaikan kedudukan garis berhenti dalam masa nyata, dan mengurangkan kemungkinan kehilangan peluang sambil melindungi keuntungan. Ia memaksimumkan nilai berhenti fungsi itu sendiri.
Strategi ini lebih sesuai dengan perubahan pasaran dan lebih fleksibel daripada strategi tradisional dengan titik berhenti tetap. Dengan menetapkan parameter tersuai, pengguna boleh memilih mod berhenti yang sesuai dengan pilihan risiko mereka sendiri.
Sudah tentu, strategi ini juga mempunyai ruang untuk pengoptimuman parameter tertentu, dan peningkatan yang boleh dicapai dengan menggabungkan indikator lain. Secara keseluruhannya, ia mencari titik keseimbangan yang lebih bijak bagi pelabur antara stop loss dan stop loss.
/*backtest
start: 2024-01-17 00:00:00
end: 2024-01-24 00:00:00
period: 15m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("Lucid SAR Strategy", shorttitle="Lucid SAR Strategy", overlay=true)
// Full credit to Sawcruhteez, Lucid Investment Strategies LLC and Casey Bowman.
// This is a strategy version of the Lucid SAR indicator created by the above-mentioned parties.
// Original version of the indicator: https://www.tradingview.com/script/OkACQQgL-Lucid-SAR/
// Branded under the name "Lucid SAR"
// As agreed to with Lucid Investment Strategies LLC on July 9, 2019
// https://lucidinvestmentstrategies.com/
// Created by Casey Bowman on July 4, 2019
// MIT License
// Copyright (c) 2019 Casey Bowman
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
AF_initial = input(0.02)
AF_increment = input(0.02)
AF_maximum = input(0.2)
// start with uptrend
uptrend = true
newtrend = false
EP = high
SAR = low
AF = AF_initial
if not na(uptrend[1]) and not na(newtrend[1])
if uptrend[1]
EP := max(high, EP[1])
else
EP := min(low, EP[1])
if newtrend[1]
AF := AF_initial
else
if EP != EP[1]
AF := min(AF_maximum, AF[1] + AF_increment)
else
AF := AF[1]
SAR := SAR[1] + AF * (EP - SAR[1])
if uptrend[1]
if newtrend
SAR := max(high, EP[1])
EP := min(low, low[1])
else
SAR := min(SAR, low[1])
if not na(low[2])
SAR := min(SAR, low[2])
if SAR > low
uptrend := false
newtrend := true
SAR := max(high, EP[1])
EP := min(low, low[1])
else
uptrend := true
newtrend := false
else
if newtrend
SAR := min(low, EP[1])
EP := max(high, high[1])
else
SAR := max(SAR, high[1])
if not na(high[2])
SAR := max(SAR, high[2])
if SAR < high
uptrend := true
newtrend := true
SAR := min(low, EP[1])
EP := max(high, high[1])
else
uptrend := false
newtrend := false
plot(SAR, color = color.blue, style = plot.style_cross, linewidth = 2)
if (uptrend)
strategy.entry("PBSARLE", strategy.long, comment="PBSARLE")
if (newtrend)
strategy.entry("PBSARSE", strategy.short, comment="PBSARSE")