PpSignal Variable Index Dynamic Average V2The Moving Average is, perhaps, the most popular indicator in trading for a reason. Comparatively, the crossing average can tell you plenty about a trend, i.e. whether it’s broken or unbroken, changing or holding. But the Moving Average isn’t perfect; there is one area where it falls short and that is volatility. Even an Exponential Moving Average, which places more emphasis on the latest data, can miss the mark when it comes to a sudden change in volatility, rising or falling. Consequently, it can either give a fake signal or else generate a signal only when it is too late to trade on. Volatility is where the Variable Index Dynamic Average comes in, or VIDYA for short.
The Variable Index Dynamic Average or VIDYA was developed by Tushar Chande, and its focus is precisely on volatility. In other words, the VIDYA is an average that adjusts itself to changing volatility. When volatility is high, the VIDYA becomes more sensitive and when volatility is low, the VIDYA becomes less sensitive. That allows you to assess the trend according to current market conditions (and not irrelevant conditions that had earlier prevailed).
The VIDYA in Essence
The math behind the VIDYA formula is quite complicated, but the logic is not.
The VIDYA essentially has two components, the first being the Exponential Moving Average (aka EMA). The second indicator is in the “oscillator family” and it is known as the Chande Momentum Oscillator (aka CMO). Like most oscillators, the Chande Momentum Oscillator generates a signal of -100 and 100, with -100 being oversold and 100 overbought. The EMA is the anchor index, and the CMO’s job is to adjust the exponential average to volatility. The closer the CMO is to 100 or -100 the higher the volatility and the more sensitive our exponential average will turn. Conversely, the closer the CMO is to 0 the less sensitive our exponential average will turn. The final reading after the volatility adjustment is the VIDYA.
As you can see below, once you add the Variable Index Dynamic Average in MetaTrader you get a window with two parameters from which to choose: One is the Period CMO and the other is Period EMA. We can then decide which period the CMO will run on (and thus affect the sensitivity of our EMA) and which period the EMA will run on (to capture our trend). Usually, the best CMO to plug in is a third of the value of the EMA duration; this is to allow the latest change in volatility to impact to the greatest degree. If the CMO period is too long, it will likewise spread over the period too long and consequently fail to reflect current levels of volatility, thus defeating the VIDYA’s purpose.
VIDYA
Comparing the VIDA to the EMA
When we compare the two, we can see the clear advantages the VIDYA(Red) has over the EMA(Green). Both the VIDYA and the EMA run on a 30-week period, but the VIDYA is smoothed out by the Chande Momentum Oscillator running on a 10-week period (again, a third of the whole period). The VIDYA simply captures the trend much more accurately. We can see how, in Point A, when momentum weakens, the Variable Index Dynamic Average starts to flatten, while the EMA just moves across the price and fails to adjust.
This quality is especially beneficial when we want to get an indication if a trend has broken or not. The EMA, in this case, suggests the trend has, indeed, broken but when we look at the VIDYA we quickly get a more accurate picture. We can see that the downtrend has not been broken which allows us to prepare for another bearish round rather than mistakenly expect a rebound.
VIDYA
Of course, for every upside there is a downside and the downside of the VIDYA is that it becomes less effective on a very high duration, such as above 90. The Chande Momentum Oscillator cannot reflect sentiment very well when the duration ןד high and therefore it stops being effective at balancing the Exponential Moving Average within the Variable Index Dynamic Average. One way to tackle or mitigate this is to go higher in the intervals whenever possible, such as from days to weeks or weeks to months. Nonetheless, you should be cognizant of this in inherent weakness in the Variable Index Dynamic Average. Yet, despite that, the Variable Index Dynamic Average does a very effective job. If you are trading under volatile conditions and want to figure out if a trend is broken or set to continue, the Variable Index Dynamic Average could be the solution. When combined with other indicators of momentum, the VIDYA can give you the bigger, clearer picture.
www.onestepremoved.com
Search in scripts for "spx"
PpSignal Jurik RSXJurik RSX
Mark Jurik is a brilliant engineer and has done amazing work creating smooth, minimum lag indicators. I’ve bought a lot of his indicators and in fact I have used the Jurik Moving Average (JMA) to pre-process (smooth) data for the Better Sine Wave indicator. You can check out his website here.
emini-watch.com
www.jurikres.com
Logarithmic Fibonacci RetraceThis script will allow you to use Logarithmic (instead of linear) Fibonacci retrace.
Please see excellent write up here: www.elliottwavetrader.net
explaining why logarithmic is preferred, especially over large price movement and long timeframes.
All TradingView fib tools use linear math, and will show incorrect long-term levels because of this.
HOW TO USE:
* Enter your points for Wave 0 and 1. Example: 1810.10 and 2872.87 in the SPX chart shown.
* Turn on "show lines" and "show labels". These are OFF by default because the chart will usually get warped
if you display the lines before entering the actual values you want.
* Change the "label offset" if the fib labels are too close or too far from the chart.
Please be aware that this is considered an "INDICATOR" script and so will not save the values separately
for each chart. You will need to enter new values each time you change to a different symbol.
Logarithmic Fibonacci ExtensionThis script will allow you to use Logarithmic (instead of linear) Fibonacci extensions.
Please see excellent write up here: www.elliottwavetrader.net
explaining why logarithmic is preferred, especially over large price movement and long timeframes.
All TradingView fib tools use linear math, and will show incorrect long-term levels because of this.
HOW TO USE:
* Enter your points for Wave 0, 1, and 2. Example: 666.79, 1219.80, 1010.91 in the SPX chart shown.
* Turn on "show lines" and "show labels". These are OFF by default because the chart will usually get warped
if you display the lines before entering the actual values you want.
* Change the "label offset" if the fib labels are too close or too far from the chart.
* Select up to 2.000, 3.000, and 4.000 to display higher-power fibs.
Please be aware that this is considered an "INDICATOR" script and so will not save the values separately
for each chart. You will need to enter new values each time you change to a different symbol.
PpSignal AK_TREND ID// in a up or down trend.
// For SPX or SPY ONLY, Time Frame = Monthly, weekly or daily
// Created by Algokid 7/23/2014
// Toronto, Canada
SPY SECTOR MONEY FLOW ANALYTICSSPY AND DJI SECTOR VOLUME ADVANCE AND DECLINE
THIS CONTAINS THE KEY CONSTITUENTS OF SPY AND DJI TO HELP TRADERS TO PROVIDE HOW UNDERLYING VOLUME AFFECTS THE REVERSAL
Put/Call Ratio De-TrendedExperimenting with de-trending the various Put/Call Ratios.
Use with tickers PCCE, PCC, PCE, PCOEX, etc. Type "PUT" in the ticker field to see the many options. Use daily charts. Then you can hide the put call ratio and overlay SPX to see the signals. The default MAs are a common way to detrend. Basically takes the 10 day moving average and 127 day moving average(half year in trading days), to "de-trend" the ratio to weed out the noise that is seen in the ratio.
If you can find anything useful or interesting with this, let me know. I think it is useful as is, but if you find an interesting way to use it let me know.
Advance Decline Line NYSE-BuschiThis script shows the Advance Decline Line of the NYSE (dark blue)in comparison to the SPX (light blue). There is also a difference line of the two series (red).
Both are indexed to current values to allow a better overview. Series can be smoothed via the length of the Moving Average.
I consider it more of a work in progress. I work on a more inuitive kind of presentation.
Mean Reversion MA [acatwithwithcharts]Mean Reversion MA is an experimental WIP indicator which tracks the furthest overexpanded period up to 2000 on a given timeframe as a target for eventual mean reversion. It currently allows for plotting BBands around that period and keeps track of the MA broken on the previous expansion and mean reversion.
In order to get this to work with useful precision, it has to be limited to SMA and regular STDEV. I have not found a way to reduce the Pinescript loop time enough otherwise while maintaining much precision. Even still, it will sometimes time out and need to be refreshed by either switching TF/symbol or reapplying the indicator.
On longer TFs this can result in targets that are extremely distant. No, it’s probably not a useful prediction on the SPX monthly chart that the selloff in 2009 suggests an eventual mean reversion to the 1250 SMA (currently around 358). The last time we had a monthly mean reversion on that chart by this indicator’s telling is 1970. So, use some common sense about how far out is a usefully-tradeable prediction. I’m hoping to find a good way to add functionality to put a cap on extreme long TF predictions without breaking it.
Where it really seems to shine is as a reactive pivot after apparent reversals. Significant trending more or less by definition requires overexpanded volatility on some period length.
I am posting this as invite-only and have a short list of collaborators in mind who will get access if they want it. It is not being made available to the general public as of this posting; I’m vaguely working towards eventually offering being able to offer some sort of paid indicator offering in the future.
Rather than shut the door entirely, I will say that if someone approaches me by PM with a really interesting idea on how they’d like to test this or my other indicators, I’m willing to consider giving access. I’m not giving this away just to anyone who asks and will, for my own time and sanity, probably just ignore requests by people who don't come to me already knowing what this indicator does and how they might want to use it.
Trend Scalping Strategy - ForexHi all,
I have created the attached strategy for my own use primarily but thought I would share it as my experience to date is that it is profitable in particular circumstances, so thought I would open this out to the community to see if it can be successfully applied on any other pairs and timeframes.
I have protected the source code at this time - mainly because it needs massive tidying up! If I ever get time to do this then I will
The concept of the strategy is based upon the slingshot method - the strategy fundamentally does the following:
- Tests each candle for a new short term trend based upon EMAs
- If there is a new trend, check the RSI and ensure it isnt above the upper RSI threshold (for long positions) and below the lower RSI threshold (for short positions)
- If it passes the RSI check, entry is valid and draws a bar on the chart to show the opening entry position, stop loss position, take profit 1 and take profit 2 positions.
I have backtested this across 28 pairs on the M15 timeframe, comprising of a total of 140,000 candles (35,000 hours of trading). Across this period, 18 of the 28 pairs I looked at were profitable, with overall significant profit if live traded across the 28.
I have live tested 5 pairs on the same timeframe:
- GBPJPY
- GBPUSD
- GBPEUR
- CADJPY
- EURJPY
These pairs have to date given a rough ROR (Return on Risk) position of approx 60% average per trade.
All of the above has been done with the following inputs:
- RSI Upper - 68
- RSI Lower - 32
- Stop Loss - 0.0015
- TP1 - 0.002
- TP2 - 0.004
The SL and TPs are based on a decimal entry of a percentage movement - i.e. the Stop loss above reflects a 0.15% movement, etc etc. Obviously if this were to be tested on longer time frames it is likely that these would need to be larger figures.
I have also tested this live with great success on the S&P 500 and the FTSE, with the following settings:
Indicator Timeframe TP1 TP2 SL Upper Lower
FTSE M5 0.0015 0.004 0.001 70 30
SPX M5 0.0015 0.004 0.001 75 35
Three key notes on trading this below - THESE ARE VERY IMPORTANT!
- This is NOT a high strike rate strategy. Strike rate on profitable pairs is between approx 45 and 55% (although I have seen as low as 35% and still seen significant profit). This has two natural conclusions - risk management is VITAL (I risk 0.5% on each trade, but this may in fact be high for this strategy), and be prepared for potentially significant drawdowns. I have seen certainly drawdowns of 20 consecutive losing trades (counting TP1 and TP2 as 2 trades) and probably longer, which obviously means drawdowns of 10% or greater. The other thing to bear in mind is that with this kind of strike rate, you shouldnt be setting TP1 at a 1:1 risk reward or lower.
- Take Profit 1 is easy - straight Stop and Limit orders. Take Profit 2 is a trailing stop with a start point of the limit for TP1, with then a trailing stop of this distance. This means that should you win on TP1, TP2 is a risk free trade but also trails in for profit if TP2 isnt reached (which it normally isnt). DO NOT set TP2 as a standard stop and limit, this rapidly makes this strategy unprofitable. The point here is that if you reach TP1 you are in some form of trend where you want to capture as much profit as you can.
- Do not enter a trade mid candle. The strategy is based upon the close of the trending candle not the "live" price during this candle, so no need to rush into a trade. If you enter mid candle you will find more often than not that the indicator wasnt for a valid trade by the candle close.
Also, standard disclaimer - past performance is no guarantee of future performance, and if you choose to use this strategy/indicator you do so 100% at your own risk. As a minimum, pick your pairs carefully - I have found particular unprofitability with this strategy with the AUD and NZD pairs so I have ruled these out completely at present, although with different timeframes and inputs these may of course be profitable.
I hope this is helpful for someone...I'd welcome any feedback or other setups where this is profitable.
Moving forward, I want to do some more work on this strategy to rule out some of the more negative trades, and I primarily intend to do this using pivots - however this will be an as and when I get chance.
Trend Reversal Alert Hybrid [T.R.A.H]This is extention of a hybrid of AlPos-Trend-Highlighter with Peaks and Bottoms Detector from All Time Fibo Channel .
It is a visualizer of Reversal Points and Trend Lines for the series of a T-R.A.S strategies that are available in my scripts.
* Note : I ended up frustrated, I must say, because when I run my strategy it works perfect, but when I add this visualizer and turn it into strategy for some reason that is beyond of my understanding of pinescript, results are different. I tried everything I could, but in the end decided to make two separately working scripts that one is an indicator and the other one is a strategy. And it's working that way WTH!?!?!? for some reason in SPX lime and aqua lines showed displaced from candles, but when you use it on crypto seems working perfect. Might be a difference in data.. Anyway, please test and comment.
TTM Squeeze RibbonTTM is based on Greeny TTM, so not strict style (Yet).
TTM has multiplier and is by default set to 12 times the length of a standard TTM (12x 20 candles). So on 2h candles, it will show equivalent of 24hr TTM.
This is done to increase sampling rate for higher resolution curves.
**MAIN OSCILLATOR**
Teal and Pink line is the Main Momentum Oscillator, and behind it is the ribbon showing Momentums 2x, 3x, 4x, ... to 12x slower than Main Oscillator.
**SLOW TREND LINE**
The thick white line is the sample average (not time based moving average) of all the ribbons eg (osc1 + osc2 + osc3 ... + osc12)/12 and the thinner white line is a moving average of the thick line, to give cross over and show longer trend.
**ACCELERATION LINES**
The yellow to red to brown lines are the Momentums shorter than the Main oscillator eg x/2, x/3, x/4 and show the Acceleration of Main Oscillator, Above Zero is positive acceleration of Main Osc and the thick lime green line is the sample average of these lines.
**MAIN ACCELERATION LINE**
The lime green usually diverges with price when bottoming or topping of momentum is building and will show the change in Momentum in greater detail than just a Momentum Oscillator alone. The line leads the momentum oscillator, and When it crosses zero that means momentum has officially changed from one direction to another.
Since the lime green line is sample average of multiple lines, it changes direction more sharply than just a single oscillator line.
**PUMP BAND**
The dark green line with red outline is a bollinger band applied to the lime green line acceleration line. It shows squeezing when the lime green line is consolidating and blows out when the lime green line becomes volatile and makes a move in whichever direction.
**TTM SQUEEZE**
The dots show 4 squeezes on multiple time frames, but is not multiplied by 12x like the oscillators. Eg, the smallest dot on 2h candles is for 2h, but momentum as explained above is multiplied by default 12x so it is 24h. Th squeezes are multiples ranging from 1x (small black square), 2x Larger white square, 3x larger black square, 4x largest white square.
**SETTINGS**
The multiplier can be changed, so setting to 1x will be the same as regular TTM, but resolution will be greatly reduced. 12x seems good.
Thiccness just makes the lines thicker if you are using 4K screen or Mobile phone you can adjust to what looks good.
Im still learning how to use this and plan to make more changes so experiment and see if you can read the patterns. Hopefully that all made sense good enough.
Good ones to try is, BNB on 2h, SPX on 3d, BTC on 2h, VIX,
Enjoy and let me know what you think, only sharing this with few people for now
Dollar / Stocks Correlation OscillatorMakes visual the theory that "a strong dollar is bullish for equities/stocks"
...but oh man, these two are definitely not that strongly correlated.
What's the deal with that? Still learning. Glad for any comments.
Gold CorrelationsGold has correlations with many trading pairs such as silver, oil, euro, yen, usd, aud, spx, nekkai and many more to go.
In this script i have added GOLD, SILVER, currency of US, EUROPE and JAPAN.
NOTE : More corelations will be added soon.
The corelations will ranged from 0 to 100 denoting the strength.
It is an modified indicator. To be more precise, the raw data is converted to unbounded range according to their strength and then converted to bounded range of 0 to 100.
HOW TO USE
As we can see in the first vertical black line, US started going up and after the second vertical black line, Gold, silver, Europe, Japan started to go downwards.
We can see a nice correlation and call it a nice short.
In future will be adding more correlations.
Relative StrengthRelative strength is a ratio between two assets, most often a stock and a market average (index). This implementation uses the method described here and the second method described here to calculate its value: "To calculate the relative strength of a particular stock, divide the percentage change over some time period by the percentage change of a particular index over the same time period". This indicator oscillates around zero. If the value is greater than zero, the investment has been relatively strong during the selected period; if the value is less than zero, the investment has been relatively weak. The period and the comparative symbol can be set in the settings for the indicator (the defaults are 50 and SPX), there you can also find an option to turn on a moving average.
Relative StrengthCompare the strength of the current stock to a benchmark (default SPX).
Includes a SMA (default 13 weeks/3 months).
Best used on the weekly time frame.
yield spreadCalculates the spread between the projected yearly returns of the S&P 500 and 10-year Treasuries. This indicator only works for SPX charts.