
Strategi ini menggunakan moving averages dan indikator yang relatif kuat untuk menentukan arah tren pasar, untuk secara bertahap membangun posisi pendek dalam tren turun dan menghasilkan keuntungan.
Ketika harga close out di bawah 100 hari Simple Moving Average dan RSI lebih besar dari 30, bukalah entry. Kemudian atur stop loss dan stop loss, stop loss lebih dari 3% dari harga masuk dan stop loss di bawah 2% dari harga masuk. Dengan demikian, Anda mendapatkan ruang stop loss yang lebih besar untuk mentolerir pergerakan pasar.
Pada platform Coinrule, Anda dapat mengatur urutan pesanan jual beberapa kali untuk membangun posisi secara bertahap. Ketika pasar terus turun, Anda dapat meningkatkan posisi secara bertahap.
Strategi ini menghubungkan stop loss dan stop loss untuk setiap transaksi. Rasio stop loss dan stop loss dioptimalkan untuk mata uang yang berada di posisi terdepan. Anda dapat melakukan penyesuaian sesuai dengan mata uang tertentu.
Stop loss adalah 3% dari harga masuk Stop loss 2% dari harga masuk Sedikit lebih besar dari stop loss rasio dapat mentolerir fluktuasi yang lebih besar dan menghindari stop loss yang tidak perlu.
Strategi ini didasarkan pada arah tren yang ditentukan oleh rata-rata bergerak, filter indikator RSI menentukan waktu masuk tertentu, dan dapat secara efektif menangkap tren penurunan. Metode penambahan saham secara bertahap dapat mengontrol risiko, dan pengaturan stop loss memastikan kemampuan perdagangan tunggal.
/*backtest
start: 2022-10-31 00:00:00
end: 2023-11-06 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Coinrule
//@version=4
strategy(shorttitle='Short In Downtrend',title='Short In Downtrend Below MA100', overlay=true, initial_capital = 1000, process_orders_on_close=true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100)
//Backtest dates
fromMonth = input(defval = 1, title = "From Month", type = input.integer, minval = 1, maxval = 12)
fromDay = input(defval = 10, title = "From Day", type = input.integer, minval = 1, maxval = 31)
fromYear = input(defval = 2019, title = "From Year", type = input.integer, minval = 1970)
thruMonth = input(defval = 1, title = "Thru Month", type = input.integer, minval = 1, maxval = 12)
thruDay = input(defval = 1, title = "Thru Day", type = input.integer, minval = 1, maxval = 31)
thruYear = input(defval = 2112, title = "Thru Year", type = input.integer, minval = 1970)
showDate = input(defval = true, title = "Show Date Range", type = input.bool)
start = timestamp(fromYear, fromMonth, fromDay, 00, 00) // backtest start window
finish = timestamp(thruYear, thruMonth, thruDay, 23, 59) // backtest finish window
window() => true // create function "within window of time"
//MA inputs and calculations
inSignal=input(50, title='MASignal')
MA= sma(close, inSignal)
// RSI inputs and calculations
lengthRSI = input(14, title = 'RSI period', minval=1)
RSI = rsi(close, lengthRSI)
//Entry
strategy.entry(id="short", long = false, when = close < MA and RSI > 30)
//Exit
shortStopPrice = strategy.position_avg_price * (1 + 0.03)
shortTakeProfit = strategy.position_avg_price * (1 - 0.02)
strategy.close("short", when = close > shortStopPrice or close < shortTakeProfit and window())
plot(MA, color=color.purple, linewidth=2)