TradingView
valhalla_trader
20 nov 2023 21:56

MAC Spikes(Adam H Grimes) 

SPDR S&P 500 ETF TRUSTArca

Beskrivning

From Adam H Grimes: "Introducing a New Tool: The MAC Spike"

Mean Absolute Change Spikes (“MAC Spikes”).

Here are the steps to calculate it:

-Convert each day’s closing price to a change (difference) by subtracting it from the previous day’s closing price.
-Take the absolute value of that change.
-Average the past 20 days absolute values to create the baseline.
-Divide today’s change by yesterday’s baseline. (Still offsetting by one day.)

MAC Spikes- Indicator:

-Indicator Setup: The script defines an indicator with the name "MAC Spikes", not overlaying the main chart, and allows up to 99 lines to be plotted.
-User Inputs: It provides several user-configurable inputs, such as:
Length for standard deviation calculation (len).
-Type of spike to monitor (spikeType), with options for close, range, or open spikes.
-Option to filter spikes based on a threshold (filtered).
-The threshold value for spike significance (spike_thresh).
-Whether to display the spike histogram (disp_Spike).
-Line width for plotting (lw).

Versionsinformation

Introducing a New Tool: The MAC Spike
-Convert each day’s closing price to a change (difference) by subtracting it from the previous day’s closing price.
-Take the absolute value of that change.
-Average the past 20 days absolute values to create the baseline.
-Divide today’s change by yesterday’s baseline. (Still offsetting by one day.)

How does this measure compare to Sigma Spikes?
-it’s very similar.
-MAC Spikes, at the extremes, are consistently larger (smaller, for downward moves) than Sigma Spikes.
-For values closer to zero, the difference is not as consistent.

The biggest advantage we’ve gotten from this change is that, first, the calculation is much easier to explain. Standard deviation is not complex, but standard deviation of returns can highlight outliers in ways that are not immediately intuitive to all readers. Second, a MAC Spike of five is now exactly what you think it is: that market just made a move that is five times its average daily move.

Take a look at this tool and see if it might be more useful in your own work and thinking about markets.

Versionsinformation

updated to have control of upper and lower thresholds
Kommentarer
marcinandroid35
GREAT! Thank you.
ankur0808
Very good boss , which timeframe is best
valhalla_trader
@ankur0808, Any timeframe. For me I have 3 lenses i use it with.
#1 Daily.
#2 Intraday.. opening candle
#3 Intraday.. mid session "spike"

I like looking at the first minute candle's MAC spike to help quantify if a stock is "in play"
i like looking at intraday time frames and having a way to define "price spike"
For daily.. if you want to define something as a "Day 2" previous day MAC SPIKE> xyz can help with that
ankur0808
@valhalla_trader, thanks for valuable advice and wonderful worl
R1ge7
that was fast, gonna replace the sigma spike with it. thanks
valhalla_trader
@R1ge7, you're welcome! I saw Adams post and made it for myself to check out. Figured id share with the community as well. Cheers :)
Mer