RicardoSantos

[RS]JR Moving Average System V1

Request for JR, added fast MA's and conditions, modified the sl lines to display as lines and added option to show/hide them, modified shape to display arrows up/down
Remove from Favorite Scripts Add to Favorite Scripts
study(title="[RS]JR Moving Average System V1", shorttitle="[RS]JR.MAS.V1", 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)

//  ||---   Crossovers
buyx1 = cross(ma0,ma1) and ma0 >= ma0[1] ? true : false
sellx1 = cross(ma0,ma1) and ma0 <= ma0[1] ? 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)


elp
2 years ago
Since you have mad coding skills. If possible, could you code a simple indicator to help identify the % price is trading above a moving average. For example, the % the dax is trading above its 12 month mva. The period would be able to change depending on what period the user prefers. This would not be a signal indicator to buy or sell, just an indicator to help identify extremes when price trades away from a mva.
+4 Reply
Looks great at first glance. Will test to see if I/we can make any improvements.
+2 Reply
snapshot


Noticing much better performance with combination 1:2 and 1:8 signals.
+2 Reply
snapshot

Only way I can figure out to eliminate these so far is to introduce a MTF hard signal caller, again using MA vs EMA:WMA . I would also like to later add the RSI divergence 14:50 you and I worked on earlier to add a covered call and covered put positions.
+2 Reply
snapshot


Interesting find using multi time frame solution. This is SPY daily vs SPY 3H. Notice candle on 10/16 is red on daily, however last part of candle on 3H is a hard signal green reversal.

snapshot
+2 Reply
QuantitativeExhaustion PRO QuantitativeExhaustion
2 years ago
snapshot
+2 Reply
snapshot


As i presumed, worked again in 2012
+2 Reply
snapshot


Using a MTF 1 Day vs 3H cross reference could allow the candle to change colors before market close. User could place a trade bullish/bearish before the end of trading day close.
+1 Reply
QuantitativeExhaustion PRO QuantitativeExhaustion
2 years ago
after quick backtest 3H showed to many false negatives. running 6H and showing much better results. However, 6H will only give you early open and late day differential.
+2 Reply
QuantitativeExhaustion PRO QuantitativeExhaustion
2 years ago
1 Day vs 6H

results are very promising for a MTF function 1D 1,8,2 and 6H 1,8,2 (hard signals green-red candles)
+2 Reply
QuantitativeExhaustion PRO QuantitativeExhaustion
2 years ago
so if using MTF 6H cross reference (only hard signals, green/red candles)

Daily candle on 11-16 would start day red and close green.
Daily candle on 11-28 would not change (6H was gray or green)
Daily candle on 12-06 would start of green and end green (rather than gray)
Daily candle on 12-13 would start of red and end red.

All of these were correct with the trend, when using a 6H MTF (hard signal) cross reference.

+2 Reply
QuantitativeExhaustion PRO QuantitativeExhaustion
2 years ago
snapshot
+2 Reply
RicardoSantos PRO QuantitativeExhaustion
2 years ago
MTF only works with higher resolutions, to use it it would be needed for the chart to be "360" 6 hours and MTF function at "D" daily.
+3 Reply
Can you explain exactly what are candlestick outlines red/green and light green vs dark green or dark red vs light red ? I have an idea what you did, just want to make sure, before suggesting to eliminate many false arrow signals for the next version.
+2 Reply
RicardoSantos PRO QuantitativeExhaustion
2 years ago
the darker color is close under open, lighter close above or equal to open.
+3 Reply
QuantitativeExhaustion PRO RicardoSantos
2 years ago
is there a way only allow arrows to show up if next candle outline is green or red. Therefore, eliminating all arrows that are proceeded by opposite outline candle indication. Ex. green arrow followed by red outlined gray candle.


