Categories
Uncategorized

Using the Herrick Payoff Index and Channel Breakout on Close Indicator for Trading Opportunities

A system combining technical indicators for early warning signs of trend changes

The Herrick Payoff Index (HPI) is a complex formula that evaluates changes in price, volume, and open interest. HPI measures the flow of money into and out of a market.

Because its calculation includes open interest, HPI can only be used for futures and not for stocks. Another restriction of the HPI is that it can only be applied to daily data because there is no such thing as intraday or weekly open interest.

HPI can be used to confirm price action. When HPI rallies to a new high along with a new price high, volume (the number of contracts that change hands during a specified time period) and

open interest are confirming the bullish price action, and when HPI falls to a new low along with a new low in price, volume and open interest are confirming the bearish price action.

( I remind you that if you want to download the entire strategy you can find it at the bottom of the article, just join the Telegram channel )

However, when a new price high is accompanied by the failure of HPI to also make a new high, the price action is not confirmed by volume and open interest. A bearish divergence exists between the higher price high and the lower HPI high. Similarly, when a new price low is not matched by a new HPI low, the price action is unconfirmed by volume and open interest, and a condition of bullish divergence exists.

Bullish and bearish divergences are early warning signs of a possible change in trend. HPI confirmation of new price highs and new price lows suggests that the current trend is more likely to continue than to reverse.

Another component of this system is the channel breakout on close. When a market closes above the highest high of a specified number of bars, price action is bullish, and when a market closes below the lowest low of a specified number of bars, the market is bearish.

A system combining the Channel Breakout on Close Indicator and the Herrick Payoff Index should alert us to good trading opportunities. After a bullish setup, we’ll enter long at the high of the setup bar plus one point, and after a bearish setup, we’ll enter short at the low of the setup bar minus one point. The setup remains in effect for five days after the setup bar.

Our initial stop and trailing stop when long will be at the four-day low, and our initial stop and trailing stop when short will be at the four-day high. We’ll exit long positions on the close when HPI crosses below zero and exit short positions on the close when HPI crosses above zero.

Defining your Trading Rules

In this system, we defined both long entries and short entries as well as exit orders. We also did some setup work to calculate the Channel Breakout on Close Indicator and the Herrick Payoff Index, as well as their to compare them. The setup, entries and exits are described next.

Setup

Calculate the HPI values.

Look for confirmation of bearish price action by consistency between the closing price and the HPI. The closing price will be lower than the lowest low of the last 10 bars and the HPI will be lower than the lowest HPI of the last 10 bars. This is our sell setup.

Look for confirmation of bullish price action by consistency between the closing price and the HPI. The closing price will be higher than the highest high of the last 10 bars and the HPI will be higher than the highest HPI of the last 10 bars. This is our buy setup.

Long Entries

After a bullish or buy setup, we’ll enter long at the high of the setup bar plus one point.This setup will remain in effect for five days after the setup bar.

Short Entries

After a bearish or sell setup, we’ll enter short at the low of the setup bar minus one point. This setup will remain in effect for five days after the setup bar.

Exit Orders

Our initial stop and trailing stop when long will be at the 4-day low, and our initial stop and trailing stop when short will be at the 4-day high.

We’ll also exit long positions on the close when HPI crosses below zero and exit short positions on the close when HPI crosses above zero.

Designing & Formatting

This section presents the EasyLanguage instructions and formatting for the system, with the EasyLanguage instructions broken down and explained line by line.

( I remind you that if you want to download the entire strategy you can find it at the bottom of the article, just join the Telegram channel )

Inputs

Following is the list of all the inputs we used in this system:

In addition to these inputs, we define the following variables (notice that our variables CountL

and CountS are initialized to 5):

Vars: HPIVal(0), CountL(5), CountS(5);

Setup

We begin by calculating the HPI value using the HPI function and a contract value of 100 and a smoothing factor of .1. We store the resulting value in the variable HPIVal.

HPIVal = HPI(Mult, Factor);

Then we perform four comparisons and store the results in four different variables, Condition1 through Condition4. First, we check to see if the close of the current bar is greater than the highest high of the last 10 bars. We store the result in Condition1. Then we check to make sure the value in HPIVal is greater than the highest HPIVal value for the last 10 bars and make sure HPIVal is greater than zero. The result is stored in Condition2.

Next we check to see if the close of the current bar is less than the lowest low of the last 10 bars. We store the result in Condition3. And finally, we check to see if HPIVal is less than the lowest HPIVal value for the last 10 bars and make sure HPIVal is less than zero. The result is stored in Condition4.

Condition1 = Close > Highest(High, Length)[1];

Condition2 = HPIVal > Highest(HPIVal, Length)[1] AND HPIVal > 0;

Condition3 = Close < Lowest(Low, Length)[1];

Condition4 = HPIVal < Lowest(HPIVal, Length)[1) AND HPIVal < 0;

We use two counters, CountL and CountS. We increment these with each bar and reset them to 1 each time a buy setup or sell setup occurs, respectively. This way, we can keep a count and use them to keep buy and sell orders active for 5 bars:

CountL = CountL + 1; CountS = CountS + 1;

If the criteria specified in the conditional statements above, as appropriate, are true and the variables CountL or CountS is greater than 5, then CountL or CountS is reset to one. Since the buy or sell setup criteria is true, we want to place buy or sell orders, respectively, therefore, we need to set the counters to 1 so the next set of instructions are carried out.

If Condition1 AND Condition2 AND CountL > 5 thenCountL = 1;

If Condition3 AND Condition4 AND CountS > 5 thenCountS = 1;

Long & Short Entries

If the CountL variable is less than or equal to 5, a buy stop order is generated at the high of the setup bar plus 1 point. If the CountS variable is less than or equal to 5, a sell stop order is generated at the low of the setup bar minus 1 point.

If CountL <= 5 then Buy Next Bar at High[CountL] + 1 Point Stop;

If CountS <= 5 then Sellshort Next Bar at Low[CountS] — 1 Point Stop;

Long & Short Exits

A trailing stop for long positions will be placed at the lowest low of the last four bars. Conversely, we will place a trailing stop to cover our short positions at the highest high of the last four bars.

Sell Next Bar at Lowest(Low, 4) Stop;

Buytocover Next Bar at Highest(High, 4) Stop;

Additionally, the system will generate a long exit on the close of the current bar if the HPI value falls below zero. A short exit on the close of the current bar will be generated if the HPI value rises above zero.

If HPIVal < 0 then Sell this bar on Close;

If HPIVal > 0 then Buytocover this bar on Close;

Testing & Improving

Below I will show you the performance on some underlyings, of course the parameters have been optimized but they are not finished strategies, you will find the whole strategy on my Telegram channel so you can download it for free!

Now it’s your turn! I’ll leave you the complete strategy, let me know what you can do!


Buy my 👉 Trading Systems

Join the 👉 Telegram group

Follow me on 👉 LinkedIn

If you want discounts for the platform I use contact me privately or buy via this 👉 MultiCharts