Created
November 13, 2019 15:50
-
-
Save AlexNolasco/aadf934d6ba0e51242664216a70f0c50 to your computer and use it in GitHub Desktop.
TOS CMO study
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input length = 20; | |
def curClose = close; | |
def prevClose = close[1]; | |
def inc = if curClose > prevClose then curClose - prevClose else 0; | |
def dec = if prevClose > curClose then prevClose - curClose else 0; | |
def sumInc = sum(inc, length); | |
def sumDec = sum(dec, length); | |
plot CMO = if sumInc + sumDec == 0 then 0 else (sumInc - sumDec) / (sumInc + sumDec) * 100; | |
CMO.SetDefaultColor(GetColor(8)); | |
plot ZeroLine = 0; | |
ZeroLine.SetDefaultColor(GetColor(5)); | |
plot UpperLevel = 50; | |
UpperLevel.SetDefaultColor(GetColor(5)); | |
plot LowerLevel = -50; | |
LowerLevel.SetDefaultColor(GetColor(5)); | |
input over_Bought = 100; | |
input over_Sold = -50; | |
plot OverSold = over_Sold; | |
plot OverBought = over_Bought; | |
OverSold.SetDefaultColor(GetColor(1)); | |
OverBought.SetDefaultColor(GetColor(1)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment