Reputation: 1
I just want to plot moving average 5 line only when it's above moving average 10. When it's under moving average 10, I don't want it to appear.
Can I adjust the transparency condition..? or is there another way to do it..?
Kindly please help. Still new in coding. Thanks :)
Upvotes: 0
Views: 110
Reputation: 1043
You can't use series to change the transp
argument in plot
. You can however do it with color
as follows:
plot(ma5,color=ma5>ma10?#2157f3:na)
Upvotes: 1