RicardoSantos

[RS]JR Moving Average System V1.a

added Ichimoku Cloud as a filter
Remove from Favorite Scripts Add to Favorite Scripts
study(title="[RS]JR Moving Average System V1.a", shorttitle="[RS]JR.MAS.V1a", overlay=true)
hide_sl_lines = input(true)
ma0 = sma(hl2, input(1))


tp = input(8)
ma1 = wma(open, tp)
ma2 = ema(open, tp)

//---   2nd pass
tf = input(2)
ma3 = wma(open, tf)
ma4 = ema(open, tf)
//---   2nd pass plot output not required.

plot(ma0, color=black)
plot(ma1, color=gray)
plot(ma2, color=silver)

condition = ma0 >= ma1 and ma1 >= ma2 ? (close >= open ? lime : green) :
        ma0 <= ma1 and ma1 <= ma2 ? (close >= open ? red : maroon) :
        ma0 >= ma3 and ma3 >= ma4 ? (close >= open ? lime : green) :
        ma0 <= ma3 and ma3 <= ma4 ? (close >= open ? red : maroon) : (close >= open ? silver : gray)

barcolor(condition)

//  ||---   3rd pass Ichimoku cloud, blatantly copyed from Hpotter :p
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 23/05/2014
//  Ichimoku
////////////////////////////////////////////////////////////
hidecloud = input(true)
cloudfilter = input(true)

middleDonchian(Length) =>
    lower = lowest(Length)
    upper = highest(Length)
    avg(upper, lower)

conversionPeriods = tp
basePeriods = tf
laggingSpan2Periods = tp
displacement = tf

Tenkan = middleDonchian(conversionPeriods)
Kijun =  middleDonchian(basePeriods)
xChikou = close
SenkouA = middleDonchian(laggingSpan2Periods)
SenkouB = (Tenkan[basePeriods] + Kijun[basePeriods]) / 2
//plot(Tenkan, color=red, title="Tenkan")
//plot(Kijun, color=blue, title="Kijun")
//plot(xChikou, color= teal , title="Chikou", offset = -displacement)
A = plot(hidecloud ? na : SenkouA[displacement], color=purple, title="SenkouA")
B = plot(hidecloud ? na : SenkouB, color=green, title="SenkouB")
fill(A, B, color=green)

abovecloud = cloudfilter ? ( close >= max(SenkouA[displacement], SenkouB) ? true : false ) : true
undercloud = cloudfilter ? ( close <= min(SenkouA[displacement], SenkouB) ? true : false ) : true
//----------------------------------------------------------------------------------------------------------

//  ||---   Crossovers
buyx1 = cross(ma0,ma1) and ma0 >= ma0[1] and abovecloud ? true : false
sellx1 = cross(ma0,ma1) and ma0 <= ma0[1]  and undercloud ? true : false
plotshape(buyx1, style=shape.arrowup, color=green, location=location.belowbar)
plotshape(sellx1, style=shape.arrowdown, color=maroon, location=location.abovebar)

//  ||---   SL lines
sltop = highest(max(max(high,ma0),max(ma1,ma2)), tp)
slbot = lowest(min(min(low,ma0),min(ma1,ma2)), tp)

tcol = sltop != sltop[1] ? na : silver
bcol = slbot != slbot[1] ? na : silver
plot(hide_sl_lines ? na : sltop, color=tcol, style=line)
plot(hide_sl_lines ? na : slbot, color=bcol, style=line)




This will minimize trade commission and losses
+1 Reply
IvanLabrie QuantitativeExhaustion
Looks good, so take short term trades will riding against the walls.
+1 Reply
candles riding against wall and strong candle signals.. (dark red and light green) not along wall.
Reply
IvanLabrie QuantitativeExhaustion
https://www.youtube.com/watch?v=cIcqUokPiTw
+1 Reply


So basically anything that is free floating that is not a strong candle indicator is a no trade
+1 Reply
jangseohee QuantitativeExhaustion
But JR, that is abit of hindsight, how can we be at least 70% sure that the candles ahead will have at least 3 or > big bars?
+1 Reply
IvanLabrie jangseohee
Indeed, or how do you enter, because the last candle will repaint until the bar close.
That's always my issue with these type of systems...If you can fine tune that, then it'll be great.
Reply
Don't get all Barry Manilow cheezy on me
Reply
IvanLabrie QuantitativeExhaustion
hahaha!
Seemed appropriate...looks very good JR. Now to the backtestmobile.
+1 Reply


Inside / outside cloud is giving better scalping set ups as well as trades.
+1 Reply
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
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 Contact Support Ideas Published Followers Following Private Messages Chat Sign Out