input Length = 20;
def LowLow; def HighBar;
def HighThresh; def Sig;
if Close == lowest(Close,Length) {
LowLow = lowest(Low,Length);
if Low == LowLow {
HighBar = Double.NaN;
HighThresh = High;
} else {
HighBar =
fold Index = 0 to Length - 1 with Bar while IsNan(Bar) do
if Low[Index] == LowLow then Index
else Double.NaN;
HighThresh = getValue(High,HighBar);
}
Sig = Double.NaN;
} else {
Sig = crosses(High, HighThresh[1], crossingDirection.ABOVE);
HighThresh = if Sig then Double.NaN else HighThresh[1];
LowLow = Double.NaN;
HighBar = Double.NaN;
}
plot Signal = Sig;
Signal.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
plot Threshold = HighThresh;
Threshold.setPaintingStrategy(paintingStrategy.HORIZONTAL);
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
J | Candle price by cent | Questions | 2 | |
B | How to place a trailing stop order on a future price? | Questions | 1 | |
T | Scan for Price Approaching or Below the 26-Month EMA | Questions | 2 | |
![]() |
Option Price Levels Indicator for TOS | Questions | 1 | |
J | Highest Price Volume Line within a Candle? | Questions | 1 |
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.