(JS) Ballista

Alright so this is a script I made by combining two existing ones and making a really cool discovery that has proven very useful.

You'll notice that there are two separate oscillators that are laid on top of each other. The background oscillator is my "Tip-and-Dip" oscillator which you can see here (will refer to this as TnD from here), and the foreground oscillator from the Squeeze, which can be viewed here.

Initially I just wanted to see how they interacted with one another and compare them, but this led to some pretty interesting observations.

First let me go through the options real quick to get that out of the way, though it is mostly self-explanatory.

Lookback Period defines the amount of bars used for the TnD oscillator.
Smoothing Value smooths out the TnD output.
Standard Deviations is used to calculate the TnD formula.
Color Scheme is preset BG colors.
Using Dark Mode changes colors based on dark mode or not.
Squeeze Momentum On turns the Squeeze in the foreground off and on.
Arrows Off turns the arrows on the indicator off and on.

Now to explain the indicator a bit more. I have the default lookback period as 40 due to the Squeeze being 20, which makes the TnD oscillator the "slow" output with the Squeeze being the "fast" output.

Some initial observations were that when both the Squeeze and the TnD are moving in the direction, when the Squeeze is higher (uptrend) or lower (downtrend) it seems to indicate strength in the move. As the move loses steam you'll notice the Squeeze diverge from the TnD .

However, the most useful thing I discovered about the interaction between these two indicators is where the name for it came from. So if you aren't familiar with what a Ballista is, per Wikipedia, "The ballista... sometimes called bolt thrower, was an ancient missile weapon that launched either bolts or stones at a distant target." There are instances where the Squeeze seems to get ahead of itself and gets too far away from the TnD (which is the long term trend between the two). The key thing to look for is an "inverted squeeze" - this is when the squeeze oscillator ends up flipping against the TnD . When this occurs there is an extremely high probability that you'll see price shoot back the opposite way of the Squeeze.

I've been using this setup myself for about a year now and have been very satisfied with the results thusfar. I circled some examples on the SPX daily chart here to show you what I mean with the inverted Squeeze shooting back.

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。