jonshank62
New member
am trying to find a average of the previous actual values defined by legnth then devide that by legnth (note ) each finalscore is different
https://usethinkscript.com/threads/5‑factor-market-bias-for-thinkorswim.22267/
https://usethinkscript.com/threads/5‑factor-market-bias-for-thinkorswim.22267/
Code:
input legnth = 21;
input showLabel = yes ;
AddLabel(showLabel ,
if finalScore > -2 and finalScore < 2 then "neutral" else
if finalScore > 2.1 and finalScore <= 4 then "neutral +" else
if finalScore > 4.1 and finalScore <= 8 then "bull" else
if finalScore > 8.1 then "strong bull" else
if finalScore < -2.1 and finalScore >= -4 then "neutral -" else
if finalScore < -4.1 and finalScore >= -8 then "bear" else
if finalScore < -8.1 then "strong bear" else "unknown",
if finalScore > -2 and finalScore < 2 then Color.YELLOW else
if finalScore > 2.1 and finalScore <= 4 then Color.LIME else
if finalScore > 4.1 and finalScore <= 8 then Color.GREEN else
if finalScore > 8.1 then Color.DARK_GREEN else
if finalScore < -2.1 and finalScore >= -4 then Color.PINK else
if finalScore < -4.1 and finalScore >= -8 then Color.RED else
if finalScore < -8.1 then Color.DARK_RED else Color.GRAY , Location.bottom_right
, FontSize.LARGER);
Last edited by a moderator: