yerb

4x MA cross script, i need some help

BTCE:BTCUSD   Bitcoin / Dollar
119 2 0
I would like to have a yellow dot on all crosses. Please share it if you add the feature. Thanx.
LazyBear PRO
2 years ago
Try this.

study(title="4x MA Cross", overlay=true)
ma1 = ema(close, 8)
ma2 = sma(close, 20)
ma3 = sma(close, 50)
ma4 = sma(close, 200)
plot(ma1, color = #00ffff, linewidth = 2)
plot(ma2, color = #ff9800, linewidth = 2)
plot(ma3, color = #cc4125, linewidth = 2)
plot(ma4, color = #00ff00, linewidth = 2)
plot(cross(ma1, ma2) or cross(ma1, ma3) or cross(ma1, ma4) ? ma1 : na, style = circles, linewidth = 4 , color = #ffaa00)
plot(cross(ma2, ma3) or cross(ma2, ma4) ? ma2 : na, style = circles, linewidth = 4 , color = lime)
plot(cross(ma3, ma4) ? ma3 : na, style = circles, linewidth = 4 , color = aqua)
+1 Reply
LazyBear PRO
2 years ago
With configurable EMA lengths

//----------- start copying here -----------------------------------------------------------------
study(title="4x MA Cross", overlay=true)
ma1_p=input(8, title="EMA1 Length")
ma2_p=input(20, title="EMA2 Length")
ma3_p=input(50, title="EMA3 Length")
ma4_p=input(200, title="EMA4 Length")
ma1 = ema(close, ma1_p)
ma2 = sma(close, ma2_p)
ma3 = sma(close, ma3_p)
ma4 = sma(close, ma4_p)
plot(ma1, color = #00ffff, linewidth = 2)
plot(ma2, color = #ff9800, linewidth = 2)
plot(ma3, color = #cc4125, linewidth = 2)
plot(ma4, color = #00ff00, linewidth = 2)
plot(cross(ma1, ma2) or cross(ma1, ma3) or cross(ma1, ma4) ? ma1 : na, style = circles, linewidth = 4 , color = #ffaa00)
plot(cross(ma2, ma3) or cross(ma2, ma4) ? ma2 : na, style = circles, linewidth = 4 , color = lime)
plot(cross(ma3, ma4) ? ma3 : na, style = circles, linewidth = 4 , color = aqua)
//--------------------- end_copy ------------------------------------------------------------------
+1 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