RicardoSantos

[RS]Trade System 002 Oscilator V1

152 1 15
EXPERIMENTAL: Multiple indicator Analysis
Remove from Favorite Scripts Add to Favorite Scripts
study(title="[RS]Trade System 002 Oscilator V1", shorttitle="[RS]TS002O.V1", overlay=false)
//  ||---   Input:
useHA = input(true)
smooth = input(1)
src = avg(highest(max(open,close), 4), lowest(min(open,close), 4))//input(open)
//  ||---   Globals:
_s = useHA ? security(heikenashi(tickerid), period, src) : src
smooth_price = sma(_s, smooth)
transp_value = 90
//  ||---   Sequencer Signal
sequenceLimiter = 5
shortSequence = smooth_price < smooth_price[1] ? nz(shortSequence[1])+1 : 0
longSequence = smooth_price > smooth_price[1] ? nz(longSequence[1])+1 : 0
s_con = shortSequence > 0//(longSequence[1] >= sequenceLimiter and shortSequence > 0)
b_con = longSequence > 0//(shortSequence[1] >= sequenceLimiter and longSequence > 0)
SequenceSignal = b_con ? 1 : s_con ? -1 : 0
//  ||---   RSI Signal:
_rsi = rsi(smooth_price, 50)
s_con_01 = _rsi < 45
b_con_01 = _rsi > 55
RSISignal = b_con_01 ? 1 : s_con_01 ? -1 : 0
//  ||---   CCI Signal:
_cci = cci(smooth_price, 100)
s_con_02 = _cci < 0
b_con_02 = _cci > 0
CCISignal = b_con_02 ? 1 : s_con_02 ? -1 : 0
//  ||---   Momentum Signal:
_mom = mom(smooth_price, 50)
s_con_03 = _mom < 0
b_con_03 = _mom > 0
MOMSignal = b_con_03 ? 1 : s_con_03 ? -1 : 0
//  ||---   Fast MA oscilator Signal:
_fast_ma_str = smooth_price-sma(smooth_price, 12)
s_con_04 = _fast_ma_str < 0
b_con_04 = _fast_ma_str > 0
XMA1Signal = b_con_04 ? 1 : s_con_04 ? -1 : 0
//  ||---   Slow MA oscilator Signal:
_slow_ma_str = smooth_price-sma(smooth_price, 48)
s_con_05 = _slow_ma_str < 0
b_con_05 = _slow_ma_str > 0
XMA2Signal = b_con_05 ? 1 : s_con_05 ? -1 : 0
//  ||---   Track Fast/Slow Donchian:
_fast_HH = highest(smooth_price, 12)
_fast_LL = lowest(smooth_price, 12)
_slow_HH = highest(smooth_price, 48)
_slow_LL = lowest(smooth_price, 48)
b_con_06 = _fast_HH == _slow_HH
s_con_06 = _fast_LL == _slow_LL
DonchianSignal = b_con_06 ? 1 : s_con_06 ? -1 : 0
//  ||---   MACD Signals:
[_, _, MACDhist] = macd(smooth_price, 14, 34, 8)
MACDSignal = MACDhist > 0 ? 1 : MACDhist < 0 ? -1 : 0
//  ||---   Williams %R Signal:
upper = highest(100)
lower = lowest(100)
WILLR = 100 * (smooth_price - upper) / (upper - lower)
SmoothWR = sma(WILLR, 8)
WRSignal = SmoothWR > -50 ? +1 : SmoothWR < -50 ? -1 : 0
//  ||---   SAR Signal:
SAR = sar(0.03,0.01,0.2)
SARSignal = SAR < smooth_price ? 1 : -1
//  ||---
power1 = SequenceSignal + RSISignal + CCISignal + MOMSignal + XMA1Signal + XMA2Signal + DonchianSignal + MACDSignal + WRSignal + SARSignal
power = wma(power1, 4)
powerSignal = ema(power, 8)
signalHist = power-ema(power, 32)
plot(power, color=black, linewidth=2)
plot(powerSignal, color=purple, linewidth=2)
plot(signalHist, color=purple, style=histogram, linewidth=1)
plot(power1, color=gray, linewidth=1)
hline(0)
hline(10)
hline(-10)
powerColor = power >= 8 ? green : 
        power >= 5 and power < 8 ? lime : 
        power >= 1 and power < 5 ? olive : 
        power <= -1 and power > -5 ? orange : 
        power <= -5 and power > -8 ? red : 
        power <= -8 ? maroon : yellow
bgcolor(powerColor, transp=40)
barcolor(powerColor)
j1O9SB PRO
a year ago
This system being experimental, I understand using it for trading, especially predicting price, is significantly risky. I have to say though this is by far the best way to visualize trend at a glance on any timeframe with painted candles. May I suggest that you add a plotshape function that prints a small green/red label to show you when the trend is increasing/decreasing? I've given it a try myself by taking old values of the power variable and comparing it to the present value (power><power) but I just end up with long lists of these. Also a multi-timeframe feature would probably make this marketplace grade. Best of luck developing this.
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out