TradeStation ShowMe and PaintBar studies for identifying and quantifying divergences between pairs of data series.
I wrote these studies with the intention of applying them to the S&P500 and the VIX, however they may be applied to any pair of data series.
To use, load a minute chart window with the SPY as data1 and the VIXY as data2. Make sure both series have the same bar settings ( ie, 5 minute and 5 minute ).
The paint bar study has a slightly weakened algorithm in order to give the viewer a “heads up” that the show me indicator may signal.
The example chart is 5 minute from 9/8/2015
Interpretation
A green dot under a bar is a long signal. It means the VIX is falling at a relatively greater quantity than the S&P is rising.
A red dot above bar is a short signal. It means the VIX is rising at a relatively greater quantity than the S&P is falling.
The studies work as follows:
The data series for data2 ( the VIX in our example ) is inverted by calculating the reciprocal of the close ( 1/close). This effectively flips the chart upside down.
The natural logarithmic returns for data1 and data2 are calculated and stored in a pair of data series for each.
The difference between the returns series are run through a pair of RSI oscillators in order to discover progressive divergences between them.
Change Log
2015-09-08 - Added support to automatically label the plots.
2015-09-14 - Speed enhancements. Reduced 5 loops through the correlation period to 1 loop.
The atgPairsCorrelation indicator plots the correlated logarithmic returns of two data series.
Thanks to @Oysteryx for helping me make this indicator.
The inputs to the indicator are standard price series data. The indicator internally generates the logarithmic returns and calculates and plots the correlation between them. The value ranges between -1 and +1. A positive value means that the two data series are correlated ( moving together ) while a negative value means they're moving in opposite directions. The magnitude of the value expresses the fidelity of the correlation. A value of 1 is achieved if you compare an instrument with itself.
In addition to comparing pairs of data series, special functionality is included that allows you to compare with an interest rate spread.
A template to load the indicator as displayed in the screen shot is available on the support thread. The template displays the correlations of the following instruments:
ES -> ZN/ZT spread
ES -> 6J
ES -> CL
ES -> GC
ES -> ZB
ES -> 6A
ES -> 6E
It’s assumed that the primary data series loaded on the chart is one of the two data series to be correlated. The chart series is always compared with one other series that the indicator loads internally. You may of course use any data series you want on the chart and in the settings for the indicator to run correlation studies on pairs of interest to you.
To use the template (see support thread ) load it on a chart of the ES with at least 365 days of daily data. This template loads 7 instances of the atgPairsCorrelation into a single chart panel so that their plots are overlaid.
Here are some basic property settings to configure the indicator to compare the ES to the 6J contract ( USDJPY futures contract ):
You must maintain the property settings for each instance so that the contract months are current.
Spreads
For running a correlation on an interest rate spread you must enter the two instruments involved in the spread into SpreadLeg1 and SpreadLeg2. In addition you must enter weights for each leg of the spread. the CME publishes these weights here:
Draws a horizontal line at the current price which changes as price changes. A + or - offset in ticks from current price can also be applied. Has the added feature of drawing lines for the current Bid and Ask, but by default these lines are not displayed. The line styles are controlled using the Lines section listed within the indicator's settings/parameters dialog.
This indicator is a Walk Forward Optimizer for a pair of moving averages. The moving averages in this case is the Ahrens Moving Averages that I have previously posted in the elite section. Pay attention to the output window as I print the results of the optimization there.
HOW IT WORKS
At the beginning of each session it will optimize the two variables (Moving Average Periods) for the last three sessions and draw the optimized moving averages for the current session. So the optimized variables are never tested on the current session that it is being drawn. Optimized prices takes place after the moving average cross on the open of the next bar.
I used the walk forward method to avoid CPU lag and massive curve fitting.
It works only on minute charts at the moment, but i am exploring solutions for other chart types.
This is a variation of Gordos "Better Line Break".
The difference: the "Real Line Break" uses the close of the last bar as open. This gives a more realistic chart and backtesting results.
Install via "Import Ninja Script".
(The code uses "Custom6" as ID. Change the value, if you already have an bar type with this number.)
Version 1.
Here is an indicator to customize Ninja's ChartTrader. It allows you to customize the layout and visibility of the 8 standard order control buttons. Additionally when a position is open, it will hide all of those ChartTrader buttons as well as disabling the right-click context menu choices for buy and sell.
It helps to reduce distractions and allows one to focus on a single order, which some may find useful, as I have.
I want to recognize those who posted the code that helped me put this together. Thanks to @SilverDragon for the code to customize layout and visibility of the buttons. You can find a more thorough explanation plus a great video in his post at https://nexusfi.com/elite-circle/25463-customize-chart-trader-buttons.html#post295057. Also thanks to @ninjatrader_Bertrand for the nice trick on determining market position from within an indicator.
Note that any chart on which this indicator is running will have it's ChartTrader buttons hidden and context menu buy/sell choices disabled whenever there is an open position on any instrument. This is beta 1.0.01. For educational purposes only. Use at your own risk.
This indicator add signals and Alerts (Text to Speech) for the following Point & Figure Patterns:
Triple Top
Ascending Triple Top
Spread Triple Top
Upside Symmetric Triangle
Upside Breakout of Bullish Resistance Line
Upside Breakout of Bearish Resistance Line
Ascending Triangle
Bullish Catapult
Triple Bottom
Descending Triple Bottom
Spread Triple Bottom
Downside Symmetric Triangle
Downside Breakout of Bullish Resistance Line
Downside Breakout of Bearish Resistance Line
Descending Triangle
Bearish Catapult
January 23rd, 2016 01:06 PM bobc635 Hey Sody, thanks... will look at it. I just started watching PnF on the CL contract after studying some of the Strategy
Lab Wide Range Body and WRB Hidden Gap concepts. The lack of PA constraint of the PnF seemed to make a lot of sense.
I built an indi to show the Wide Range Body and Hidden Gap.... see what you think...
Thanks for this one....
Bob
June 20th, 2015 12:15 PM jmagaia I do not pro in Ninja, but I do not understand why the reference is not zip file.
Or put in zip and copy to same directory that the *.cs??
I put this work, with the discussion link in forum. but not easy for amateur's like me.