♥ 0 |
Hi Pete, I’m trying to create a very simple study that marks the third consecutive higher high candle (or third lower low) with a up (or down) arrow, but only if the prior arrow was in the opposite direction. In other words, it flips. My scripting abilities are fairly limited, so I’m hoping there’s a simple solution that I can understand and apply to other applications. I was imagining defining a boolean, ‘count,’ that flips each time an arrow gets drawn, and is a requirement for the following, opposite arrow. I saw your reference to a recursive variable in another thread, but wasn’t able to find documentation I could understand. Any help would be appreciated. Here’s my attempt (the doesn’t work): def count = 1; plot UP = high is greater than high from 1 bar ago plot DOWN = low is less than low from 1 bar ago UP.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP); DOWN.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
Marked as spam
|
Please log in to post questions.