
Strategi ini menggunakan tiga indikator, yaitu Parabolic SAR, MACD, dan RSI, untuk melakukan perdagangan multihead otomatis dalam beberapa frame waktu. Strategi ini terutama berlaku untuk perdagangan intraday saham dan komoditas.
Indikator PSAR digunakan untuk menentukan arah harga dan titik pembalikan tren. Ketika jumlah poin turun, sinyal multihead, ketika jumlah poin naik, sinyal kosong.
Indikator MACD menilai pergerakan harga. Garis MACD dan Garis SIGNAL naik ke atas sebagai sinyal multihead, turun ke bawah sebagai sinyal kosong.
Indikator RSI menilai fenomena overbought dan oversold. RSI adalah sinyal overhead saat berada di atas titik terendah dan sinyal overhead saat berada di bawah titik terendah.
Sinyal-sinyal dari tiga indikator di atas yang digabungkan membentuk keputusan akhir.
Adaptasi menggunakan indikator Chop Index untuk menyaring pasar konsolidasi dan menghindari whipsaws.
Menggunakan prinsip reverse pyramid, manajemen risiko dan keuntungan secara dinamis melalui pengaturan stop loss dan stop loss.
Kombinasi multi-indikator untuk menilai tren, momentum dan karakteristik overbought dan oversold, meningkatkan akurasi pengambilan keputusan.
Beradaptasi dengan karakteristik pasar, filter melalui indeks Chop untuk mengkonsolidasikan pasar, dan hindari terselubung.
Pengelolaan risiko dan keuntungan yang dinamis, dengan prinsip reverse pyramid uptrading, untuk mencapai stop loss aktif.
Ada banyak parameter yang dapat disesuaikan dan dioptimalkan, mudah disesuaikan dengan berbagai varietas dan lingkungan pasar.
Dukungan untuk beberapa kerangka waktu, memberikan fleksibilitas untuk perdagangan jangka pendek dan jangka menengah dalam sehari.
Keputusan multihead bergantung pada pengaturan parameter, dan pengaturan yang tidak tepat dapat menyebabkan kesalahan.
Ada kemungkinan bahwa indikator akan mengirimkan sinyal yang salah, yang dapat membentuk keputusan yang bertentangan dengan tren.
Stop loss yang tidak tepat dapat meningkatkan kerugian atau mengurangi keuntungan.
Parameter yang perlu sering dipantau dan disesuaikan, dan biaya intervensi manusia yang lebih besar.
Tambahkan modul verifikasi model, evaluasi pengaturan parameter dan validitas sinyal.
Menambahkan modul pembelajaran mesin untuk mengoptimalkan parameter dan model secara otomatis
Akses ke lebih banyak sumber data, lebih banyak fitur, dan lebih banyak keputusan.
Mengembangkan sistem pemantauan dan pemeliharaan otomatisasi untuk mengurangi biaya intervensi manusia.
Meningkatkan evaluasi feedback dan simulasi, dan efektivitas strategi pengujian.
Strategi ini menggunakan kombinasi dari berbagai indikator teknis untuk mengotomatisasi dan mengukur perdagangan berdasarkan aturan. Strategi ini memiliki ruang yang lebih besar untuk pengoptimalan, dan dapat diperluas. Ini cocok untuk pengoptimalan seperti penyesuaian parameter, ekstensi fungsi, dan pembelajaran mesin.
/*backtest
start: 2022-12-20 00:00:00
end: 2023-12-26 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/
// © vikris
//@version=4
strategy("[VJ]Phoenix Force of PSAR +MACD +RSI", overlay=true, calc_on_every_tick = false,pyramiding=0)
// ********** Strategy inputs - Start **********
// Used for intraday handling
// Session value should be from market start to the time you want to square-off
// your intraday strategy
// Important: The end time should be at least 2 minutes before the intraday
// square-off time set by your broker
var i_marketSession = input(title="Market session", type=input.session,
defval="0915-1455", confirm=true)
// Make inputs that set the take profit % (optional)
longProfitPerc = input(title="Long Take Profit (%)",
type=input.float, minval=0.0, step=0.1, defval=3) * 0.01
shortProfitPerc = input(title="Short Take Profit (%)",
type=input.float, minval=0.0, step=0.1, defval=3) * 0.01
// Set stop loss level with input options (optional)
longLossPerc = input(title="Long Stop Loss (%)",
type=input.float, minval=0.0, step=0.1, defval=3) * 0.01
shortLossPerc = input(title="Short Stop Loss (%)",
type=input.float, minval=0.0, step=0.1, defval=3) * 0.01
// ********** Strategy inputs - End **********
// ********** Supporting functions - Start **********
// A function to check whether the bar or period is in intraday session
barInSession(sess) => time(timeframe.period, sess) != 0
// Figure out take profit price
longExitPrice = strategy.position_avg_price * (1 + longProfitPerc)
shortExitPrice = strategy.position_avg_price * (1 - shortProfitPerc)
// Determine stop loss price
longStopPrice = strategy.position_avg_price * (1 - longLossPerc)
shortStopPrice = strategy.position_avg_price * (1 + shortLossPerc)
// ********** Supporting functions - End **********
// ********** Strategy - Start **********
// See if intraday session is active
bool intradaySession = barInSession(i_marketSession)
// Trade only if intraday session is active
//=================Strategy logic goes in here===========================
psar = sar(0.02,0.02,0.2)
c1a = close > psar
c1v = close < psar
malen = input(50, title="MA Length")
mm200 = sma(close, malen)
c2a = close > mm200
c2v = close < mm200
fast = input(12, title="MACD Fast EMA Length")
slow = input(26, title="MACD Slow EMA Length")
[macd,signal,hist] = macd(close, fast,slow, 9)
c3a = macd >= 0
c3v = macd <= 0
rsilen = input(7, title="RSI Length")
th = input(50, title="RSI Threshold")
rsi14 = rsi(close, rsilen)
c4a = rsi14 >= th
c4v = rsi14 <= th
chopi = input(7, title="Chop Index lenght")
ci = 100 * log10(sum(atr(1), chopi) / (highest(chopi) - lowest(chopi))) / log10(chopi)
buy = c1a and c2a and c3a and c4a ? 1 : 0
sell = c1v and c2v and c3v and c4v ? -1 : 0
//Final Long/Short Condition
longCondition = buy==1 and ci <50
shortCondition = sell==-1 and ci <50
//Long Strategy - buy condition and exits with Take profit and SL
if (longCondition and intradaySession)
stop_level = longStopPrice
profit_level = longExitPrice
strategy.entry("My Long Entry Id", strategy.long)
strategy.exit("TP/SL", "My Long Entry Id", stop=stop_level, limit=profit_level)
//Short Strategy - sell condition and exits with Take profit and SL
if (shortCondition and intradaySession)
stop_level = shortStopPrice
profit_level = shortExitPrice
strategy.entry("My Short Entry Id", strategy.short)
strategy.exit("TP/SL", "My Short Entry Id", stop=stop_level, limit=profit_level)
// Square-off position (when session is over and position is open)
squareOff = (not intradaySession) and (strategy.position_size != 0)
strategy.close_all(when = squareOff, comment = "Square-off")
// ********** Strategy - End **********