I would not make a V2 version with only this modification. There are probably other additions could make.
+2 Reply
RicardoSantos PRO QuantitativeExhaustion
2 years ago
you mean if a candle is gray and has a arrow ex:. up the candle should be green? or if a candle is green it should have only buy signals?other modifications just list em and i get on it :p
+3 Reply
QuantitativeExhaustion PRO RicardoSantos
2 years ago
yes. Candle is gray with an up green arrow and next candle opens gray with red outline or gray candle with red arrow and next candle is opens gray with green outline. With next candle opening with outline red or green this in effect cancels the arrow buy/sell trigger.
+2 Reply
QuantitativeExhaustion PRO QuantitativeExhaustion
2 years ago
So the arrows would have to wait for next candle open.
+2 Reply
RicardoSantos PRO QuantitativeExhaustion
2 years ago
sorry , can you clarify? maybe with a picture or a step by step event log description. :p im not following on what you want to do.
+3 Reply
QuantitativeExhaustion PRO RicardoSantos
2 years ago
snapshot
+2 Reply
RicardoSantos PRO QuantitativeExhaustion
2 years ago
ok, i see now, but thats backwards if your checking next candle for signal your delaying the signal to the next candle.
+3 Reply
QuantitativeExhaustion PRO RicardoSantos
2 years ago
Right, but this time it is set to candle open, rather than candle close. So the indication should show up as soon as the next candle forms.
+2 Reply
QuantitativeExhaustion PRO QuantitativeExhaustion
2 years ago
And this candle open indication is only to remove false signals.
+2 Reply
RicardoSantos PRO QuantitativeExhaustion
2 years ago
k gona check and see how it goes
+3 Reply
x=input("240", title="Enter mins")

Above was mentioned by LazyBear as a way to include MTF inputs by the user for anytime frame.
+2 Reply
RicardoSantos PRO QuantitativeExhaustion
2 years ago
yes only if chart time frame is lower then the signal timeframe not the other way around
+3 Reply
QuantitativeExhaustion PRO RicardoSantos
2 years ago
ok. this should remove a bunch of false signals during sideways trades. I'll get back to this lower time frame hard signal / MTF idea.
+2 Reply
RicardoSantos PRO QuantitativeExhaustion
2 years ago
just opened the script and this cant be done without delaying the good signals by 1 candle because the script is already based on open
+3 Reply
QuantitativeExhaustion PRO RicardoSantos
2 years ago
Ok. Let me scan for some other ideas. LB posted something relative to what we are working on here using EMA and mirrors.
+2 Reply
RicardoSantos PRO QuantitativeExhaustion
2 years ago
what about if:
previous candle is green and arrow down = filtered
previous candle is green and arrow up but gray candle = candle green now
?
+3 Reply
QuantitativeExhaustion PRO RicardoSantos
2 years ago
ok I'm all up for filtering false signals.
+2 Reply
QuantitativeExhaustion PRO RicardoSantos
2 years ago
snapshot


But are you filtering good signals too?
+2 Reply
RicardoSantos PRO QuantitativeExhaustion
2 years ago
hmm i guess that wasnt a good idea after all :p
+2 Reply
QuantitativeExhaustion PRO RicardoSantos
2 years ago
snapshot


What if we used the same MA to EMA:WMA candle signals with RSI 14:50 chart?
+2 Reply
RicardoSantos PRO QuantitativeExhaustion
2 years ago
same issue the rsi filters out good signals too :\
+2 Reply
QuantitativeExhaustion PRO RicardoSantos
2 years ago
I think it would give a different indication. Can you add more buy-limit sell-limit horizontal lines to the RSI.v2? Might be able to signal strengthening or weakening price movement.

4 horizontals

60/40 - 70/30 - 80/20 - 90/10

With RSI 14:50 at 90+ later breaks 80, and 70 you know price strength is weakening.
+2 Reply
RicardoSantos PRO QuantitativeExhaustion
2 years ago
ill need to look into it, meanwhile as a visual aide this probly will do it ;p
fractal channel ;)
snapshot
+3 Reply
QuantitativeExhaustion PRO RicardoSantos
2 years ago
That looks interesting. Well when you get a chance, see what combo indicators work good together and publish them.
+2 Reply
snapshot


new idea with Ichimoku Cloud
+2 Reply
snapshot


When rules are applied 2,8,2,8 Ichimoku gave no false signals for the chart above.
+2 Reply
QuantitativeExhaustion PRO QuantitativeExhaustion
2 years ago
for ex., input(2.0, title="Mult") will allow user to enter decimal values for conversion line, lagging line and span/displacement.
+2 Reply
RicardoSantos PRO QuantitativeExhaustion
2 years ago
opening above / under the cloud isnt enought as a filter?
it would filter these
snapshot
+3 Reply
QuantitativeExhaustion PRO RicardoSantos
2 years ago
Are you sure?

looking around March 6th I see a negative lead. I don't see how we could have gotten green candles.
+2 Reply
QuantitativeExhaustion PRO RicardoSantos
2 years ago
Is that for the two Ichimoku signals alone? I'd wait on adding any other indications with Ichimoku.
+2 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