I can't upload quickly a picture to show, but I use this code (see at the bottom). It's a histogram from previous close to close.
My question goes as follow: I found this code:
https://usethinkscript.com/threads/anybody-know-how-to-create-a-bar-counter-on-tos.4739/#post-47217
declare upper;
def GreenCandle = Close>Open;
def RedCandle = Close<Open;
def GreenCount = TOTALSUM(GreenCandle);
def RedCount = TOTALSUM(RedCandle);
AddLabel(yes, "GreenCandle: " + GreenCount, color.GREEN);
AddLabel(yes, "RedCandle: " + RedCount, color.R
Is there anyway someone can help me to use a similar count, but than with a counter how often market closes with let see +1% or -1%? Thanks a lot!
____________________________________________________________________________
PC to close code:
input length = 1;
input price = close;
plot Diff = 100 * (close / close [length] - 1);
Diff.SetDefaultColor(GetColor(5));
Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff.SetLineWeight(3);
Diff.DefineColor("Positive and Up", CreateColor(51, 204, 0));
Diff.DefineColor("Positive and Down", CreateColor(51, 204, 0));
Diff.DefineColor("Negative and Down", Color.RED);
Diff.DefineColor("Negative and Up", Color.RED);
Diff.AssignValueColor(if Diff >= 0 then if Diff > Diff[1] then Diff.color("Positive and Up") else Diff.color("Positive and Down") else if Diff < Diff[1] then Diff.color("Negative and Down") else Diff.color("Negative and Up"));
My question goes as follow: I found this code:
https://usethinkscript.com/threads/anybody-know-how-to-create-a-bar-counter-on-tos.4739/#post-47217
declare upper;
def GreenCandle = Close>Open;
def RedCandle = Close<Open;
def GreenCount = TOTALSUM(GreenCandle);
def RedCount = TOTALSUM(RedCandle);
AddLabel(yes, "GreenCandle: " + GreenCount, color.GREEN);
AddLabel(yes, "RedCandle: " + RedCount, color.R
Is there anyway someone can help me to use a similar count, but than with a counter how often market closes with let see +1% or -1%? Thanks a lot!
____________________________________________________________________________
PC to close code:
input length = 1;
input price = close;
plot Diff = 100 * (close / close [length] - 1);
Diff.SetDefaultColor(GetColor(5));
Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff.SetLineWeight(3);
Diff.DefineColor("Positive and Up", CreateColor(51, 204, 0));
Diff.DefineColor("Positive and Down", CreateColor(51, 204, 0));
Diff.DefineColor("Negative and Down", Color.RED);
Diff.DefineColor("Negative and Up", Color.RED);
Diff.AssignValueColor(if Diff >= 0 then if Diff > Diff[1] then Diff.color("Positive and Up") else Diff.color("Positive and Down") else if Diff < Diff[1] then Diff.color("Negative and Down") else Diff.color("Negative and Up"));
Last edited by a moderator: