[RS]Standardized Trend Mapnothing excessively new here..
a map of standardized trend over multiple lengths, extra parameter for smoothing the input source(close) will remove noise.
Range
Range identifier by medianThis study tries to highlight ranges
as they are defined by
TradingLatino TradingView user.
The study uses median values.
A range is defined as periods when the price does not move a lot.
Its default values are aimed at BTCUSDT pair and 4h timeframe.
HOW IT WORKS
For each of the bars a '5' median is calculated based on the 'highest of open and close'
For each of the bars a '5' median is calculated based on the 'lowest of open and close'
Thanks to the desviation setting both medians
have a tolerated maximum and a minimum
Condition 1:
The bar current 'highest of open and close'
needs to be between the respective tolerated
maximum and minimum
Condition 2:
The bar current 'lowest of open and close'
needs to be between the respective tolerated
maximum and minimum
If both conditions are met
then the bar is in a range
SETTINGS
Price range periods : How many previous periods are used to calculate the medians
Price range maximum desviation (%) ( > 0 ): Maximum positive desviation for range detection
Price range minimum desviation (%) ( > 0 ): Mininum negative desviation for range detection
Desviations should be both of them a positive number
WARNING
Despite the name indicator does not identify the entire range.
It identifies when you realise you are inside a range.
E.g. If a range length is 8 periods length this range indicator
will highlight only the last 6 periods of the range.
USAGE
If your strategy signals you an upwards trend
then you might use this range detector
to know when to exit your long position
Why?
Because most of the times
the price is found to be
in a range it goes down
FEEDBACK 1
My former attempt on calculating ranges
felt too much over complex that is why
I decided to implement it with medians.
It should be easier to modify if
I want to desviation inputs to be calculated
automatically in the future.
I'm interested on different approaches on how to detect ranges.
FEEDBACK 2
I have only used this identifier in BTCUSDT 4h timeframe.
Feel free to comment down below with your suggested settings
for your favourite pair and timeframe
PINE SCRIPT TRICK
This script simulates looping an string char by char
in pine script.
Range identifier by angleThis study tries to highlight ranges
as they are defined by
TradingLatino TradingView user.
A range according to its definition would consist of
periods when the price does not move a lot.
It's aimed at BTCUSDT pair and 4h timeframe.
HOW IT WORKS
Price source is the middle between open and close values.
For each of the bars a '5' periods regression line is calculated
The regression line has an angle with the 0-axis line
which might be between 0 and 90.
0 angle would mean price is always the same
90 angle would mean price going to infinity
When '2' of those periods in a row
have their angles between a maximum angle
and a minimum angle then you have the range
SETTINGS
Price range bar periods : How many previous periods are used to calculate the bar regression line
Price range range periods : How many periods in a row should be used to say that there is a range
Price range maximum angle ( < 90.0 !!! ): Maximum angle for range detection
Price range minimum angle ( > -90.0 !!! ): Mininum angle for range detection
Angles should be set from -89.99 for the minimum angle to +89.99 for the maximum angle
WARNING
Despite the name indicator does not identify the entire range.
It identifies when you realise you are inside a range.
E.g. If a range length is 8 periods length this range indicator
will highlight only the last 6 periods of the range.
USAGE
If your strategy signals you an upwards trend
then you might use this range detector
to know when to exit your long position
Why?
Because most of the times
the price is found to be
in a range it goes down
FEEDBACK 1
I'm quite sure this range approach by comparing angles is a novel one.
I have checked Range Identifier script from TradingView LazyBear user
and it uses another approach.
I'm interested on different approaches on how to detect ranges.
FEEDBACK 2
I have only used this identifier in BTCUSDT 4h timeframe.
I'm interested to know if applying it more traditional
stocks the degrees need to be adjusted to something
more smaller.
PINE SCRIPT TRICK
This script simulates looping an string char by char
in pine script.
CREDITS
I have reused and adapted some code from
'TF Segmented Linear Regression' script
which it's from TradingView alexgrover user.
Volume DensityA group of two indicators:
The "Volume Density" shows how much volume was thrown out relative to the covered price range.
The "Volume Density Bars" shows the same, but with colour on top of the bar chart.
Multiple SuperTrends - evoSupertrend is one of the most popular and easy to use indicators out there. Here are 15 supertrends each having a different ATR multiple from price. This can be used to find ranges (often followed by a reversal) or to create a filter for fake signals.
In the input tab "Spacing" you can change the space between each supertrend, setting this to 0 would be a normal supertrend. You can also change style, color, line width and transparency all in the input tab.
Pine code tip: Change line 21 to 'true' to make editable true.
Enjoy! :)
Rolling midpointsThe script made for research purposes which plots these statistics of a given window: Mid-range (max + min)/2, Lower midpoint (mid-range + min)/2, and Higher midpoint (mid-range + max)/2.
This could be interesting when checking periods with sample size <= 0, or checking distros with srs kurtosis values.
Mean & median are also there.
cATRpillar Strategy**This is my first strategy on the Pine editor, any tips or tricks from the community would be awesome!
This strategy was developed from my indicator "cATRpillar". it uses the ATR range values to determine entry, and uses EMA values to determine an exit if the market goes against it.
Time Range StatisticsA good amount of users requested a text box showing various price statistics, the following script returns various of these stats in a user-selected range, and include classical ones such as a central tendency measurement (mean), dispersion (normalized range) and percent change, but also include less common statistics such as average traded volume and number of gaps. The script also calculates the correlation between the closing price and another user-selected instrument.
The script is currently the longest one I ever made and took some efforts, as I wasn't satisfied with the statistics to be originally included. Big thx to Gael for the enormous feedback and the idea of the normalized range, to user @Cookiecrush for the feedback ( without ya I would have posted something bad you know umu ? ), and Lulidolce for the support, friendship is magic!
Selected Range
The setting Start determine the bar at which the range starts, while End determine at which bar the range end. To help you select these values, the current bar number (bar index) is displayed at the right of the indicator title in blue.
The setting evaluate to last bar will use a range starting at Start and ending at the last bar, as such you can use a full range by using Start = 0 and select evaluate to last bar
The range is highlighted by an area on the chart. By default Start = 9000 and End = 10000, you might not have this amount of data in your chart, as such use the displayed bar index to select Start and End, then set the settings as default.
Displayed Statistics
The statistics panel is displayed on the right side of the last bar, the panel has 3 sections, a title section who shows the symbol ticker, timeframe, and overall trends represented by a chart emoji, the overall trends are determined by comparing the number of higher highs with the number of lower low.
Below are displayed the date ranges with time format: year/month/day/hour:minute.
The second section shows the general statistics. The first one is the mean, also represented by the orange line in the chart, the blue line displayed represent the highest price value in the range, while the red one represents the lowest price value.
The second stat is the normalized range, and determine how spread is the price in the user-selected range, why not the standard deviation? Because the standard deviation might return results varying widely depending on the scale of the closing price, you could get measures such as 0.0156 or 16 or even 56 depending on the instrument, as such using a normalized range can be more appropriate as it lays in a range of (0,1). Lower values indicate a low degree of price variation. Note that I still want to find another measure in the future.
The percentage change (or relative change) indicates at which percentage the price has increased or decreased, and is calculated by subtracting the closing at bar Start with the price at bar End , divided by the price at bar End , the result is then multiplied by 100.
The average traded volume calculate the mean of the volume in the selected range, I used the same format used by the original volume indicator for clarity.
Finally, the last stats of the section is the number of gaps, this stat is by default hidden. An up gap is detected when the open price is superior to the previous high, while a down gap is detected when the open price is inferior to the previous low, this allow to only retain significant gaps.
The last section of the indicator panel shows the correlation between the closing price and another instrument, by default GOOG, this correlation is also calculated within the user-selected range. Positive values indicate a positive relationship, that is the two instruments tend to move in the same direction. Negative values indicate a negative relationship, both instruments tend to move in a direction opposite to each other. Values closer to 1 or -1 indicate a stronger relationship, while values closer to 0 indicate no relationship.
In Summary
The script shows various stats, each calculated within a user-selected range, in general one would be more interested in how these stats might evolve with time, but checking them in a custom range can be quite interesting.
Thx for reading. umu
REVEREVE is abbreviation from Range Extension Volume Expansion. This indicator shows these against a background of momentum. The histogram and columns for the range and volume rises ara calculated with the same algorithm as I use in the Volume Range Events indicator, which I published before. Because this algorithm uses the same special function to assess 'normal' levels for volume and range and uses the same calculation for depicting the rises on a scale of zero through 100, it becomes possible to compare volume and range rises in the same chart panel and come to meaningful conclusions. Different from VolumeRangeEvents is that I don't attempt to show direction of the bars and columns by actually pointing up or down. However I did color the bars for range events according to direction if Close jumps more than 20 percent of ATR up or down either blue or red. If the wider range leads to nothing, i.e. a smaller jump than 20 percent, the color is black. You can teak this in the inputs. The volume colums ar colored according to two criteria, resulting in four colors (orange, blue, maroon, green). The first criterium is whether the expansion is climactic (orange, blue) or moderate (maroon, green). I assume that climactic (i.e. more than twice as much) volume marks the beginning or end of a trend. The second criterium looks at the range event that goes together with the volume event. If lots of volume lead to little change in range (blue, green), I assume that this volume originates from institutional traders who are accumulating or distributing. If wild price jumps occur with comparatively little volume (orange, maroon, or even no volume event) I assume that opportunistic are active, some times attributing to more volume.
For the background I use the same colors calculated with the same algorithm as in the Hull Agreement Indicator, which I published before. This way I try to predict trend changes by observation of REVE.
Separated ATR - evoThis script plots two ATR (Average True Range) values, one based on only bullish and the other based on only bearish bars. If the current bar is positive, the negative ATR will use its last known negative bar for the calculation. You can smooth bar directions by using the Heikin Ashi setting.
Use this the same way how you would use the regular ATR indicator, but with the added value of knowing which side of the market has more volatility.
ATR Break-Out - evoThis script measures candle length and average true range (ATR). A break out occurs when a candle is larger than the given ATR value. You can choose to calculate length from wicks or from the body (open & close).
You can use this as trend direction indicator by following the last break out candle or open a position after a break out with a stop just above or below the candle. Enjoy!
ATR Timeframe RangeThis indicator shows the ATR range on the daily or any other timeframe on your current chart. All settings are fully customize-able.
Ranged Candle Length - evoSimilar to one of my previous scripts 'Ranged Volume', but instead of using volume, this script uses candle length mirrored. It creates a range using highest and lowest of a given period. When the range gets larger, it means the current candle is bigger than the largest candle of your given period (break-out).
Yellow = Bullish break out
Red = Bearish break out
A good way to use this is to follow the direction of the last break-out candle or open a position with a stop just below or above the candle (that's how I tested it real time).
Good luck!
[FN] Session Range & Date Range For BacktestingThis has been done before in different ways, however, my goal is to publish a single, simplified copy/paste version of the idea so you can quickly and easily incorporate it into your strategy backtesting.
You can designate weekdays, weekdays + weekends for 24/7 markets, and also session range.
So, you trade bitcoin? It works. CME futures? It works. You are a discretionary trader so the only signals that matter are the ones that happen when you're awake? It works. Copy and paste.
The goal is that its that easy. You'll have to let me know if it is. glhf everyone.
If I'm not mistaken, you should be able to copy/paste this directly into your strategy script (Paste it in before your entry declarations). Just leave out the last 2 lines where the bgcolor() is declared... unless you want the background color lit up, that's up to you. It's just for demonstration purposes in this script.
After you've pasted it in, then in your strategy.entry() function you are adding: to the strategy.entry() function.
e.g:
strategy.entry("Long", strategy.long, qty=1, when = ENTRY_SIGNAL and signal_backtest())
Shoutouts to @zenandtheartoftrading and @allanster for providing the basis of this code that I put together here. We stand on the shoulders of giants.
ATR _NormalizedThis script is good to use with Williams %R indicator, to find out when price has bottomed out.
ATR has to be over 90 and Williams %R ( lenght 52 ) has to be over 95 to find out level around which one is good to buy.
You can check back, to see that this worked very well over history. Best way to use this 2 indicators is with DCA ( dollar cost average ), as area where to buy can go a little bit down and up for as long as few months. So dont just jump in, use DCA .
VPTbollfib & Camarilla (Danarilla)I do not own the original indicators. This is just a combination of the two because of their nature to work in a similar way.
Camarilla Pivots run on the basis of intraday range trading. Usually after daily open you look the fade whatever move happened before. by shorting R3/H3 levels or longing R3/L3. Targeting the other side of the range. This is the infamous PivotBoss level calculations and you would want to activate camarilla and turn off the normal pivots. They use the previous days volatility to plot the next days levels.
But what about some confirmation?
Well RafaelIzoni (who made it open source for improvement) threw together this VPTbollfib. It is volume price trend crossing down a fib line using bollinger bands as price envelope. The beauty of this is that It will signal usually counter to current price action based on selling into uptrends or vise versa. Meaning you get signals to counter price. Which is what you might be looking for on range day trade scalps for camarilla. A wick reversal or engulfing + volume based signal is a very happy pairing together. And those signals are usually suitable for the target of the range you are day trading. Hourly time frame works quite well for both. And camarilla should also be on daily settings.
Special Thanks to Nanda (who published the pivotboss indicator AND) Helped to merge the scripts together.
This indicator alone is an entire trade system. Camarilla already is. If you know the rules. it can be used for entries, exits, risk management to trade the range on TREND, COUNTER TREND, and BREAKOUT plays. The bollinger band fibs add confirmation to the trends levels. And the VPT adds a secondary confirmation to take a camarilla trade.
Try it out. I think you will find both the levels on camarilla and the VPT signals quite suprising.
GMS: % True RangeThis just give the range based in % so it can be easily compared to the past. The default setting gives the % range high to low for the current session.
This is what I originally wanted as a 1 period ATR gives it in price points and ROC only does current close to previous close. With this you can select OHLC for the two prices you want to use as well as length.
I hope it helps!
Andre
Candle Range - Monthly - Open/High/Low/Close/Wicks (Oldinvestor)This candle range comparison is similar to my original script Candle Range Compare .
This script is to compares the size of open/close high/low and wick size side by side. This version of the script allows you to only show a chosen month of each year to compare. I hadn't even thought to try and vanish the part of the chart I'm not looking at. I'll consider that later (may never happen, I am limited on time).
I have also included check boxes to turn on/off certain candles. This part is pretty self explanatory. For example: if you wish to not see wicks in front of the open/close, go to the settings for the study and uncheck the box for "Show Wicks".
Warning: The script does not work so well on monthly candles? Some of the candles are missing...
Good luck
Oldinvestor
Range CandlesAn easy-peasy way to replace OHLC bars with candles on Range Bars chart. For further improvement you could also make "Up Bars" and "Down Bars" colors transparent (open Range Bars chart settings, do the change and save as default).
Compare
Reversal finderThis script is used to visually highlight candles which may signal a reversal following a false break of a support or resistance level.
Inputs are:
Lookback period: look for the highest high and the lowest low of the prior x bars.
SMA length: used for a simple moving average of the range (high minus low) of the prior x bars.
Range multiple: used to filter out signals for any bars with a range smaller than the average range of the preceding bars (determined by SMA length above) e.g. a range multiple of 2 will only show signals for bars with a range twice of that of the average range of the preceding bars.
Range threshold: used to filter signals for bars both the open and close of the bar are at the extreme end of the bar e.g. a threshold setting of 33% will only show buy signals for bars which open and close within the upper 1/3rd of the bar’s high/low range (vice versa for sell signals). This helps highlight, for example, bars with a high which exceeds resistance in a current range but which close back inside the range.
Highlight signal bars?: This will highlight bars with a buy signal in green, sell signal bars in red, and all other bars in grey. The script was designed for use with a dark background, so you will need to play around with the bar colours in the style settings to suit your preferences.
Settings used in the example chart are not the default – they are lookback: 5, SMA length: 20, range multiple: 1.2, range threshold: 33%.
Enjoy!
$0 Monthly Weekly & Daily OHLC Viewer
Visualizer of current or previous month(s), week(s) & days ranges
Purpose: View last Monthly, Weekly, Daily, and/or a custom time interval OHLC, i.e. previously closed/confirmed or the ongoing higher time interval ranges
Main configurations available:
- 2 main reporting modes: View the current/ongoing M/W/D candles' OHLC (live, repaints) or report OHLC of last closed ones, i.e. previous Montly, Weekly and/or Daily
- View only latest Monthly, Weekly and/or Daily OHLC (lines) or all past ones (~channel)
- Set your own time interval for its price range(s) to be reported, e.g. last quarter '3M', 12H '720', or hide it
- View one specific day of the week OHLC reported all over the week
Graphic/visual configuration:
- Show the High & Low levels or not
- Show the Open & close levels or not
- Display a background color between top & down or lines only
- Change the background color depending if is/was rising or falling price
- Highlight the top & down breaches of higher timeframe resolution candles: Daily breaching last Weekly range, and/or the Weekly the Monthly one
- Colors & styling can be edited from the indicator's styling configuration panel
Depending on its expected usage, those configurations enable to:
- Consider previously closed candles OLHC as reference top & down ranges (support & resistance, breaches)
- Review chart's current candles evolution within their higher time interval / candle (M/W/D)
- Consider specific week days' range as a reference for the week trend
- Have a general overview of the market evolution trends
Default config is to view current candles evolving within their higher time interval / candle, while reporting last previously closed M+W is a preferred usage. Play with the config settings to find your setup.
View ongoing M+W+D OHLC with dynamic background color:
View previously closed M+W+D OHLC:
View closed H&L for M+W+D, latest only:
View Mondays' OHLC:
Feedback & support welcome.