RicardoSantos

[STUDY][RS]CyberPC Strategy 01 V0

request for: CyberPC

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
//@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)