Consecutive count backtester / quantifytools- Overview
Consecutive counting is a simple method to mechanically define trending states to the upside and downside. Consecutive counts are calculated by taking reference price level (e.g. close 4 candles ago) and count closes above/below it up to a maximum count that resets the consecutive count back to 1. This tool provides the means to backtest each count by measuring % change in price after each count (e.g. % gain 2 candles after a given count).
Users can define reference source that starts the consecutive count (e.g. close 4 candles ago), maximum count where counter resets (e.g. after 9th count) and backtesting period (e.g. price change 2 candles after count).
Filters add extra conditions that must be met on the consecutive count to qualify as valid, which are also reflected on the backtest metrics. The counts can be refined using the following filters:
- RSI above/below X
- Price above/below/at moving average of choice
- Relative volume above/below X
Average gain corresponding to each count as they occur can be toggled off for less clutter. Average price change can also be visualized using candle color. Colors, gradient and table/label sizes are fully customizable.
- Practical guide
Example #1: Identify reversal potential
Consecutive counting is a simple yet effective method to for detecting reversals, for which 7-9 counts are traditionally used. Whether that holds true or not can now be put through a test with different variations of the method as well as using additional filters to improve the probability of a turn.
Example #2: Identify trend following potential
Consecutive counts can also have utility value for trend following. When historical short term change is to the downside, expect downside, when to the upside, expect upside.
Consecutive
Candles - 2 or 3 consecutive pattern + Custom pips thresholdFEATURES:
- Detect a 2 or 3 consecutive candlestick pattern. Input the value into the first input value.
- Choose the minimum and the maximum amount of pips of the candle that you want to detect. The indicator will detect candles within that pips range and highlight the consecutive pattern
- Choose to not use the pips threshold. If disabled the indicator will constantly check for consecutive candles pattern.
- Choose if calculate pips taking into consideration OC (Open - Close of candles - Body) or HL (High - Low - Body + Wick)
VISUALS:
- Enable Boxes: when enabled a box is drawn around the pattern detected
- Enable Lines: when enabled lines from top/bottom/mid of the boxes are drawn
- Extend the lines
BuP = Bullish Pattern
BeP = Bearish Pattern
AIM:
The aim of the indicator was to spot 2 common patterns in one indicator: Three White Soldiers and Three Black Crows
The rest is all implementation because I like coding.
Anyway on all timeframes 3 consecutive candles with a similar body length seems to be an alarm that Market Makers are joining the gfame before a major manipulation so it worth keep an eye on those.
From my experimentation from ltf 1 minute timeframe to htf 1H timeframe, 3 consecutive candles with a body length between 10 and 20 pips could be the ones to keep an eye on before a reversal or a strong continuation.
For sure they are zonez and levels where MM would come back later.
Adjust the settings as you want and happy trading!
This is just an indicator nothing more
Consecutive Unswept Lower Highs/ Higher Lows CounterCounts consecutive Lower Highs and Higher Lows; number resets to zero when previous pivot high or low gets swept
-To help give an idea of when a retracement / run-on-stops may be overdue. i.e. the higher the counter number grows, the longer we've gone without a proper retracement.
//inputs//
~pivot lookback/lookforward: increase this for more significant pivot highs and lows.
~number of pivot high 'counter' labels (pairs) to show in history.
~formatting options.
Consecutive positive/negative candlesConsecutive positive/negative candles
Shows the consecutive negative or positive candles
Determine Consecutive Candles█ OVERVIEW
This is a simple script that will plot labels over or under candles to show where there had been consecutive candles that closed in a similar fashion. This script was inspired by a Tweet about Bitcoin experiencing its first 7th-consecutive weekly black candle and I sought out to test that.
█ INPUTS
There are three inputs for this script.
"offset" ( integer ) - (Can be 0 or 1) Allows the user to apply this script at the currently closing candle or the most recently closed candle.
"Number of Candles" ( integer ) - (From 3 to 100*) Allows the user to select how many candles to back test for consecutive-ness.
"Black or White" ( boolean ) - Allows the user to select what kinds of candles to look for in this script. (true - Black , false - White ).
*Publishing open-sourced, this selection was arbitrary and can be modified at will.
█ USAGE
Because I had created this in a little over an hour, this is just a simple experiment that I wanted to share with others. Its applications are unknown to me, but I am interested in hearing how others may find what this script does useful.
Consecutive Up and Down BarsOVERVIEW
Identify price thrusts made up of at least three consecutive bars that conform to specific criteria. (E.g., consecutive higher closes)
Depending on the context, these powerful thrusts can indicate emerging momentum or exhaustion. This indicator helps to mark these thrusts for further analysis.
CONCEPTS
As mentioned, these consecutive bar thrusts can indicate:
Momentum in the direction of the thrust; or
Exhaustion, implying possible short-term reversal or sideways action.
In the first case, we can track these patterns and their followthrough to determine changes in the market trend.
In the latter case, we can consider an entry by fading the pattern or use it for profit-taking. Price patterns like the Three-Bar Pullback are based on such premises.
There are different conditions used when looking for such consecutive bars. Hence, it's helpful to toggle the conditions while studying this pattern to see which ones work well with your trading approach. This is the primary purpose of this indicator.
This indicator looks for three consecutive bars that conform to the selected condition(s).
These are the conditions you can toggle in this study:
1. Bullish or Bearish Bars
A bullish bar closes higher than it opens. (Green candlestick)
A bearish bar closes lower than it opens. (Red candlestick)
2. Rising or Falling Closing Prices
This condition compares each closing price to the previous closing price.
3. Up or Down Bars
An up bar has a higher high and higher low compared to the previous bar.
A down bar has a lower high and lower low compared to the previous bar.
HOW TO USE
Display
The display is oriented towards traders who are looking to fade these consecutive bars.
Consecutive bars that push higher are marked with a down arrow above the bar.
Consecutive bars that push lower are marked with an up arrow below the bar.
In this implementation, as we are looking for at least three consecutive bars, the arrow marking starts from the third bar of the pattern.
Parameters
Toggle the different conditions that apply when marking consecutive bars. (Conditions as explained above)
Current Close vs. Current Open
Current Close vs. Previous Close
Current High and Low vs. Previous High and Low
You can select one or more of the conditions. By default, all are selected. (If all are unselected, it will mark every single bar and render the study useless.)
Up/Down Long StrategyThis is a consecutive bar up/down strategy for going long only where you can specify how many bars up to buy and how many bars down to sell. It also has code to check and make sure the condition is still true when launching the official alert, which helps back testing and live results line up, however be sure to enter commission and slippage into the properties to accurately reflect profits. I added back testing date ranges to this so you can easily pull up and see back tested results for a certain date range. I also added a buy and sell message fields in the properties so you can launch alerts that will work with automated trading services. Simply enter your buy message and sell message into those fields in the properties and then when you create an alert enter {{strategy.order.alert_message}} into the alert body and it will dynamically pull in your buy and sell messages when it fires alerts.
Up/Down StrategyThis is a consecutive bar up/down strategy where you can specify how many bars up to buy and how many bars down to sell. It also has code to check and make sure the condition is still true when launching the official alert, which helps back testing and live results line up, however be sure to enter commission and slippage into the properties to accurately reflect profits. I added back testing date ranges to this so you can easily pull up and see back tested results for a certain date range. I also added a buy and sell message fields in the properties so you can launch alerts that will work with automated trading services. Simply enter your buy message and sell message into those fields in the properties and then when you create an alert enter {{strategy.order.alert_message}} into the alert body and it will dynamically pull in your buy and sell messages when it fires alerts.
xGhozt Consecutive Candle CountxGhozt Candle Count simply counts consecutive positive or negative candles, and allows you to get the live statistics of how many times this consecutive candle series occurred in the past, with the probabilities of the next candle to be a reversal, and the average past gains from that reversal. You can select the number of consecutive candles you're tracking, and select a start and end date. When your desired pattern is met by the indicator, it will indicate you on the chart if it's worth shorting or longing the next candle.
Sequential Filter - An Original Filtering ApproachRemoving irregular variations in the closing price remain a major task in technical analysis, indicators used to this end mostly include moving averages and other kind of low-pass filters. Understanding what kind of variations we want to remove is important, irregular (noisy) variations have mostly a short term period, fully removing them can be complicated if the filter is not properly selected, for example we might want to fully remove variations with a period of 2 bars and lower, if we select an arithmetic moving average the filter output might still contain such variations because of the ripples in the frequency response passband, all it would take is a variation of high amplitude for that variation to be clearly visible.
Although all it would take for better filtering is a filter with better performance in the frequency domain (gaussian, Butterworth, Bessel...) we can design innovative approaches that does not rely on the model of classical moving averages, today a new technical indicator is proposed, the technical indicator fully remove variations lower than the selected period.
The Indicator Approach
In order for the indicator output to change the closing price need to produce length consecutive up's/down's, length control the variation threshold of the indicator, variations lower than length are fully removed. Lets see a visual example :
Here length = 3, the closing price need to make 3 consecutive up's/down's, when the sequence happen the indicator output is equal to src , here the closing price, else the indicator is equal to its precedent value, hence removing other variations. The value of 3 is the value by default, this is because i have seen in the past that the average smallest variations period where in general of 3 bars.
Because the indicator focus only on the variation sign, it totally ignore the amplitude of the movement, this provide an effective way to filter short term retracement in a fluctuation as show'n below :
The candle option of the indicator allow the indicator to only focus on the body color of a candle, thus ignoring potential gaps, below is an example with the candle option off :
If we activate the "candle" option we end up with :
Note that the candle option is based on the closing and opening price, if you use the indicator on another indicator output make sure to have the candle option off.
Length and Indicator Color
The closing price is infected by noise, and will rarely make a large sequence of consecutive up's/down's, the indicator can therefore be useful to detect consecutive sequence of length period, here 6 is selected on BTCUSD :
A consecutive up's/down's of period 6 can be considered a relatively rare event.
It is important to note that the color of the indicator used by default has nothing to do with the consecutive sequence detected, that is the indicator turning red doesn't necessarily mean that a consecutive down's sequence has occurred, but only that this sequence has occurred at a lower value than the precedent detected sequence. This is show'n below :
In order to make the indicator color based on the detected sequence check the "Color Based On Detected Sequence" option.
Conclusion
An original approach on filtering price variations has been proposed, i believe the indicator code is elegant as well as relatively efficient, and since high values of length can't really be used the indicator execution speed will remain relatively fast.
Thanks for reading !
Consecutive Candle Count Momentum StrategyVery simple strategy based on consecutive candle count. Simple but can be very profitable if you know how to execute.
Example:
- Buy when consecutive up closes exceeds 3
- Sell when consecutive down closes exceeds 3
For a buy signal, if price closes higher within 5 candles, it is defined as a win.
For a sell signal, if price closes lower within 5 candles, it is defined as a win.
Win rates for buy/sell signals are calculated over history of security.
Sathya: Short the highShort the High
This script has been developed as a professional service and is published only for customer verification/acceptance.
If you are interested in development services, either PM me or visit the Backtest-Rookies website (.com)
Summary
This strategy will attempt to take a short position within a time window only after X consecutive up days. Once X consecutive up days have been detected, two windows will open up. The first window tracks the high of the day. The second window will attempt to short the high of the day if price retests it.
Features
Tracking of consecutive up days using intra-day data
Opening a trade window when consecutive up days are detected
Tracking the high of a sub-session (user definable)
Shorting the high during a second sub-session (user definable)
Stop losses and take profits
End of sub-session close out option.
Buffer range from high of the day. So price does not need to retouch the high but can come with x rupees.
Background coloring of sub-sessions so it is easy to track trades
Alex: ConsUD Alert indicatorCustom strategy that was developed for a Backtest-Rookies development service customer. Published for verification, testing and acceptance.
If you are interested in development services send me a message or visit the backtest-rookies (.com) webiste for more information
Consecutive Up/Down Days - Custom Indicator
The indicator builds upon the built-in consecutive up/down days strategy script but with some additional features:
The strategy has been converted to an indicator
Alerts have been added for entries
Position Simulation: Entry signals only happen once per long / short direction.
Plot real high / low candle data (the script is assumed to run on Renko candles)
Plot real simulated entry price at the open of the bar following an entry signal
Plot an EMA
Brandon: Fractals MKIICustom Indicator development published for customer verification and acceptance.
Features
Generate buy / sell signals if x number of candles following a fractal are up/down.
Generate an early warning (background color change) if x - 1 candles following a fractal are up/down
Generate alerts for buy/sell signals and early warning.
Consecutive Candle CountThe Consecutive Candle Count creates a histogram by tallying the number of consecutive up and down candle closes.
Moving Average Consecutive Up/Down Strategy (by ChartArt)This simple strategy goes long (or short) if there are several consecutive increasing (or decreasing) moving average values in a row in the same direction. The bars can be colored using the raw moving average trend. And the background can be colored using the consecutive moving average trend setting. In addition a experimental line of the moving average change can be drawn.
The strategy is based upon the "Consecutive Up/Down Strategy" which was created by Tradingview.
All trading involves high risk; past performance is not necessarily indicative of future results. Hypothetical or simulated performance results have certain inherent limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not actually been executed, the results may have under- or over-compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profits or losses similar to those shown.
Custom Indicator Clearly Shows If Bulls or Bears are in Control!The Two Versions of this Indicator I learned from Two Famous and Highly Successful Traders. This Indicator shows With No Lag Clear Up and Down Trends in Market by Documenting Clearly If Bulls or Bears are in Control. The Version In SubChart 1 Shows Consecutive Closes if the Current Close is Greater than of Less than the Midpoint of the Previous Bar (Why Midpoint Explained in Detail in 1st Post). The Version in SubChart 2 Shows Consecutive Closes that are Greater than or Less Than the Previous Close (Will Discuss Specific Uses in 1st Post). Works on Stocks, Forex, Futures, on All Timeframes.