I think I'm completely sold on algorithmic charting. . .
I've
enough to be convinced.
It all started with dchappy showing me how dumb it is to study TA when it is as simple as 1-2-3;
99% more effort amounts to maybe an extra +1.5R per trade, but on the flip side 'analysis paralysis' is costing you whole trades.
A simple logical method of applying risk to the chart and getting a reward, like a rat, is the way to go.
It has taken me a long time, but I'm finally coming around
Added logic: PS: MEEP! I must have been tired! Fixed:
Code: Select all
signal := signal == "buy" and smma > low and histLine <= 0 ? "none" : signal == "sell" and smma < high and histLine > 0 ? "none" : signal
Updated Code:
Code: Select all
[code]
signal := signal == "buy" and smma > low and histLine <= 0 ? "none" : signal == "sell" and smma < high and histLine > 0 ? "none" : signal
[/code]
//@version=4
study("PowerXYZ Strategy", "PowerZ", overlay=true)
//-----Typical Price-----//
typicalPrice = (high + low + close) / 3
//-----MACD-----//
[macdLine, signalLine, histLine] = macd(close, 12, 26, 9)
//-----Smoothed moving average-----
len = input(4, minval=1, title="Length")
src = input(open, title="Source")
smma = 0.0
smma := na(smma[1]) ? sma(src, len) : (smma[1] * (len - 1) + src) / len
//-----RSI-----//
rsiLine = rsi(close, 7)
//-----Percent D (smooth)-----//
stochLine = sma(sma(stoch(close, high, low, 13),3),3)
//-----Percent K (jagged)-----//
//stochLine = sma(stoch(close, high, low, 14),3)
//-----PowerZ------//
signal = smma < typicalPrice and rsiLine > 50 and stochLine > 50 ? "buy" : smma > typicalPrice and rsiLine <= 50 and stochLine <= 50? "sell" : "none"
signal := signal[1] == "buy" and signal == "none" and rsiLine <= 50 or signal[1] == "sell" and signal == "none" and rsiLine > 50 or signal[2] == "buy" and signal[1] == "none" and rsiLine <= 50 or signal[2] == "sell" and signal[1] == "none" and rsiLine > 50 or signal[3] == "buy" and signal[2] == "none" and signal[1] == "none" and rsiLine <= 50 or signal[3] == "sell" and signal[2] == "none" and signal[1] == "none" and rsiLine > 50? "burnt" : signal
signal := signal == "buy" and smma > low and histLine <= 0 ? "none" : signal == "sell" and smma < high and histLine > 0 ? "none" : signal
palette = signal == "buy" ? color.lime : signal == "sell" ? color.red : signal == "burnt" ? color.black : color.rgb(220, 228, 114)
//-----Color & Plot-----//
//barcolor(color=palette)
plotbar(open, high, low, close, color=palette)
plot(smma, linewidth=1, color=color.rgb(134, 174, 221,33))
PS: I do flip back and forth between PowerX and PowerZ to make sure that the signals are largely the same; the goal is simply to have a better color-coded system.