Gen Tradex
Gen Tradex

Reputation: 1

Plot only when ma5 > ma10

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

Answers (1)

alexgrover
alexgrover

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

Related Questions