jivasmax

Weighted ROC

roc
112 1 13
roc
WEIGHTED Rate of change for momentum rotation strategy
Remove from Favorite Scripts Add to Favorite Scripts
study("Weighted ROC")
ROC1 = input(title="ROC1", type=integer , defval=10)
ROC2 = input(title="ROC2", type=integer , defval=5)
ROC3 = input(title="ROC3", type=integer , defval=1)
W_ROC1 = input(title="ROC1", type=integer , defval=0.5)
W_ROC2 = input(title="ROC2", type=integer , defval=0.3)
W_ROC3 = input(title="ROC3", type=integer , defval=0.2)


ROC1W = (close - close[1*ROC1]) / close[1*ROC1]
ROC2W = (close - close[1*ROC2]) / close[1*ROC2]
ROC3W = (close - close[1*ROC3]) / close[1*ROC3]

ROC = W_ROC1*ROC1W + W_ROC2*ROC2W + W_ROC3*ROC3W

scolor = ROC >= 0 ? green : red

hline(0)
plot(ROC, color=scolor, offset = 0, style=columns)
yurius PRO
5 months ago
Hello! I love your indicator a lot. Could you explain logic behaind different ROC indicators? Why you using ROC 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