RicardoSantos

[STUDY][RS]CyberPC Strategy 01 V0

request for: CyberPC
Script open-source

Dans le plus pur esprit de TradingView, l'auteur de ce texte l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur ! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par les règles internes. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Vous voulez utiliser ce script sur un graphique ?
//@version=2
study(title='[STUDY][RS]CyberPC Strategy 01 V0', shorttitle='S', overlay=true)
//  ||---   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

plotshape(series=buy_entry, title='BUY', style=shape.triangleup, location=location.belowbar, color=color(lime, 0), text='B', textcolor=color(black, 0))
plotshape(series=sel_entry, title='SEL', style=shape.triangledown, location=location.abovebar, color=color(red, 0), text='S', textcolor=color(black, 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)

Commentaires