Up-Down RangeHere is an attempt to segregate ATR into ATR of up days and down days.
While setting trailing stops based on ATR, you probably need to consider more on how an instrument can drop during red days. Hence, ATR of only red days makes more compelling case than overall ATR. Another use case for this kind of indicator may be in options if you are selling puts and calls with the intent of pocketing premiums on expiry.
Parameters are as explained below:
Range Type : Different range types are tr (True Range) , close (difference between close prices), highlow (difference between high and low of candle)
Period : ATR Period
Moving Average Type : Moving Average Type for calculating ATR. Two additional types - min and max are added which calculates lowest and highest range in last n bars
HideFullAtr : Hides combined ATR if checked.
Range
ATR - ATR from Low, ATR from High LabelsChecks what the average true range is for the X amount of trading days. Then will also label the ATR from the low, and the ATR from the high of the current day.
A second label can be created dependent on current days RVOL %. If RVOL is not 0 or 1, then it will create the second label. Otherwise it will just leave it as the standard label.
The calculation for second label is RVOL * ATR.
Vortex Range Breakout SystemThis is a Vortex Based Visual System,
Which can help you identify the Vortex Crosses based Range Breakouts/ Breakdown, over the price Scale,
How its made ?
The vortex Crosses are projected over the Price
on Same Time frame {Green and Red Filled area}
-> green Area means : Vortex Crossover Range
-> red Area means : Vortex Crossunder Range
and on Higher Timeframe
Vortex Cross Levels are Plotted, which you see as :
Blue and Orange Lines
Default Configs
Vortex Period is 14
Higher Timeframe Option is set to 60 mins
You can change the Higher timeframe to any minutes which suits your need
Also If you want to change the Higher Timeframe in Days
just know
1D = 24*60 min, = 1140mins
Enjoy!
Range Box (Nephew_Sam_)Version 1
Creates a box around a specified time range with the ability to extend the lines to a later time.
Next update:
- Background in box
- Remove historical boxes
- Extend lines in future instead of only till current price
There's similar but complex indicators out there, I'll leave this code as open source and you have permission to reuse and not credit me.
User-Inputed Time Range & FibsGreetings Traders! I have decided to release a few scripts as open-source as I'm sure others can benefit from them and perhaps make them better.(Be sure to check my Profile for the other scripts as well: www.tradingview.com).
This one is called User-Inputed Time Range & Fibs.
The idea behind this script is to record the Range Highs and Lows of a User Defined Period, and plot potential Targets based on either Fibonacci Extensions or a Multiple of the Range Size. I created this originally for use with the US Session Initial Balance(From 9:30-10:30AM EST), however it can be set to any time period.
What is Initial Balance? In simple words, Initial Balance (IB) is the price data, which are formed during the first hour of a trading session. Activity of traders forms the so-called Initial Balance at this time. This concept was introduced for the first time by Peter Steidlmayer when he presented the market profile to traders(atas.net).
The IB is monitored as a break-out area for Range Extension traders. The IB High is also seen as an area of resistance and the IB Low as an area of support until it is broken(www.mypivots.com).
As a note, depending on the Time Zone you are in, you may need to manually add or subtract from the Timed Range to match the desired Time. For example in NY Eastern Time, I have to use 8:30-9:30AM to Capture the 9:30-10-30AM IB for ES and NQ. Similarly, I must use 14:30-15:30PM to Capture the 9:30-10-30AM IB for BTC. You will need to make adjustments based on the Time Zone you are located in.
I wanted to give a Special Thanks to @PineCoders for the Custom Rounding Function from Backtesting/Trading Engine--> (), Pinecoders.com for help with Tracking the Highs/Lows--> (www.pinecoders.com), and @TradeChartist for allowing me to use some of the code for the Fibonacci Extensions from his script here--> ().
If you like User-Inputed Time Range & Fibs, be sure to Like, Follow, and if you have any questions, don't be afraid to drop a comment below.
Test: range mappingEXPERIMENTAL:
just a wild experiment..
mapping the average range break points to find natural hubs of support and resistance?!
888 BOT #alerts█ 888 BOT #alerts (open source)
This is an Expert Advisor 'EA' or Automated trading script for ‘longs’ and ‘shorts’, which uses only a Take Profit or, in the worst case, a Stop Loss to close the trade.
It's a much improved version of the previous ‘Repanocha’. It doesn`t use 'Trailing Stop' or 'security ()' functions (although using a security function doesn`t mean that the script repaints) and all signals are confirmed, therefore the script doesn`t repaint in alert mode and is accurate in backtest mode.
Apart from the previous indicators, some more and other functions have been added for Stop-Loss, re-entry and leverage.
It uses 8 indicators, (many of you already know what they are, but in case there is someone new), these are the following:
1. Jurik Moving Average
It's a moving average created by Mark Jurik for professionals which eliminates the 'lag' or delay of the signal. It's better than other moving averages like EMA , DEMA , AMA or T3.
There are two ways to decrease noise using JMA . Increasing the 'LENGTH' parameter will cause JMA to move more slowly and therefore reduce noise at the expense of adding 'lag'
The 'JMA LENGTH', 'PHASE' and 'POWER' parameters offer a way to select the optimal balance between 'lag' and over boost.
Green: Bullish , Red: Bearish .
2. Range filter
Created by Donovan Wall, its function is to filter or eliminate noise and to better determine the price trend in the short term.
First, a uniform average price range 'SAMPLING PERIOD' is calculated for the filter base and multiplied by a specific quantity 'RANGE MULTIPLIER'.
The filter is then calculated by adjusting price movements that do not exceed the specified range.
Finally, the target ranges are plotted to show the prices that will trigger the filter movement.
Green: Bullish , Red: Bearish .
3. Average Directional Index ( ADX Classic) and ( ADX Masanakamura)
It's an indicator designed by Welles Wilder to measure the strength and direction of the market trend. The price movement is strong when the ADX has a positive slope and is above a certain minimum level 'ADX THRESHOLD' and for a given period 'ADX LENGTH'.
The green color of the bars indicates that the trend is bullish and that the ADX is above the level established by the threshold.
The red color of the bars indicates that the trend is down and that the ADX is above the threshold level.
The orange color of the bars indicates that the price is not strong and will surely lateralize.
You can choose between the classic option and the one created by a certain 'Masanakamura'. The main difference between the two is that in the first it uses RMA () and in the second SMA () in its calculation.
4. Parabolic SAR
This indicator, also created by Welles Wilder, places points that help define a trend. The Parabolic SAR can follow the price above or below, the peculiarity that it offers is that when the price touches the indicator, it jumps to the other side of the price (if the Parabolic SAR was below the price it jumps up and vice versa) to a distance predetermined by the indicator. At this time the indicator continues to follow the price, reducing the distance with each candle until it is finally touched again by the price and the process starts again. This procedure explains the name of the indicator: the Parabolic SAR follows the price generating a characteristic parabolic shape, when the price touches it, stops and turns ( SAR is the acronym for 'stop and reverse'), giving rise to a new cycle. When the points are below the price, the trend is up, while the points above the price indicate a downward trend.
5. RSI with Volume
This indicator was created by LazyBear from the popular RSI .
The RSI is an oscillator-type indicator used in technical analysis and also created by Welles Wilder that shows the strength of the price by comparing individual movements up or down in successive closing prices.
LazyBear added a volume parameter that makes it more accurate to the market movement.
A good way to use RSI is by considering the 50 'RSI CENTER LINE' centerline. When the oscillator is above, the trend is bullish and when it is below, the trend is bearish .
6. Moving Average Convergence Divergence ( MACD ) and ( MAC-Z )
It was created by Gerald Appel. Subsequently, the histogram was added to anticipate the crossing of MA. Broadly speaking, we can say that the MACD is an oscillator consisting of two moving averages that rotate around the zero line. The MACD line is the difference between a short moving average 'MACD FAST MA LENGTH' and a long moving average 'MACD SLOW MA LENGTH'. It's an indicator that allows us to have a reference on the trend of the asset on which it is operating, thus generating market entry and exit signals.
We can talk about a bull market when the MACD histogram is above the zero line, along with the signal line, while we are talking about a bear market when the MACD histogram is below the zero line.
There is the option of using the MAC-Z indicator created by LazyBear, which according to its author is more effective, by using the parameter VWAP ( volume weighted average price ) 'Z-VWAP LENGTH' together with a standard deviation 'STDEV LENGTH' in its calculation.
7. Volume Condition
Volume indicates the number of participants in this war between bulls and bears, the more volume the more likely the price will move in favor of the trend. A low trading volume indicates a lower number of participants and interest in the instrument in question. Low volumes may reveal weakness behind a price movement.
With this condition, those signals whose volume is less than the volume SMA for a period 'SMA VOLUME LENGTH' multiplied by a factor 'VOLUME FACTOR' are filtered. In addition, it determines the leverage used, the more volume , the more participants, the more probability that the price will move in our favor, that is, we can use more leverage. The leverage in this script is determined by how many times the volume is above the SMA line.
The maximum leverage is 8.
8. Bollinger Bands
This indicator was created by John Bollinger and consists of three bands that are drawn superimposed on the price evolution graph.
The central band is a moving average, normally a simple moving average calculated with 20 periods is used. ('BB LENGTH' Number of periods of the moving average)
The upper band is calculated by adding the value of the simple moving average X times the standard deviation of the moving average. ('BB MULTIPLIER' Number of times the standard deviation of the moving average)
The lower band is calculated by subtracting the simple moving average X times the standard deviation of the moving average.
the band between the upper and lower bands contains, statistically, almost 90% of the possible price variations, which means that any movement of the price outside the bands has special relevance.
In practical terms, Bollinger bands behave as if they were an elastic band so that, if the price touches them, it has a high probability of bouncing.
Sometimes, after the entry order is filled, the price is returned to the opposite side. If price touch the Bollinger band in the same previous conditions, another order is filled in the same direction of the position to improve the average entry price, (% MINIMUM BETTER PRICE ': Minimum price for the re-entry to be executed and that is better than the price of the previous position in a given %) in this way we give the trade a chance that the Take Profit is executed before. The downside is that the position is doubled in size. 'ACTIVATE DIVIDE TP': Divide the size of the TP in half. More probability of the trade closing but less profit.
█ STOP LOSS and RISK MANAGEMENT.
A good risk management is what can make your equity go up or be liquidated.
The % risk is the percentage of our capital that we are willing to lose by operation. This is recommended to be between 1-5%.
% Risk: (% Stop Loss x % Equity per trade x Leverage) / 100
First the strategy is calculated with Stop Loss, then the risk per operation is determined and from there, the amount per operation is calculated and not vice versa.
In this script you can use a normal Stop Loss or one according to the ATR. Also activate the option to trigger it earlier if the risk percentage is reached. '% RISK ALLOWED' wich is calculated according with: '%EQUITY ON EACH ENTRY'. Only works with Stop Loss on 'NORMAL' or 'BOTH' mode.
'STOP LOSS CONFIRMED': The Stop Loss is only activated if the closing of the previous bar is in the loss limit condition. It's useful to prevent the SL from triggering when they do a ‘pump’ to sweep Stops and then return the price to the previous state.
█ ALERTS
There is an alert for each leverage, therefore a maximum of 8 alerts can be set for 'long' and 8 for 'short', plus an alert to close the trade with Take Profit or Stop Loss in market mode. You can also place Take Profit limit and Stop Loss limit orders a few seconds after filling the position entry order.
- 'MAXIMUM LEVERAGE': It is the maximum allowed multiplier of the % quantity entered on each entry for 1X according to the volume condition.
- 'ADVANCE ALERTS': There is always a time delay from when the alert is triggered until it reaches the exchange and can be between 1-15 seconds. With this parameter, you can advance the alert by the necessary seconds to activate it earlier. In this way it can be synchronized with the exchange so that the execution time of the entry order to the position coincides with the opening of the bar.
The settings are for Bitcoin at Binance Futures (BTC: USDTPERP) in 15 minutes.
For other pairs and other timeframes, the settings have to be adjusted again. And within a month, the settings will be different because we all know the market and the trend are changing.
888 BOT #backtest█ 888 BOT #backtest (open source)
This is an Expert Advisor 'EA' or Automated trading script for ‘longs’ and ‘shorts’, which uses only a Take Profit or, in the worst case, a Stop Loss to close the trade.
It's a much improved version of the previous ‘Repanocha’. It doesn`t use 'Trailing Stop' or 'security()' functions (although using a security function doesn`t mean that the script repaints) and all signals are confirmed, therefore the script doesn`t repaint in alert mode and is accurate in backtest mode.
Apart from the previous indicators, some more and other functions have been added for Stop-Loss, re-entry and leverage.
It uses 8 indicators, (many of you already know what they are, but in case there is someone new), these are the following:
1. Jurik Moving Average
It's a moving average created by Mark Jurik for professionals which eliminates the 'lag' or delay of the signal. It's better than other moving averages like EMA , DEMA , AMA or T3.
There are two ways to decrease noise using JMA . Increasing the 'LENGTH' parameter will cause JMA to move more slowly and therefore reduce noise at the expense of adding 'lag'
The 'JMA LENGTH', 'PHASE' and 'POWER' parameters offer a way to select the optimal balance between 'lag' and over boost.
Green: Bullish , Red: Bearish .
2. Range filter
Created by Donovan Wall, its function is to filter or eliminate noise and to better determine the price trend in the short term.
First, a uniform average price range 'SAMPLING PERIOD' is calculated for the filter base and multiplied by a specific quantity 'RANGE MULTIPLIER'.
The filter is then calculated by adjusting price movements that do not exceed the specified range.
Finally, the target ranges are plotted to show the prices that will trigger the filter movement.
Green: Bullish , Red: Bearish .
3. Average Directional Index ( ADX Classic) and ( ADX Masanakamura)
It's an indicator designed by Welles Wilder to measure the strength and direction of the market trend. The price movement is strong when the ADX has a positive slope and is above a certain minimum level 'ADX THRESHOLD' and for a given period 'ADX LENGTH'.
The green color of the bars indicates that the trend is bullish and that the ADX is above the level established by the threshold.
The red color of the bars indicates that the trend is down and that the ADX is above the threshold level.
The orange color of the bars indicates that the price is not strong and will surely lateralize.
You can choose between the classic option and the one created by a certain 'Masanakamura'. The main difference between the two is that in the first it uses RMA () and in the second SMA () in its calculation.
4. Parabolic SAR
This indicator, also created by Welles Wilder, places points that help define a trend. The Parabolic SAR can follow the price above or below, the peculiarity that it offers is that when the price touches the indicator, it jumps to the other side of the price (if the Parabolic SAR was below the price it jumps up and vice versa) to a distance predetermined by the indicator. At this time the indicator continues to follow the price, reducing the distance with each candle until it is finally touched again by the price and the process starts again. This procedure explains the name of the indicator: the Parabolic SAR follows the price generating a characteristic parabolic shape, when the price touches it, stops and turns ( SAR is the acronym for 'stop and reverse'), giving rise to a new cycle. When the points are below the price, the trend is up, while the points above the price indicate a downward trend.
5. RSI with Volume
This indicator was created by LazyBear from the popular RSI .
The RSI is an oscillator-type indicator used in technical analysis and also created by Welles Wilder that shows the strength of the price by comparing individual movements up or down in successive closing prices.
LazyBear added a volume parameter that makes it more accurate to the market movement.
A good way to use RSI is by considering the 50 'RSI CENTER LINE' centerline. When the oscillator is above, the trend is bullish and when it is below, the trend is bearish .
6. Moving Average Convergence Divergence ( MACD ) and ( MAC-Z )
It was created by Gerald Appel. Subsequently, the histogram was added to anticipate the crossing of MA. Broadly speaking, we can say that the MACD is an oscillator consisting of two moving averages that rotate around the zero line. The MACD line is the difference between a short moving average 'MACD FAST MA LENGTH' and a long moving average 'MACD SLOW MA LENGTH'. It's an indicator that allows us to have a reference on the trend of the asset on which it is operating, thus generating market entry and exit signals.
We can talk about a bull market when the MACD histogram is above the zero line, along with the signal line, while we are talking about a bear market when the MACD histogram is below the zero line.
There is the option of using the MAC-Z indicator created by LazyBear, which according to its author is more effective, by using the parameter VWAP ( volume weighted average price ) 'Z-VWAP LENGTH' together with a standard deviation 'STDEV LENGTH' in its calculation.
7. Volume Condition
Volume indicates the number of participants in this war between bulls and bears, the more volume the more likely the price will move in favor of the trend. A low trading volume indicates a lower number of participants and interest in the instrument in question. Low volumes may reveal weakness behind a price movement.
With this condition, those signals whose volume is less than the volume SMA for a period 'SMA VOLUME LENGTH' multiplied by a factor 'VOLUME FACTOR' are filtered. In addition, it determines the leverage used, the more volume , the more participants, the more probability that the price will move in our favor, that is, we can use more leverage. The leverage in this script is determined by how many times the volume is above the SMA line.
The maximum leverage is 8.
8. Bollinger Bands
This indicator was created by John Bollinger and consists of three bands that are drawn superimposed on the price evolution graph.
The central band is a moving average, normally a simple moving average calculated with 20 periods is used. ('BB LENGTH' Number of periods of the moving average)
The upper band is calculated by adding the value of the simple moving average X times the standard deviation of the moving average. ('BB MULTIPLIER' Number of times the standard deviation of the moving average)
The lower band is calculated by subtracting the simple moving average X times the standard deviation of the moving average.
the band between the upper and lower bands contains, statistically, almost 90% of the possible price variations, which means that any movement of the price outside the bands has special relevance.
In practical terms, Bollinger bands behave as if they were an elastic band so that, if the price touches them, it has a high probability of bouncing.
Sometimes, after the entry order is filled, the price is returned to the opposite side. If price touch the Bollinger band in the same previous conditions, another order is filled in the same direction of the position to improve the average entry price, (% MINIMUM BETTER PRICE ': Minimum price for the re-entry to be executed and that is better than the price of the previous position in a given %) in this way we give the trade a chance that the Take Profit is executed before. The downside is that the position is doubled in size. 'ACTIVATE DIVIDE TP': Divide the size of the TP in half. More probability of the trade closing but less profit.
█ STOP LOSS and RISK MANAGEMENT.
A good risk management is what can make your equity go up or be liquidated.
The % risk is the percentage of our capital that we are willing to lose by operation. This is recommended to be between 1-5%.
% Risk: (% Stop Loss x % Equity per trade x Leverage) / 100
First the strategy is calculated with Stop Loss, then the risk per operation is determined and from there, the amount per operation is calculated and not vice versa.
In this script you can use a normal Stop Loss or one according to the ATR. Also activate the option to trigger it earlier if the risk percentage is reached. '% RISK ALLOWED'
'STOP LOSS CONFIRMED': The Stop Loss is only activated if the closing of the previous bar is in the loss limit condition. It's useful to prevent the SL from triggering when they do a ‘pump’ to sweep Stops and then return the price to the previous state.
█ BACKTEST
The objective of the Backtest is to evaluate the effectiveness of our strategy. A good Backtest is determined by some parameters such as:
- RECOVERY FACTOR: It consists of dividing the 'net profit' by the 'drawdown’. An excellent trading system has a recovery factor of 10 or more; that is, it generates 10 times more net profit than drawdown.
- PROFIT FACTOR: The ‘Profit Factor’ is another popular measure of system performance. It's as simple as dividing what win trades earn by what loser trades lose. If the strategy is profitable then by definition the 'Profit Factor' is going to be greater than 1. Strategies that are not profitable produce profit factors less than one. A good system has a profit factor of 2 or more. The good thing about the ‘Profit Factor’ is that it tells us what we are going to earn for each dollar we lose. A profit factor of 2.5 tells us that for every dollar we lose operating we will earn 2.5.
- SHARPE: (Return system - Return without risk) / Deviation of returns.
When the variations of gains and losses are very high, the deviation is very high and that leads to a very poor ‘Sharpe’ ratio. If the operations are very close to the average (little deviation) the result is a fairly high 'Sharpe' ratio. If a strategy has a 'Sharpe' ratio greater than 1 it is a good strategy. If it has a 'Sharpe' ratio greater than 2, it is excellent. If it has a ‘Sharpe’ ratio less than 1 then we don't know if it is good or bad, we have to look at other parameters.
- MATHEMATICAL EXPECTATION: (% winning trades X average profit) + (% losing trades X average loss).
To earn money with a Trading system, it is not necessary to win all the operations, what is really important is the final result of the operation. A Trading system has to have positive mathematical expectation as is the case with this script: ME = (0.87 x 30.74$) - (0.13 x 56.16$) = (26.74 - 7.30) = 19.44$ > 0
The game of roulette, for example, has negative mathematical expectation for the player, it can have positive winning streaks, but in the long term, if you continue playing you will end up losing, and casinos know this very well.
PARAMETERS
'BACKTEST DAYS': Number of days back of historical data for the calculation of the Backtest.
'ENTRY TYPE': For '% EQUITY' if you have $ 10,000 of capital and select 7.5%, for example, your entry would be $ 750 without leverage. If you select CONTRACTS for the 'BTCUSDT' pair, for example, it would be the amount in 'Bitcoins' and if you select 'CASH' it would be the amount in $ dollars.
'QUANTITY (LEVERAGE 1X)': The amount for an entry with X1 leverage according to the previous section.
'MAXIMUM LEVERAGE': It's the maximum allowed multiplier of the quantity entered in the previous section according to the volume condition.
The settings are for Bitcoin at Binance Futures (BTC: USDTPERP) in 15 minutes.
For other pairs and other timeframes, the settings have to be adjusted again. And within a month, the settings will be different because we all know the market and the trend are changing.
Background to highlight cash/session range [Futures]A simple script which allows the user to highlight the background of a certain session. At the moment there is only one session available, I will work on multiple highlights for numerous sessions at a later date.
Trend-Range IdentifierTrend trading algorithms fail in ranging market and Swing trading algorithm fail in trending market. Purpose of this indicator is to identify if the instrument is trending or ranging so that you can apply appropriate trading algorithm for the market.
Process:
ATR is calculated based on the input parameter atrLength
Range/Channel containing upLine and downLine is calculated by adding/subtracting atrMultiplier * atr to close price.
This range/channel will remain same until the price breaks either upLine or downLine.
Once price crosses one among upLine and downLine, then new upLine/downLine is calculated based on latest close price.
If price breaks upLine, the trend is considered to be up until the next line break or no lines are broken for rangeLength bars. During this state, candles are colored in lime and upLine/downLine are colored in green.
If price breaks downLine, the trend is considered to be down until the next line break or no lines are broken for rangeLength bars. During this state, candles are colored in orange and upLine/downLine are colored in red.
If close price does not break either upLine or downLine for rangeLength bars, then the instrument is considered to be in range. During this state, candles are colored in silver and upLine/downLine are colored in purple.
In ranging duration, we display one among Keltner Channel, Bollinger Band or Donchian Band as per input parameter : rangeChannel . Other parameters used for calculation are rangeLength and stdDev
I have not fully optimized parameters. Suggestions and feedback welcome.
Session High and Session LowI have heard many people ask for a script that will identify the high and low of a specific session. So, I made one.
Important Note: This indicator has to be set up properly or you will get an error. Important things to note are the length of the range and the session definition. The idea is that you would set it up for what's relevant to your trading. Going too far back in the chart history will cause errors. Setting the session for a time that is not on the chart can cause errors. If you set it to look farther back than there are bars to display, you may get an error. What I've found is that if you get an error, you just need to change the settings to reflect available data and it will be able to compile the script. At the time of its publishing, the default range start is set to 10/01/2020. If you're looking at this years later, you'll probably have to set the range to something more recent.
Features:
Plot or Lines:
Using Plot (displayed), the indicator will track the high/low from the end of the session into the next session. Then at the start of the next session, it will start tracking the high/low of that session until its end, then track that high/low until the start of the next session then reset.
Using lines, it will extend horizontal lines to the right indefinitely. The number of sessions back that the lines apply to is a user-defined number of sessions. There are limits to the number of lines that can be cast on a chart (roughly 40-50). So, the maximum number of sessions you can apply the lines to is the last 21 sessions (42 lines total). That gets really noisy though so I can't imagine that is a limiting factor.
Colors:
You can change the background color and its transparency, as well as turn the background color on or off.
You can change the highs and lows colors
You can adjust the line width to your preference
Session Length:
You can use a continuous session covering any user-defined period (provided its not tooooo many candles back)
You can define the session length for intraday
You can exclude weekends
Display Options:
You can adjust the colors, transparency, and linewidth
You can display the plotline or horizontal lines
You can show/hide the background color.
You can change how many sessions back the horizontal lines will track
Let me know if there's anything this script is missing or if you run into any issues that I might be able to help resolve.
Here's what it looks like with Lines for the last 5 sessions and different background color.
SuperTrendRange by DGTSuperTrendRange study attempts to determine the state of the market
• whether a well-established bull/bear trend is present
• whether the market is trading in a range
SuperTrendRange (STR) takes into account the volatility of the market - further details regarding volatility can be found in the description of “Volatility Bands by DGT” study
Due to its similarities to SupertTrend (ST) and Parabolic SAR (SAR), I will try to explain by stating differences between them
SuperTrendRange uses both the ATR (Average True Range) and STDEV (Standard Deviation) as part of its calculations - unlike ST and SAR where they use only ATR
Sensitivity of the indicator is adjusted using the multiplier setting of both ATR and STDEV
Additionally, unlike ST, the source of the basis of SuperTrendRange can be selected among the assets price value or its moving average
Source and Length are adjustable too
The SuperTrendRange, like Parabolic SAR indicator, appears on a chart as a series of dots, either above, below or unlike Parabolic SAR both above and below of the asset's price
A dot placed
- below the price when the market is trending upward
- above the price when it is trending downward
- both above and below when the price starts moving sideways – this is a feature that both SuperTrend and Parabolic SAR misses, where they are known to produce false signals and losing trades, whereas SuperTrendRange emphasis the zones of the ranges occurring and in most cases are considered no trade recommended zones. Please note that the range width may vary depending on how the market is volatile. It is up to the users to trade if it fits their trading strategies
Dots plotted above and below can be assumed as Support and Resistance levels
Example usages – with trading opportunities
Gold Monthly Chart
Bitcoin Daily Chart
Disclaimer:
Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon solely
The script is for informational and educational purposes only. Use of the script does not constitute professional and/or financial advice. You alone have the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold dgtrd TradingView user liable for any possible claim for damages arising from any decision you make based on use of the script
Silen's Pseudo VPVR / Pseudo Volume Profile Custom RangeDisclamer: This indicator does not use actual Volume data and doesn't display any Volume data. It creates a pseudo Volume Profile by counting the high-low-2 values of candles and simulates something that is similar to a Volume Profile without using any Volume data.
Core facts:
Creates a pseudo Volume Profile by counting values of candles and sorting them into a Profile.
Works for charts that don't provide any Volume Information.
Can display up to 5 different Value Levels.
Value level colors are (from largest to smallest level): Red, Orange, Yellow, Green, Blue.
The Value levels can be used as Support and Resistance indicators.
The Custom Range of the Volume Profile can be adjusted from 10 to 1500 bars.
Much faster than the other custom pseudo VPVRs out there.
Shortcomings:
As the chart progresses with bars the line positions will distort to the left side. Refreshing the tradingview page or switching to another time interval fixes this. I might fix this issue in the future.
Does not use actual Volume nor display actual Volume.
Note: For those who wondered what happened to my first version of this indicator: It got taken down by Tradingview because it was misleading as to using the words "Volume Profile" and "Visible Range". I fully support their decision and I hope I could clear any misunderstandings! Give their team a heads up for the hard work they're doing in keeping this place clean and well organized!
Enjoy! :)
Volume DensitySince we don't have tick count per time interval, let's do it this way. Basically "bigger the move bigger the volume" rule applies in most times, making volume alone kinda useless. What is more interesting, is when there was a huge volume within a relatively small range, or vice versa, a huge move without equally increased volume.
Without diving into details, bars with low volatility and serious volume are aprox. areas of possible future reversals/pullbacks, while volumeless high volatility moves should not cause any serious stops in price action.
This is just a small easy script to highlight this process. "Mathematically speaking, it's just a reciprocal of quotient of awfewefaffwqg..... Nah, not this time.
HOW IT WORKS:
Volume Density = 1/(range/volume)
We take range of a bar (high minus low), divide it by volume of the same bar, in order to neutralize this "bigger-bigger" relationship. Then we memorize this number, take 1 and divide 1 by this number, in order to inverse the result. So now, small bars with big volume will be rated higher than just by using classic volume histogram.
I suppose it would be easy to use it along with classic volume histogram, and assess the differences between these 2 histograms.
///
Probs some1 has already posted smth like this before idk, but if it aint the case, here it is, for you.
London Open Range Breakout by KviateqThis script is what I currently use to day trade forex on a 5-minute timeframe.
The script features Multi-timeframe EMA20 that uses timeframe multipliers and is smoother by the factor by which you're multiplying your current timeframe.
Default settings are set to display EMA20 on the current (M5) timeframe, as well as M15, H1, H4 and D1 timeframes.
The background color changes intensity based on how many conditions are met - are all EMAs in the right order, is the current close above/below all the EMAs.
Featured is also a range set to 1 hour since the London breakout (can be changed to M15, or however long you'd like - my current setting is 30 minute).
Also featured are levels that I find to be of most importance - such as Daily and Weekly Open, Previous Day's and Week's Highs.
The idea is to only take trades when all stars align - EMAs, break above/below the Opening Range and not to long/short into an important level.
Ruckard TradingLatinoThis strategy tries to mimic TradingLatino strategy.
The current implementation is beta.
Si hablas castellano o espanyol por favor consulta MENSAJE EN CASTELLANO más abajo.
It's aimed at BTCUSDT pair and 4h timeframe.
STRATEGY DEFAULT SETTINGS EXPLANATION
max_bars_back=5000 : This is a random number of bars so that the strategy test lasts for one or two years
calc_on_order_fills=false : To wait for the 4h closing is too much. Try to check if it's worth entering a position after closing one. I finally decided not to recheck if it's worth entering after an order is closed. So it is false.
calc_on_every_tick=false
pyramiding=0 : We only want one entry allowed in the same direction. And we don't want the order to scale by error.
initial_capital=1000 : These are 1000 USDT. By using 1% maximum loss per trade and 7% as a default stop loss by using 1000 USDT at 12000 USDT per BTC price you would entry with around 142 USDT which are converted into: 0.010 BTC . The maximum number of decimal for contracts on this BTCUSDT market is 3 decimals. E.g. the minimum might be: 0.001 BTC . So, this minimal 1000 amount ensures us not to entry with less than 0.001 entries which might have happened when using 100 USDT as an initial capital.
slippage=1 : Binance BTCUSDT mintick is: 0.01. Binance slippage: 0.1 % (Let's assume). TV has an integer slippage. It does not have a percentage based slippage. If we assume a 1000 initial capital, the recommended equity is 142 which at 11996 USDT per BTC price means: 0.011 BTC. The 0.1% slippage of: 0.011 BTC would be: 0.000011 . This is way smaller than the mintick. So our slippage is going to be 1. E.g. 1 (slippage) * 0.01 (mintick)
commission_type=strategy.commission.percent and commission_value=0.1 : According to: binance . com / en / fee / schedule in VIP 0 level both maker and taker fees are: 0.1 %.
BACKGROUND
Jaime Merino is a well known Youtuber focused on crypto trading
His channel TradingLatino
features monday to friday videos where he explains his strategy.
JAIME MERINO STANCE ON BOTS
Jaime Merino stance on bots (taken from memory out of a 2020 June video from him):
'~
You know. They can program you a bot and it might work.
But, there are some special situations that the bot would not be able to handle.
And, I, as a human, I would handle it. And the bot wouldn't do it.
~'
My long term target with this strategy script is add as many
special situations as I can to the script
so that it can match Jaime Merino behaviour even in non normal circumstances.
My alternate target is learn Pine script
and enjoy programming with it.
WARNING
This script might be bigger than other TradingView scripts.
However, please, do not be confused because the current status is beta.
This script has not been tested with real money.
This is NOT an official strategy from Jaime Merino.
This is NOT an official strategy from TradingLatino . net .
HOW IT WORKS
It basically uses ADX slope and LazyBear's Squeeze Momentum Indicator
to make its buy and sell decisions.
Fast paced EMA being bigger than slow paced EMA
(on higher timeframe) advices going long.
Fast paced EMA being smaller than slow paced EMA
(on higher timeframe) advices going short.
It finally add many substrats that TradingLatino uses.
SETTINGS
__ SETTINGS - Basics
____ SETTINGS - Basics - ADX
(ADX) Smoothing {14}
(ADX) DI Length {14}
(ADX) key level {23}
____ SETTINGS - Basics - LazyBear Squeeze Momentum
(SQZMOM) BB Length {20}
(SQZMOM) BB MultFactor {2.0}
(SQZMOM) KC Length {20}
(SQZMOM) KC MultFactor {1.5}
(SQZMOM) Use TrueRange (KC) {True}
____ SETTINGS - Basics - EMAs
(EMAS) EMA10 - Length {10}
(EMAS) EMA10 - Source {close}
(EMAS) EMA55 - Length {55}
(EMAS) EMA55 - Source {close}
____ SETTINGS - Volume Profile
Lowest and highest VPoC from last three days
is used to know if an entry has a support
VPVR of last 100 4h bars
is also taken into account
(VP) Use number of bars (not VP timeframe): Uses 'Number of bars {100}' setting instead of 'Volume Profile timeframe' setting for calculating session VPoC
(VP) Show tick difference from current price {False}: BETA . Might be useful for actions some day.
(VP) Number of bars {100}: If 'Use number of bars (not VP timeframe)' is turned on this setting is used to calculate session VPoC.
(VP) Volume Profile timeframe {1 day}: If 'Use number of bars (not VP timeframe)' is turned off this setting is used to calculate session VPoC.
(VP) Row width multiplier {0.6}: Adjust how the extra Volume Profile bars are shown in the chart.
(VP) Resistances prices number of decimal digits : Round Volume Profile bars label numbers so that they don't have so many decimals.
(VP) Number of bars for bottom VPOC {18}: 18 bars equals 3 days in suggested timeframe of 4 hours. It's used to calculate lowest session VPoC from previous three days. It's also used as a top VPOC for sells.
(VP) Ignore VPOC bottom advice on long {False}: If turned on it ignores bottom VPOC (or top VPOC on sells) when evaluating if a buy entry is worth it.
(VP) Number of bars for VPVR VPOC {100}: Number of bars to calculate the VPVR VPoC. We use 100 as Jaime once used. When the price bounces back to the EMA55 it might just bounce to this VPVR VPoC if its price it's lower than the EMA55 (Sells have inverse algorithm).
____ SETTINGS - ADX Slope
ADX Slope
help us to understand if ADX
has a positive slope, negative slope
or it is rather still.
(ADXSLOPE) ADX cut {23}: If ADX value is greater than this cut (23) then ADX has strength
(ADXSLOPE) ADX minimum steepness entry {45}: ADX slope needs to be 45 degrees to be considered as a positive one.
(ADXSLOPE) ADX minimum steepness exit {45}: ADX slope needs to be -45 degrees to be considered as a negative one.
(ADXSLOPE) ADX steepness periods {3}: In order to avoid false detection the slope is calculated along 3 periods.
____ SETTINGS - Next to EMA55
(NEXTEMA55) EMA10 to EMA55 bounce back percentage {80}: EMA10 might bounce back to EMA55 or maybe to 80% of its complete way to EMA55
(NEXTEMA55) Next to EMA55 percentage {15}: How much next to the EMA55 you need to be to consider it's going to bounce back upwards again.
____ SETTINGS - Stop Loss and Take Profit
You can set a default stop loss or a default take profit.
(STOPTAKE) Stop Loss % {7.0}
(STOPTAKE) Take Profit % {2.0}
____ SETTINGS - Trailing Take Profit
You can customize the default trailing take profit values
(TRAILING) Trailing Take Profit (%) {1.0}: Trailing take profit offset in percentage
(TRAILING) Trailing Take Profit Trigger (%) {2.0}: When 2.0% of benefit is reached then activate the trailing take profit.
____ SETTINGS - MAIN TURN ON/OFF OPTIONS
(EMAS) Ignore advice based on emas {false}.
(EMAS) Ignore advice based on emas (On closing long signal) {False}: Ignore advice based on emas but only when deciding to close a buy entry.
(SQZMOM) Ignore advice based on SQZMOM {false}: Ignores advice based on SQZMOM indicator.
(ADXSLOPE) Ignore advice based on ADX positive slope {false}
(ADXSLOPE) Ignore advice based on ADX cut (23) {true}
(STOPTAKE) Take Profit? {false}: Enables simple Take Profit.
(STOPTAKE) Stop Loss? {True}: Enables simple Stop Loss.
(TRAILING) Enable Trailing Take Profit (%) {True}: Enables Trailing Take Profit.
____ SETTINGS - Strategy mode
(STRAT) Type Strategy: 'Long and Short', 'Long Only' or 'Short Only'. Default: 'Long and Short'.
____ SETTINGS - Risk Management
(RISKM) Risk Management Type: 'Safe', 'Somewhat safe compound' or 'Unsafe compound'. ' Safe ': Calculations are always done with the initial capital (1000) in mind. The maximum losses per trade/day/week/month are taken into account. ' Somewhat safe compound ': Calculations are done with initial capital (1000) or a higher capital if it increases. The maximum losses per trade/day/week/month are taken into account. ' Unsafe compound ': In each order all the current capital is gambled and only the default stop loss per order is taken into account. That means that the maximum losses per trade/day/week/month are not taken into account. Default : 'Somewhat safe compound'.
(RISKM) Maximum loss per trade % {1.0}.
(RISKM) Maximum loss per day % {6.0}.
(RISKM) Maximum loss per week % {8.0}.
(RISKM) Maximum loss per month % {10.0}.
____ SETTINGS - Decimals
(DECIMAL) Maximum number of decimal for contracts {3}: How small (3 decimals means 0.001) an entry position might be in your exchange.
EXTRA 1 - PRICE IS IN RANGE indicator
(PRANGE) Print price is in range {False}: Enable a bottom label that indicates if the price is in range or not.
(PRANGE) Price range periods {5}: How many previous periods are used to calculate the medians
(PRANGE) Price range maximum desviation (%) {0.6} ( > 0 ): Maximum positive desviation for range detection
(PRANGE) Price range minimum desviation (%) {0.6} ( > 0 ): Mininum negative desviation for range detection
EXTRA 2 - SQUEEZE MOMENTUM Desviation indicator
(SQZDIVER) Show degrees {False}: Show degrees of each Squeeze Momentum Divergence lines to the x-axis.
(SQZDIVER) Show desviation labels {False}: Whether to show or not desviation labels for the Squeeze Momentum Divergences.
(SQZDIVER) Show desviation lines {False}: Whether to show or not desviation lines for the Squeeze Momentum Divergences.
EXTRA 3 - VOLUME PROFILE indicator
WARNING: This indicator works not on current bar but on previous bar. So in the worst case it might be VP from 4 hours ago. Don't worry, inside the strategy calculus the correct values are used. It's just that I cannot show the most recent one in the chart.
(VP) Print recent profile {False}: Show Volume Profile indicator
(VP) Avoid label price overlaps {False}: Avoid label prices to overlap on the chart.
EXTRA 4 - ZIGNALY SUPPORT
(ZIG) Zignaly Alert Type {Email}: 'Email', 'Webhook'. ' Email ': Prepare alert_message variable content to be compatible with zignaly expected email content format. ' Webhook ': Prepare alert_message variable content to be compatible with zignaly expected json content format.
EXTRA 5 - DEBUG
(DEBUG) Enable debug on order comments {False}: If set to true it prepares the order message to match the alert_message variable. It makes easier to debug what would have been sent by email or webhook on each of the times an order is triggered.
HOW TO USE THIS STRATEGY
BOT MODE: This is the default setting.
PROPER VOLUME PROFILE VIEWING: Click on this strategy settings. Properties tab. Make sure Recalculate 'each time the order was run' is turned off.
NEWBIE USER: (Check PROPER VOLUME PROFILE VIEWING above!) You might want to turn on the 'Print recent profile {False}' setting. Alternatively you can use my alternate realtime study: 'Resistances and supports based on simplified Volume Profile' but, be aware, it might consume one indicator.
ADVANCED USER 1: Turn on the 'Print price is in range {False}' setting and help us to debug this subindicator. Also help us to figure out how to include this value in the strategy.
ADVANCED USER 2: Turn on the all the (SQZDIVER) settings and help us to figure out how to include this value in the strategy.
ADVANCED USER 3: (Check PROPER VOLUME PROFILE VIEWING above!) Turn on the 'Print recent profile {False}' setting and report any problem with it.
JAIME MERINO: Just use the indicator as it comes by default. It should only show BUY signals, SELL signals and their associated closing signals. From time to time you might want to check 'ADVANCED USER 2' instructions to check that there's actually a divergence. Check also 'ADVANCED USER 1' instructions for your amusement.
EXTRA ADVICE
It's advised that you use this strategy in addition to these two other indicators:
* Squeeze Momentum Indicator
* ADX
so that your chart matches as close as possible to TradingLatino chart.
ZIGNALY INTEGRATION
This strategy supports Zignaly email integration by default. It also supports Zignaly Webhook integration.
ZIGNALY INTEGRATION - Email integration example
What you would write in your alert message:
||{{strategy.order.alert_message}}||key=MYSECRETKEY||
ZIGNALY INTEGRATION - Webhook integration example
What you would write in your alert message:
{ {{strategy.order.alert_message}} , "key" : "MYSECRETKEY" }
CREDITS
I have reused and adapted some code from
'Directional Movement Index + ADX & Keylevel Support' study
which it's from TradingView console user.
I have reused and adapted some code from
'3ema' study
which it's from TradingView hunganhnguyen1193 user.
I have reused and adapted some code from
'Squeeze Momentum Indicator ' study
which it's from TradingView LazyBear user.
I have reused and adapted some code from
'Strategy Tester EMA-SMA-RSI-MACD' study
which it's from TradingView fikira user.
I have reused and adapted some code from
'Support Resistance MTF' study
which it's from TradingView LonesomeTheBlue user.
I have reused and adapted some code from
'TF Segmented Linear Regression' study
which it's from TradingView alexgrover user.
I have reused and adapted some code from
"Poor man's volume profile" study
which it's from TradingView IldarAkhmetgaleev user.
FEEDBACK
Please check the strategy source code for more detailed information
where, among others, I explain all of the substrats
and if they are implemented or not.
Q1. Did I understand wrong any of the Jaime substrats (which I have implemented)?
Q2. The strategy yields quite profit when we should long (EMA10 from 1d timeframe is higher than EMA55 from 1d timeframe.
Why the strategy yields much less profit when we should short (EMA10 from 1d timeframe is lower than EMA55 from 1d timeframe)?
Any idea if you need to do something else rather than just reverse what Jaime does when longing?
FREQUENTLY ASKED QUESTIONS
FAQ1. Why are you giving this strategy for free?
TradingLatino and his fellow enthusiasts taught me this strategy. Now I'm giving back to them.
FAQ2. Seriously! Why are you giving this strategy for free?
I'm confident his strategy might be improved a lot. By keeping it to myself I would avoid other people contributions to improve it.
Now that everyone can contribute this is a win-win.
FAQ3. How can I connect this strategy to my Exchange account?
It seems that you can attach alerts to strategies.
You might want to combine it with a paying account which enable Webhook URLs to work.
I don't know how all of this works right now so I cannot give you advice on it.
You will have to do your own research on this subject. But, be careful. Automating trades, if not done properly,
might end on you automating losses.
FAQ4. I have just found that this strategy by default gives more than 3.97% of 'maximum series of losses'. That's unacceptable according to my risk management policy.
You might want to reduce default stop loss setting from 7% to something like 5% till you are ok with the 'maximum series of losses'.
FAQ5. Where can I learn more about your work on this strategy?
Check the source code. You might find unused strategies. Either because there's not a substantial increases on earnings. Or maybe because they have not been implemented yet.
FAQ6. How much leverage is applied in this strategy?
No leverage.
FAQ7. Any difference with original Jaime Merino strategy?
Most of the times Jaime defines an stop loss at the price entry. That's not the case here. The default stop loss is 7% (but, don't be confused it only means losing 1% of your investment thanks to risk management). There's also a trailing take profit that triggers at 2% profit with a 1% trailing.
FAQ8. Why this strategy return is so small?
The strategy should be improved a lot. And, well, backtesting in this platform is not guaranteed to return theoric results comparable to real-life returns. That's why I'm personally forward testing this strategy to verify it.
MENSAJE EN CASTELLANO
En primer lugar se agradece feedback para mejorar la estrategia.
Si eres un usuario avanzado y quieres colaborar en mejorar el script no dudes en comentar abajo.
Ten en cuenta que aunque toda esta descripción tenga que estar en inglés no es obligatorio que el comentario esté en inglés.
CHISTE - CASTELLANO
¡Pero Jaime!
¡400.000!
¡Tu da mun!
ORB - Opening Range BreakoutThis script plots the high/low of any custom session and extends it until the daily close. It does not show on the timeframe higher than the length of custom opening session by default.
The time period of opening range & the max timeframe to display it on can be adjusted from the settings.
So for eg. if want to use 5m ORB to trade, then set "ORB total time" as 5min & "Session Time" as whatever is the opening 5mins time period of ticker that are trading.
ATR Daily LevelsPlots the daily ATR on the chart as upper and lower levels.
It can be use to adapt your trading in high and low periods of market volatility, determine reasonable target or take profit, entry at likely mean reversion, stop loss beyond normal flows etc...
More on the script behavior:
- Daily ATR upper/lower levels are applied on the current day low/high;
- The ATR value is defined by the last D1 bar;
- Shows up to D1 timeframe;
- Configuration for the indicator's period (default: 20 period ATR);
- Configuration for plotting the indicator on the the x axis with an offset/at begining of the day (default: offset);
Dynamic Range here comes open source version of notorious JFT Indicator ( the indicator access you can get in some bucks ) on various telegram channels however they will not give code.
Now how it works
1. 2 ranges derived from indicator are supposed to be a consolidation zone and any close above or below is supposed to give a good move.
2. I personally consider it as may be addition to price analysis. ( i don't believe much in indicators,even simple MA gives fruitful results when there is good move in market )
3. Range can be drawn on chart with various resolution ( Daily/Monthly/Weekly )
PS: I coded myself based on data analysis shown by access only indicator. In case you use it for your publication don't forget to give credits.
Thanks,
daytraderph
Hancock - Renko Brick ProductionThis is the accompanying script that shows how many renko bricks were produced in each direction per candle. It gives a basic indication of volatility, some might find it useful.
Happy trading
Hancock
Hancock - RenkoThis is the first release of Renko indicator.
Renko is plotted over candles and best calculates the number of Renko bricks printed up or down per candle which can be viewed from the data window. It plots the high and low of a the bricks, if numerous bricks are printed on a candle, as well as the open and close of a Renko brick.
This will be actively developed and improved over the next few months and i will be basing other indicators from this Renko.
Happy trading
Hancock