RicardoSantos

[STRATEGY][RS]CyberPC Strategy 01 V0

Request for: CyberPC
Skrip open-source

Sejalan dengan semangat TradingView, penulis skrip ini telah mempublikasikannya secara open-source, sehingga para trader dapat memahami dan memverifikasinya. Salut untuk sang penulis! Anda dapat menggunakannya secara gratis, tetapi penggunaan kembali kode ini dalam publikasi diatur oleh Tata Tertib. Anda dapat memfavoritkannya untuk dapat menggunakannya didalam sebuah chart.

Inggin menggunakan skrip ini pada chart?
//@version=2
strategy(title='[STRATEGY][RS]CyberPC Strategy 01 V0', shorttitle='S', overlay=false)
//  ||---   RSI
rsi_length = input(title='RSI Length:', type=integer, defval=4)
rsi_src = input(title='RSI Source:', type=source, defval=close)
rsi_value = rsi(rsi_src, rsi_length)
//  ||---   MFI
mfi_length = input(title='MFI Length:', type=integer, defval=4, minval=1, maxval=2000)
mfi_src = input(title='MFI Source:', type=source, defval=hlc3)
mfi_upper = sum(volume * (change(mfi_src) <= 0 ? 0 : mfi_src), mfi_length)
mfi_lower = sum(volume * (change(mfi_src) >= 0 ? 0 : mfi_src), mfi_length)
mfi_value = rsi(mfi_upper, mfi_lower)
//  ||---   DeMarker indicator by PasqualeAntonio
per=input(title='DeMarkerPeriod', type=integer, defval=4)
demax=high>high[1] ? high-high[1] : 0   
demin=low<low[1] ? low[1]-low : 0
demax_av=sma(demax,per)
demin_av=sma(demin,per)
demarker_value=demax_av/(demax_av+demin_av)
//  ||---

//max_order_per_day = input(6)
//strategy.risk.max_intraday_filled_orders(max_order_per_day)
trade_size_as_equity_factor = input(false)
trade_size = input(type=float, defval=10000.00) * (trade_size_as_equity_factor ? strategy.equity : 1)
take_profit_in_points = input(100000)
stop_loss_in_points = input(100000)
trail_in_points = input(100000)

//  ||---   Strategy:

plot(title='Equity', series=strategy.equity, color=black, transp=0)
plot(title='Net', series=strategy.initial_capital+strategy.netprofit, color=lime, transp=0)
//USE_SESSION = input(true)
//trade_session = input(title='Trade Session:', type=string, defval='0400-1500', confirm=false)
istradingsession = true//not USE_SESSION ? true : not na(time('1', trade_session))

buy_entry = istradingsession and rsi_value > 95 and mfi_value >= 100 and demarker_value >= 1
sel_entry = istradingsession and rsi_value < 5 and mfi_value <= 0 and demarker_value <= 0

strategy.entry('buy', long=true, qty=trade_size, when=buy_entry)
strategy.entry('sel', long=false, qty=trade_size, when=sel_entry)

strategy.exit('buy.Exit', from_entry='buy', profit=take_profit_in_points, loss=stop_loss_in_points, trail_points=trail_in_points, trail_offset=trail_in_points)
strategy.exit('sel.Exit', from_entry='sel', profit=take_profit_in_points, loss=stop_loss_in_points, trail_points=trail_in_points, trail_offset=trail_in_points)
//strategy.close_all(when=not istradingsession)

Komentar