RicardoSantos

[STUDY][RS]CyberPC Strategy 01 V0

request for: CyberPC
Remove from Favorite Scripts Add to Favorite Scripts
//@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)
United States
United Kingdom
India
Deutschland
France
España
Italia
Polska
Türkiye
Россия
Brasil
Indonesia
Malaysia
Việt Nam
日本
한국
简体
繁體
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Priority Support Contact Support Ideas Published Followers Following Private Messages Chat Sign Out