Counting the number of time an arrow was plotted on the daily chart

Feuse

New member
Hello everyone! hope somebody could help me with a little script I am trying to write with very small ThinkScript experience..

basically I have a script that plots arrows on daily candles where there is a gap up over 20%.
the things I am trying to add is :

1. label that shows the number of time an arrow was plotted on the daily chart. ( I tried that one but it doesn't seem to work, I don't understand how the order of how the code is getting executed).
2. label that shows how many of those gaps closed red.
3. label that shows how many of those gaps closed green.
4. plot (hod-open) above every daily candle.

any help would be appreciated.

That's what I go so far:


Code:
def condition1 = (open - close[1]) * 100 / close[1];
input gap = 10;
def counter = 0;

def r = if condition1 > gap then counter+1 else 0;

plot Data = if condition1 > gap then counter+1 else 0;

AddLabel(yes, counter);

Data.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
Data.AssignValueColor(GetColor(5));
Data.SetLineWeight(4);
 
Last edited:

Similar threads

Top