trading

Creating custom blocks from SR Percent Rank

SR Percent Rank

First, let’s explain how SR Percent Rank works. The indicator makes a loop over x bars into the past and calculates the percentage of times the current closing price has been between the high and the closing price in the x bars before that.

Thanks to this, we can determine the percent rank of current close price occurrences in the range of past prices and assume that we are in the support, resistance, or breakout zone.

 

The indicator has two modes:

  1. Percentage occurrence of current close between high and low X bars back
  2. Percentage occurrence of current close between high + Current ATR and low – Current ATR X bars back.

 

There are four predefined conditions

  • SR Percent Rank is above/below the level
  • SR Percent Rank is above/below the level for X bars

 

SR Percent Rank as a breakout indicator

 

 

In the above image, you can see the SR Percent Rank on the EURUSD chart with the indicator setting Mode = 2, LookBack Period = 120 bars, and ATR with a period of 120.

If the SR Percent Rank falls to values close to zero, this means that the current closing price has not moved in this range in the past and we are therefore in a breakout situation.

 

These situations are defined by the condition SR Percent Rank is below level, which is part of the default building blocks in StrategyQuantX.

From the above figure, we can also see that SR Percent Rank is a not – symmetric indicator. This means that in order to determine in which direction the breakout occurs, another indicator is required.

 

Good candidates may be:

  • Hull Moving Average
  • KAMA
  • Ulcer Index

 

In the chart below you can see the combination of SR Percent Rank and Hull Moving Average.

 

In StrategyQuantX / Algo Wizard in custom blocks, this block will look like this:

 

 

  1. We have created two symmetric blocks SRPrcHullDown and SRPrcHullUP
  2. We created them from two existing conditions – SR Percent rank is below X and HMA is rising
  3. We parameterized the SR Percent Rank lookback period and the HMA period

 

SR Percent Rank as an indicator of mean-reverting market

 

If the SR Percent Rank moves a higher value or rises over a longer period of time, it means that the price is in the range of past prices.

 

From this assumption, we can draw two conclusions

 

  1. The price will continue to oscillate.
  2. The price is preparing for a breakout

 

 

In the above chart, we can see that when SR Percent Rank was at higher levels for a longer time, the price tended to fluctuate. Then a breakout occurred, the SR Percent Rank dropped to levels close to zero. This situation is repeated two times in the above figure.

 

This situation is captured by the predefined condition block SR Percent Rank is above the level for X bars.

 

Trading Mean Reversion is not easy, generally, oscillators help in such situations:

  • Laguerre RSI
  • Stochastic
  • RSI

 

In the following chart, we can see how the combination of SR Percent Rank is above the level for X bars, and Laguerre RSI might look on the chart.

Combine the Custom block in StrategyQuantX AlgoWizard as follows:

 

結論

Custom blocks allow you to create the basic building blocks of your future strategy, which you can build directly in Algowizard or StrategyQuantX Builder. We believe that the more targeted and specific the blocks you use, the lower the risk of overfitting.

 

クローネックス / イヴァン・フーデツ

イヴァン・フデツ — フォーラム上の「クロネックス」

私は15年間トレードを続けており、2014年からStrategyQuant Xを活用してシステムを構築しています。 現在は主に3つの活動を行っています。自動取引戦略の開発と実戦テスト、SQX本体をカスタムインジケーターやスニペット、機械学習やクオンツ研究のためのPythonツールで拡張すること、そして他のトレーダーが、私がこれまで経験してきたような長年にわたる高価な失敗をせずに、より早く目標に到達できるよう支援することです。.
ほとんどのリテール向け戦略はバックテストでは素晴らしく見えても、実運用では崩壊します。私の仕事はその逆です。すなわち、誠実で、検証済みであり、リアルマネーを託せるほど頑健な戦略です。そのプロセスにおける良い点、醜い点、そして誰も語らない過剰適合について、私のサイト(algotrading.space)で書いています。.
バリデーションやカスタムSQXの開発、データとコードを活用した本当のエッジ構築についてさらに深く掘り下げたい場合は、そこでそのすべてを共有しています。.  www.algotrading.space

1 コメント
最古の
最新 最も投票された
イーストピース
イーストピース
6. 6. 2021 12:24 pm

current closing price has been between the high and the closing price in the x bars before that.

→current closing price has been between the high and the low price in the x bars before that.

It’s like inside bar occurrences. The higher value means convergence, and lower value means strong trend.

続きを読む