|
Josh McCormick
2020-09-07 13:26:48
|
|
I want to do something incredibly easy, but after so many attempts, my brain has turned to mush. Here's a simplified version of the problem:
There are any number of examples which show how many of the past _X_ closes are greater than a fixed number.
Or how many of the past _X_ closes are greater than the closing value that was five bars before (or after) it.
What I am looking for is something a little bit different:
For each and every bar, I want to count (and graph) how many of the past 50 bars had a close which is lower than *the current bar*.
I'd use something like SumIf, but I can't find a suitable comparison which tells it to compare the closing period against the current bar:
a=SumIf (close > ???????,1,50);
I tried both of these, but they don't return anything useful:
a=SumIf (close > close[count()],1,50);
a=SumIf (close > value (close,count()),1,50);
Any thoughts? Or am I trying to do something with QS Script that I should be writing a custom (CSharp) function for?
Thanks again,
Josh McCormick
|
|