# Price Action Index

8824 visningar
I've created a simple oscillator which I think does a good job of easily showing you when price is worth watching or not. I think all too often you get stuck looking at something like an RSI and end up trading noise.

From my observations and experiences, I've found that there are 2 major catalysts for price movement--
• Price is either trending and reaches a top or bottom, or
• Price is consolidating and ready to make a move in some direction

These movements can be seen quite well from a Bollinger Band , which is what mostly gave me the inspiration. When I watch a chart with a BB on it I see that either you're looking to trade price moving out of a squeeze or riding price up/down the band until it crosses over and makes a move to the moving average.

My solution was to multiply the direction of price by the strength of its deviation.
• Price gets converted into a signal between -1.0 (bottom of the range) and 1.0 (top of the range)
• Standard Deviation gets converted into a stochastic signal between 0 (next to no deviation from mean) and 100 (highest deviation in lookback)
• These 2 get multiplied by each other
• The result tells you if price action is trending bullish and if its approaching max strength (perhaps Overbought), example: Price is hitting highs (1.0) and deviation is also at its highest (100) = 100, opposite for bearish
• Result can also tell you if price is at the top of the range but the deviation is so tiny and we're mostly pinned to the mean (1.0 * 5 = only 5)

If the indicator is stuck near the middle and purple:
- Don't make directional trades or you'll be eaten alive by the chop
- Good idea to sell options, Iron Condors/Butterflies, etc
- Wait for a move to breakout --> the purple will fade away and give way to a direction
--- As in all trading scenarios, be mindful of fakeouts/short moves to one direction that very quickly get reversed

If the indicator is heading higher:
- This would indicate there is a bull trend going on, get long
- If we are reaching the overbought area, this is an ideal place to take profits or look at spreads like Bearish Call Spreads (sell calls)
- I think you can make your own determination of when to sell by either selling when we're in the overbought area (if it reaches there) or staying bullish so long as it is above the zone

If the indicator is heading lower:
- Bear trend, shorting is possible
- Can use this as a contrarian signal to buy lows

A couple of charts with the indicator and a purple squeeze box I've drawn (can sometimes get noisy in real-time, but hindsight is 20/20)--
Bitcoin on Daily with default 20 length

Gamestop on 30 minute time frame with 100 length

Please feel free to use this indicator for your trading or your own indicators. This particular script is very stripped down/bare bones from what I have been working on as an ongoing project. If TradingView ever returns scripts you can sell, I would probably open that up for a small premium.
Release Notes:
• Added ability to separate the Standard Deviation length from its Stochastic length
Release Notes:
• Added some other options besides Standard Deviation to measure dispersion

Personally, I really like the Signal to Noise ratio squared, Coefficient of Variation, and Standard Deviation. StDev is probably the most simple measure and the default. These additions are mostly just an add for fun, but if you find better signals or trading using different ones, then great!
Release Notes:
• Added Higher Time Frame functionality. I haven't seen much improvement in signals, I think what makes more sense is increasing the lengths instead, but some might find it more useful
• Added ability to use Bar Colors
• Added alert conditions and alerts-- I personally have not scripted these before and wasn't able to get any real-time alerts generated, so I am not sure this is done correctly... will likely revisit at another time
• Found a small typo in the oscillation tuple function
• Added a Range function to Dispersion methods

Have worked on variable/dynamic lengths, using On Balance Volume, Rates of Change, etc. but haven't seen a lot of improvement in signals, and getting to be a little too complicated for the basis of the script.

If you have any requests or additional feedback, please let me know!
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

## Kommentarer

Cool script
Svara
vonnyhurt
@vonnyhurt, Thank you!
Svara
Are the colored boxes supposed to show up in both panes? I only get the lower pane.
Svara
ckwhipple
@ckwhipple, The boxes are set to show colors based on whatever the price action is doing-- top box will highlight red when we get above a threshold, middle box highlights purple/fuchsia when stuck in the mid-range, and bottom box highlights lime when its below a threshold. I set these based on how I like to trade, which is that I am always looking to sell/take profit at high points, and buy lows for sharp reversals up, hence red at the top, green at bottom. Feel free to modify script in Pine to your liking.
Svara
chrism665
@chrism665, Thank you for your clear and helpful explanation. I understand the oscillator on the lower pane. However, I was asking about the purple/fuchsia boxes on the actual price chart. I was wondering if those are painted automatically or if you drew those onto the stock chart separately as an illustration. Thanks.
Svara
ckwhipple
@ckwhipple, Ah, got it! I drew those boxes manually to help drive home the indicator's usefulness.
Svara
dear author, won't it be difficult for you to write a strategy to test this indicator?
Svara
Hello, thank you for the script looks awesome. Just had a question what is the function of the Repaint HTF function in the indicator? Thank you in advance.
Svara
ajmann
@ajmann, "Repainting" is a lengthy explanation, I wrote a few things and deleted them several times within this comment, I just don't want to butcher it and get smacked by TV Mods. I would suggest reading up these pages for an 'official' explanation--