PIP HUNTERSCR STOCH RSI SIGNALScript made in combination of Stoch and RSI, made by and for PIPHUNTERS on 03/10/2019
Stoch default values 10-3-3 higher band level 90, lower band level 10
RSI default value 14 color:blue
Cari dalam skrip untuk "大位科技同行业可替代股票的技术面分析数据(如5日均线、10日均线、支撑位、压力位)"
Simplified SizingEnsure you Uncheck #1 , #2, #3 in the STYLE tab or it draws the lines you only need the numbers for.
The first number is the deviation from the EMA , anything below 1.75 == 1. (less than 0.75 % deviation)
NOTE: The fill area turns yellow @ 1.50 and red above 2.75
There are steps built in to slightly lower share size when specific levels of divergence register:
From 1.75 to 10 , 1 == 1.10 (10% reduction)
From 10 and up, 1 == 1.20 (20% reduction)
The second number is the Average True Range , calculated by the input length (RMA smoothed) and a multiplier (in decimal form).
NOTE: From 930-936 this value is multiplied by 1.5
The third number is the max share size.
The 4th number is the lot price if you take a position at the max size.
INPUTS:
ATR Length
EMA Length for divergence calculation
ATR Multiplier (0.1 - 10)
Equity in account
Max loss per trade.
Good Luck!
Ultimate Moving Average Package (17 MA's)Included is the:
VWAP
Current time frame 10 EMA
Current time frame 20 EMA
Current time frame 50 EMA
Current time frame 10 SMA
Current time frame 20 SMA
Current time frame 50 SMA
Daily 10 EMA
Daily 20 EMA
Daily 50 EMA
Daily 50 SMA
Daily 100 SMA
Daily 200 SMA
Weekly 100 SMA
Weekly 200 SMA
Monthly 100 SMA
Monthly 200 SMA
All Daily/Weekly/Monthly MA's can be seen on intraday charts. Current time frame MA's change depending on your time frame. Obviously you dont need all 17 on your chart but you can pick the ones you like and disable the rest.
A.I.Driven Aggressive Intraday Models For 20190610(New to TradingView and trying to learn how best to share our daily Model Trades with the awesome community here. Still learning the tools here and may not be using the best approaches to publish ideas/charts/scirpts - please help us learn by suggesting best practices)
>>>>> Model Trades Published pre-market this morning at tradersai blogspot <<<<<
***** Medium-Frequency Models*****: For today, Monday 06/10, our medium-frequency models indicate going long on a break above 2903 with a 10-point trailing stop, and going short on a break below 2845 with an 8-point trailing stop.
---Note: For the trades to trigger, the breaks should occur during the regular session hours starting at 9:30am ET. By design, these models do NOT open any new positions after 3:45pm. Only one open position at any given time.---
***** Aggressive Intraday Models *****: For today, Monday 06/10, our aggressive intraday models indicate going long on a break above 2895 or 2886 or 2874 with an 8-point trailing stop, and going short on a break below 2890 or 2882 or 2870 with a 6-point trailing stop.
---- Note: For the trades to trigger, the breaks should occur during regular session hours starting at 9:30am ET. Due to the intraday nature of these aggressive models, they indicate closing any open trades at 3:55pm and remaining flat into the session close. No opening of new positions after 3:45pm. Only one open position at any given time.----
Moving Gain Loss PercentTracks the percentage gain/loss in three ranges:
single candle (can be turned on or off)
custom range of candles
custom range of candles
For example, with a range of 3 candles, and the serie:
1 - close 10
2 - close 5
3 - close 20
The moving gain would be:
1 - close 10 - gain 10, infinite%
2 - close 5 - gain 5, infinite%
3 - close 18 - gain 8, 80%
Or, for example if the range is 12 candles on a monthly chart, then the result is the Year-To-Date gain/loss plotted as a percentage.
Sexy RSI for sexy tradersHello fellow sexy traders.
I was tired of constantly having to add my own horizontals/MAs to the default RSI so I decided to make this modification.
The default settings include channels from 40-80 (green horizontals) for a bullish range, and 20-60 (red horizontals) for the bearish range.
Also includes white line at 50 level, and blue horizontals at extremes (90 and 10).
If RSI stays in one of the red or green range that can signify the trend direction, as directed by Andrew Cardwell (inventor of the RSI).
If you wish for other levels to be included, just let me know! Comment on here or dm me on twitter @boss_charts and I can add the settings for you, so all you have to do is click a button and it will set it to your desired config. I want this to be a tool that is useful for heavy traders to save them time.
Additionally, in order to tell the level of the RSI and how overextended it might be, I added the setting for the RSI to change color depending on its level. Current settings are as follows:
Normal RSI (30-70) = PURPLE
Conventional Overbought/Oversold (30-20 + 70-80) = RED
1st extended (20-15 + 80-85) = PINK
2nd extended (15-10 + 85-90) = ORANGE
VERY EXTENDED (<10 + >90) = YELLOW
That way you can get an idea of how drastic a move is by the color alone. According to Dr. Cardwell, a drastic move to over/under extended can be a sign of strength.
Finally, there are the default MAs added that Mr. Cardwell defines as useful for defining the trend. These being the 9 MA and 45 EMA/WMA.
The strategy with these is to have the MAs on both price and RSI. If the 9MA is above the 45 MA on both price and RSI, then this is bullish and you can look for longs.
Conversely, if the 9 is below the 45 on both RSI and price that is bearish, and you can look for shorts.
I added the background color change for the points where the MAs cross each other, so you do not have to have the MAs fogging up your charts to know where they are relative to one another. This is similar to my MA cross indicator which contains the same functionality.
Never financial advice. Backtest it for yourself and find MA configurations that work for you.
Enjoy! Feel free to send feedback/requests whenever.
Multi SMA EMA WMA HMA BB (5x8 MAs Bollinger Bands) MAX MTF - RRBMulti SMA EMA WMA HMA 4x7 Moving Averages with Bollinger Bands MAX MTF by RagingRocketBull 2019
Version 1.0
All available MAX MTF versions are listed below (They are very similar and I don't want to publish them as separate indicators):
ver 1.0: 4x7 = 28 MTF MAs + 28 Levels + 3 BB = 59 < 64
ver 2.0: 5x6 = 30 MTF MAs + 30 Levels + 3 BB = 63 < 64
ver 3.0: 3x10 = 30 MTF MAs + 30 Levels + 3 BB = 63 < 64
ver 4.0: 5(4+1)x8 = 8 CurTF MAs + 32 MTF MAs + 20 Levels + 3 BB = 63 < 64
ver 5.0: 6(5+1)x6 = 6 CurTF MAs + 30 MTF MAs + 24 Levels + 3 BB = 63 < 64
ver 6.0: 4(3+1)x10 = 10 CurTF MAs + 30 MTF MAs + 20 Levels + 3 BB = 63 < 64
Fib numbers: 8, 13, 21, 34, 55, 89, 144, 233, 377
This indicator shows multiple MAs of any type SMA EMA WMA HMA etc with BB and MTF support, can show MAs as dynamically moving levels.
There are 4 MA groups + 1 BB group, a total of 4 TFs * 7 MAs = 28 MAs. You can assign any type/timeframe combo to a group, for example:
- EMAs 9,12,26,50,100,200,400 x H1, H4, D1, W1 (4 TFs x 7 MAs x 1 type)
- EMAs 8,13,21,30,34,50,55,89,100,144,200,233,377,400 x M15, H1 (2 TFs x 14 MAs x 1 type)
- D1 EMAs and SMAs 8,13,21,30,34,50,55,89,100,144,200,233,377,400 (1 TF x 14 MAs x 2 types)
- H1 WMAs 13,21,34,55,89,144,233; H4 HMAs 9,12,26,50,100,200,400; D1 EMAs 12,26,89,144,169,233,377; W1 SMAs 9,12,26,50,100,200,400 (4 TFs x 7 MAs x 4 types)
- +1 extra MA type/timeframe for BB
There are several versions: Simple, MTF, Pro MTF, Advanced MTF, MAX MTF and Ultimate MTF. This is the MAX MTF version. The Differences are listed below. All versions have BB
- Simple: you have 2 groups of MAs that can be assigned any type (5+5)
- MTF: +2 custom Timeframes for each group (2x5 MTF) +1 TF for BB, TF XY smoothing
- Pro MTF: 4 custom Timeframes for each group (4x3 MTF), 1 TF for BB, MA levels and show max bars back options
- Advanced MTF: +4 extra MAs/group (4x7 MTF), custom Ticker/Symbols, Timeframe <>= filter, Remove Duplicates Option
- MAX MTF: +2 subtypes/group, packed to the limit with max possible MAs/TFs: 4x7, 5x6, 3x10, 4(3+1)x10, 5(4+1)x8, 6(5+1)x6
- Ultimate MTF: +individual settings for each MA, custom Ticker/Symbols
MAX MTF version tests the limits of Pinescript trying to squeeze as many MAs/TFs as possible into a single indicator.
It's basically a maxed out Advanced version with subtypes allowing for mixed types within a group (i.e. both emas and smas in a single group/TF)
Pinescript has the following limits:
- max 40 security calls (6 calls are reserved for dupe checks and smoothing, 2 are used for BB, so only 32 calls are available)
- max 64 plot outputs (BB uses 3 outputs, so only 61 plot outputs are available)
- max 50000 (50kb) size of the compiled code
Based on those limits, you can only have the following MAs/TFs combos in a single script:
1. 4x7, 5x6, 3x10 - total number of MTF MAs must always be <= 32, and you can still have BB and Num Levels = total MAs, without any compromises
2. 5(4+1)x8, 6(5+1)x6, 4(3+1)x10 - you can use the Current Symbol/Timeframe as an extra (+1) fixed TF with the same number of MTF MAs
- you don't need to call security to display MAs on the Current Symbol/Timeframe, so the total number of MTF MAs remains the same and is still <= 32
- to fit that many MAs into the max 64 plot outputs limit you need to reduce the number of levels (not every MA Group will have corresponding levels)
Features:
- 4x7 = 28 MAs of any type
- 4x MTF groups with XY step line smoothing
- +1 extra TF/type for BB MAs
- 2 MA subtypes within each group/TF
- 4x7 = 28 MA levels with adjustable group offsets, indents and shift
- supports any existing type of MA: SMA, EMA, WMA, Hull Moving Average (HMA)
- custom tickers/symbols for each group
- show max bars back option
- show/hide both groups of MAs/levels/BB and individual MAs
- timeframe filter: show only MAs/Levels with TFs <>= Current TF
- hide MAs/Levels with duplicate TFs
- support for custom TFs that are not available in free accounts: 2D, 3D etc
- support for timeframes in H: H, 2H, 4H etc
Notes:
- Uses timeframe textbox instead of input resolution dropdown to allow for 240 120 and other custom TFs
- Uses symbol textbox instead of input symbol to avoid establishing multiple dummy security connections to the current ticker - otherwise empty symbols will prevent script from running
- Possible reasons for missing MAs on a chart:
- there may not be enough bars in history to start plotting it. For example, W1 EMA200 needs at least 200 bars on a weekly chart.
- for charts with low/fractional prices i.e. 0.00002 << 0.001 (default Y smoothing step) decrease Y smoothing as needed (set Y = 0.0000001) or disable it completely (set X,Y to 0,0)
- for charts with high price values i.e. 20000 >> 0.001 increase Y smoothing as needed (set Y = 10-20). Higher values exceeding MAs point density will cause it to disappear as there will be no points to plot. Different TFs may require diff adjustments
- TradingView Replay Mode UI and Pinescript security calls are limited to TFs >= D (D,2D,W,MN...) for free accounts
- attempting to plot any TF < D1 in Replay Mode will only result in straight lines, but all TFs will work properly in history and real-time modes. This is not a bug.
- Max Bars Back (num_bars) is limited to 5000 for free accounts (10000 for paid), will show error when exceeded. To plot on all available history set to 0 (default)
- Slow load/redraw times. This indicator becomes slower, its UI less responsive when:
- Pinescript Node.js graphics library is too slow and inefficient at plotting bars/objects in a browser window. Code optimization doesn't help much - the graphics engine is the main reason for general slowness.
- the chart has a long history (10000+ bars) in a browser's cache (you have scrolled back a couple of screens in a max zoom mode).
- Reload the page/Load a fresh chart and then apply the indicator or
- Switch to another Timeframe (old TF history will still remain in cache and that TF will be slow)
- in max possible zoom mode around 4500 bars can fit on 1 screen - this also slows down responsiveness. Reset Zoom level
- initial load and redraw times after a param change in UI also depend on TF. For example: D1/W1 - 2 sec, H1/H4 - 5-6 sec, M30 - 10 sec, M15/M5 - 4 sec, M1 - 5 sec. M30 usually has the longest history (up to 16000 bars) and W1 - the shortest (1000 bars).
- when indicator uses more MAs (plots) and timeframes it will redraw slower. Seems that up to 5 Timeframes is acceptable, but 6+ Timeframes can become very slow.
- show_last=last_bars plot limit doesn't affect load/redraw times, so it was removed from MA plot
- Max Bars Back (num_bars) default/custom set UI value doesn't seem to affect load/redraw times
- In max zoom mode all dynamic levels disappear (they behave like text)
- Dupe check includes symbol: symbol, tf, both subtypes - all must match for a duplicate group
- For the dupe check to work correctly a custom symbol must always include an exchange prefix. BB is not checked for dupes
Good Luck! Feel free to learn from/reuse the code to build your own indicators.
APEX - WaveTrend [v1]WaveTrend is a smoothed oscillator which enables it to detect true reversals in an extremely accurate manner. The beauty of this indicator is that does not generate signals during choppy sideways markets.
The basic settings are 10 / 3 / 4 these are very aggressive settings, that will generate a lot of signals in all even not so volatile markets. If you need high-quality signals you settings close to 10 / 3 /21. The strongest buy/sell signals are given when the cross occurs above or below the threshold. In the 10 / 3 / 4 you threshold for buy should be around -90 values. If you use the very smoothed variant the threshold will be around -45 to -50 values.
This indicator will be first available in APEX v1 currently being beta tested.
Schaff Trend Cycle 1.1 with signal codingThis is an edit of Lazy Bear's Schaff Trend Cycle original description here. I've added in the syntax so that you can generate an alert when it crosses the threshold in either direction. Just tick the box to show threshold crosses.
More background on the indicator is here.
www.investopedia.com
Other common settings are fast 23 slow 53 or 10/30, 3/10. I have also set it to 9/20 for test purposes. They have different pluses and minuses on different timeframes.
Double EMA & ALMA StrategyThe ALMA (50 period) acts as the main trend filter, meaning that long positions are taken above the ALMA and short positions are taken below the ALMA. For instance, the 5 and 10 period exponential moving averages are added on the chart to give early signals to the trend.
Therefore, when the 5/10 EMA triggers a bullish crossover, long signals are taken when price is above the ALMA, likewise, when the 5/10 EMA triggers a bearish crossover, short signals are taken when price is below the ALMA.
Find out optimal values by trying. May not produce accurate results in horizontal markets. Thank you.
Inverted Yield Curve with VIX Fear IndexUS 2 year and US 10 year comparison, inverted yield curve with VIX. I use this on a weekly chart with 2 moving averages, the 40 week (ma200 daily) and the 520 week (10 year median).
The bottom histogram is the VIX and the plot is the yield curve. When the VIX is above a certain level (you can set it in settings) and the ýield curve is close to or at inversion the background goes red.
The last seven recessions were preceded by an inverted yield curve. Here I combined the two main fear indexes, the VIX and the run for safe US treasuries (Inverted Yield Curve).
This is preset to the 2 year and 10 year US bond, weekly, and the normal VIX ticker but you can set it to whatever you like.
Published with source code for anyone to modify. Please comment below if you do so! This is the second in a series of indicators I intend to publish as a package of economic recoverty/recession symptom indicators.
Follow me for updates, next one up is commodities with dr Copper and oil!
Advanced Larry Williams 9.2- By EduHit rate greater than Setup 9.1
However, the stop of this setup becomes more expensive in certain situations.
PURCHASE SIGN
1 - Paper comes in a bullish trend in the operational term to be operated.
2 - Exponential moving average of 9 upward periods.
3 - Wait for a candle to make the largest closing (candle reference).
4 - If the next candle CLOSES below the minimum of the candle reference the setup is armed.
5 - Mark the candle maxim that closed below the reference. It's the trigger!
6 - If the next candle exceeds this maximum by 1 cent the trade is triggered. Put the stop loss at the low of the candle that closed below (0.01 to 0.10 below)
7 - If the next candle does not fire, let's lower the trigger to the lower maximums, SINCE the mm9exp does not turn down.
8 - It exceeded the maximum we will have the entrance.
9 - Original stop-loss in the minimum of the candle we set the maximum activated.
SIGN OF SALE
1 - Paper comes in a downtrend in the operating period to be operated.
2 - Exponential moving average of 9 periods descending.
3 - Wait for a candle that makes the lowest closing (candle reference).
4 - If the next candle CLOSE above the maximum of the reference candle the setup is armed.
5 - Bookmark the candle that closed above the reference. It's the trigger!
6 - If the next candle breaks this minimum, the trade is triggered.
7 - Place the stop-loss at the maximum of the candle that closed up.
8 - If the next candle does not trigger, we will raise the trigger to the highest minimums SINCE the exponential moving average of 9 periods does not turn upwards.
9 - It broke the minimum we will have the entrance.
10 - Stop-loss original in the maximum of the candle that we set the minimum activated.
*********************************************************************************************************************************************************
Índice de acerto Superior ao Setup 9.1
Porém o stop deste setup acaba se tornando mais caro em determinadas situações.
SINAL DE COMPRA
1 - Papel vem em tendência de alta no prazo operacional a ser operado.
2 - Média móvel exponencial de 9 períodos ascendente.
3 - Aguardar um candle que faça o maior fechamento (candle referência).
4 - Se o próximo candle FECHAR abaixo da mínima do candle referência o setup está armado.
5 - Marcar a máxima do candle que fechou abaixo do referência. É o gatilho!
6 - Se o próximo candle superar essa máxima em 1 centavo o trade é acionado. Colocar o stop-loss na mínima do candle que fechou abaixo (0,01 a 0,10 abaixo)
7 - Se o próximo candle não acionar, vamos abaixando o gatilho para as máximas menores DESDE QUE a mm9exp não vire para baixo.
8 - Superou a máxima teremos a entrada.
9 - Stop-loss original na mínima do candle que marcamos a máxima ativada.
SINAL DE VENDA
1 - Papel vem em tendência de baixa no prazo operacional a ser operado.
2 - Média móvel exponencial de 9 períodos descendente.
3 - Aguardar um candle que faça o menor fechamento (candle referência).
4 - Se o próximo candle FECHAR acima da máxima do candle referência o setup está armado.
5 - Marcar a mínima do candle que fechou acima do referência. É o gatilho!
6 - Se o próximo candle romper essa mínima o trade é acionado.
7 - Colocar o stop-loss na máxima do candle que fechou acima.
8 - Se o próximo candle não acionar, vamos levantando o gatilho para as mínimas maiores DESDE QUE a média móvel exponencial de 9 períodos não vire para cima.
9 - Rompeu a mínima teremos a entrada.
10 - Stop-loss original na máxima do candle que marcamos a mínima ativada.
Reset Every (Price)Someone requested a high/low price indicator that would reset the "remembered" prices daily. I started out doing just that, and then decided to make it much more configurable.
Choose the units (minutes, hours, days, weeks, months) and the number of those units, and this will reset the highest/lowest value remembered to the current values on your chosen time interval.
This should work with any time interval you desire, within reason...asking for resets every 4000 hours on a monthly chart will probably not work.
GE, monthly, every 7 months:
Ford, weekly, every 18 months:
Dow Jones Industrial Average, weekly, every 90 days:
LTCBTC, daily, every 10 days:
ETHUSD, 30 minutes, every 10 days:
BTCUSD, 1 minute, every 10 hours:
EURUSD, 1 minute, every 50 minutes:
Also, I am about to publish another version of this with just one source input that can be applied to any indicator...stay tuned!
XPloRR MA-Trailing-Stop StrategyXPloRR MA-Trailing-Stop Strategy
Long term MA-Trailing-Stop strategy with Adjustable Signal Strength to beat Buy&Hold strategy
None of the strategies that I tested can beat the long term Buy&Hold strategy. That's the reason why I wrote this strategy.
Purpose: beat Buy&Hold strategy with around 10 trades. 100% capitalize sold trade into new trade.
My buy strategy is triggered by the fast buy EMA (blue) crossing over the slow buy SMA curve (orange) and the fast buy EMA has a certain up strength.
My sell strategy is triggered by either one of these conditions:
the EMA(6) of the close value is crossing under the trailing stop value (green) or
the fast sell EMA (navy) is crossing under the slow sell SMA curve (red) and the fast sell EMA has a certain down strength.
The trailing stop value (green) is set to a multiple of the ATR(15) value.
ATR(15) is the SMA(15) value of the difference between the high and low values.
The scripts shows a lot of graphical information:
The close value is shown in light-green. When the close value is lower then the buy value, the close value is shown in light-red. This way it is possible to evaluate the virtual losses during the trade.
the trailing stop value is shown in dark-green. When the sell value is lower then the buy value, the last color of the trade will be red (best viewed when zoomed)(in the example, there are 2 trades that end in gain and 2 in loss (red line at end))
the EMA and SMA values for both buy and sell signals are shown as a line
the buy and sell(close) signals are labeled in blue
How to use this strategy?
Every stock has it's own "DNA", so first thing to do is tune the right parameters to get the best strategy values voor EMA , SMA, Strength for both buy and sell and the Trailing Stop (#ATR).
Look in the strategy tester overview to optimize the values Percent Profitable and Net Profit (using the strategy settings icon, you can increase/decrease the parameters)
Then keep using these parameters for future buy/sell signals only for that particular stock.
Do the same for other stocks.
Important : optimizing these parameters is no guarantee for future winning trades!
Here are the parameters:
Fast EMA Buy: buy trigger when Fast EMA Buy crosses over the Slow SMA Buy value (use values between 10-20)
Slow SMA Buy: buy trigger when Fast EMA Buy crosses over the Slow SMA Buy value (use values between 30-100)
Minimum Buy Strength: minimum upward trend value of the Fast SMA Buy value (directional coefficient)(use values between 0-120)
Fast EMA Sell: sell trigger when Fast EMA Sell crosses under the Slow SMA Sell value (use values between 10-20)
Slow SMA Sell: sell trigger when Fast EMA Sell crosses under the Slow SMA Sell value (use values between 30-100)
Minimum Sell Strength: minimum downward trend value of the Fast SMA Sell value (directional coefficient)(use values between 0-120)
Trailing Stop (#ATR): the trailing stop value as a multiple of the ATR(15) value (use values between 2-20)
Example parameters for different stocks (Start capital: 1000, Order=100% of equity, Period 1/1/2005 to now) compared to the Buy&Hold Strategy(=do nothing):
BEKB(Bekaert): EMA-Buy=12, SMA-Buy=44, Strength-Buy=65, EMA-Sell=12, SMA-Sell=55, Strength-Sell=120, Stop#ATR=20
NetProfit: 996%, #Trades: 6, %Profitable: 83%, Buy&HoldProfit: 78%
BAR(Barco): EMA-Buy=16, SMA-Buy=80, Strength-Buy=44, EMA-Sell=12, SMA-Sell=45, Strength-Sell=82, Stop#ATR=9
NetProfit: 385%, #Trades: 7, %Profitable: 71%, Buy&HoldProfit: 55%
AAPL(Apple): EMA-Buy=12, SMA-Buy=45, Strength-Buy=40, EMA-Sell=19, SMA-Sell=45, Strength-Sell=106, Stop#ATR=8
NetProfit: 6900%, #Trades: 7, %Profitable: 71%, Buy&HoldProfit: 2938%
TNET(Telenet): EMA-Buy=12, SMA-Buy=45, Strength-Buy=27, EMA-Sell=19, SMA-Sell=45, Strength-Sell=70, Stop#ATR=14
NetProfit: 129%, #Trade
Renko Price Bars Overlay// Shows the price renko bars (or range bars) instead of the PERIOD renko
// bars that are integrated into Trading View. The normal renko bars that
// Trading View offers only consider the drawing of a new brick when the
// price closes above or below the required brick size. This can produce
// misleading charts since depending on the time interval of a chart, new
// bricks may or may not be drawn. True price renko bars will draw a new
// brick immediately upon the price exceeding the next target brick size.
// When running this script in "Traditional" mode, the painting of the
// brick overlay band is INDEPENDENT of the chart interval. If price
// exceeds the required target price for the next brick, the band is
// updated immediately, instead of waiting for the price bar on the chart
// interval to close first. The brick starting anchor point will attempt
// to be a "nice number" at a round interval for the chart ticker. For
// example, if viewing EURUSD with the box size equal to 50 ticks/pips,
// the open and close prices will take the form of 1.2100, 1.2150, 1.2200,
// 1.2250, and so on. This is the same behavior as the normal traditional
// Renko bars in Trading View and other major trading platforms such as
// Meta Trader.
// Use the tick size in traditional mode to specify the block size, in
// ticks. This may give interesting results in FOREX pairs... as the tick
// size in Trading View may be 0.00001 instead of the normal pip size of
// 0.0001, so a 10 pip block size may be '100', and not the expected '10'.
// FOREX futures should work in the manner expected, a 10 pip block size
// will indeed equal 0.0010.
// The "ATR" mode functions differently than the Trading View built in
// version. The block size is updated each time the range is exceeded.
// In Trading View, when using the ATR mode, the ATR is the last ATR
// value calculated on the ENTIRE data interval, and is applied to all
// past data. You can see this when you press the '+' sign of the ticker
// in the top left of the chart window and you will see the brick size
// as a constant, the brick size is not a function of the ever changing
// ATR value of the price action. The block size of this script is not
// updated for each price candle (i.e. each 1HR on a 1HR chart), instead
// it is updated only when the price thresholds are exceeded requiring a
// the band to be updated. At that point the current ATR is considered
// and the brick size is updated.
// Options exist to show the current high and low of the brick, and to
// show the required levels that the price must exceed to draw a new
// brick and update the band.
Please leave comments if you notice any bugs or would like any new features added. I don't find much use for plotting the H/L of the current renko candle, but I have seen some request it in the past.
Cheers.
EMA Indicators with BUY sell SignalCombine 3 EMA indicators into 1. Buy and Sell signal is based on
- Buy signal based on 20 Days Highest High resistance
- Sell signal based on 10 Days Lowest Low support
Input :-
1 - Short EMA (20), Mid EMA (50) and Long EMA (200)
2 - Resistance (20) = 20 Days Highest High line
3 - Support (10) = 10 Days Lowest Low line
Volume Range EventsChanges in the feelings (positive, negative, neutral) in the market concerning the valuation of an instrument are often preceded with sudden outbursts of buying and selling frenzies. The aim of this indicator is to report such outbursts. We can see them as expansions of volume, sometimes 10 times more than usual. and as extensions of the trading range, also sometimes 10 times more than usual (e.g. usual range is 10 cent suddenly a whole dollar.) The changes are calculated in such a way that these fit between plus and minus 100 percent, the bars are scaled in some sort of logarithmic way. The Emoline is the same as the one in the True Balance of Power indicator, which I already published
ONLY RISES ARE EVENTS
Sometimes analysts are tempted to give meaning to low volume or small ranges. These simply mean that the market has little interest in trading this instrument. I believe that in such cases the trader needs to wait for expansion and extension events to happen, then he can make a better guess of where the market is heading. As events often mark the beginning or ending of a trend, this indicator provides an early and clear signal, because it doesn’t bother us about non-events.
WHAT IS USUAL?
If the algorithm would use an average as a normal to scale volume or range events, then previous peaks will act as spoilers by making the average so high that a following peak is scaled too small. I developed a function, usual() , that kicks out all extremes of a ‘population of values’ and which returns the average of the non-extreme values. It can be called with any serial. This function is called by both algorithms that report volume and range peaks, which guarantees that the results are really comparable. As this function has a fixed look back of 8 periods, we might state that ‘usual’ is a short lived relative value. I think this doesn’t matter for the practical use of the indicator.
COLORING AND INTERPRETATION
I follow the categories in the ‘Better Volume Indicator’, published by LeazyBear, these are:
1. Climactic Volumes, event >40 % (this means peak is 1.5 X usual)
LIME: Climax Buying Volume, direction up, range event also > 30 %
RED: Climax Selling Volume, direction down, range event also > 30 %
AQUA: Climax Churning Volume, both directions, range event < 30%
2. Smaller Volumes, event <40 %
GREEN: Supportive Volume, both directions, if combined with range event
BLUE: Churning Volume, both directions, if not combined with range event (Professional Trading)
3. Just Range Events
BLACK histogram bars (Amateurish Trading)
Forex Master v4.0 (EUR/USD Mean-Reversion Algorithm)DESCRIPTION
Forex Master v4.0 is a mean-reversion algorithm currently optimized for trading the EUR/USD pair on the 5M chart interval. All indicator inputs use the period's closing price and all trades are executed at the open of the period following the period where the trade signal was generated.
There are 3 main components that make up Forex Master v4.0:
I. Trend Filter
The algorithm uses a version of the ADX indicator as a trend filter to trade only in certain time periods where price is more likely to be range-bound (i.e., mean-reverting). This indicator is composed of a Fast ADX and a Slow ADX, both using the same look-back period of 50. However, the Fast ADX is smoothed with a 6-period EMA and the Slow ADX is smoothed with a 12-period EMA. When the Fast ADX is above the Slow ADX, the algorithm does not trade because this indicates that price is likelier to trend, which is bad for a mean-reversion system. Conversely, when the Fast ADX is below the Slow ADX, price is likelier to be ranging so this is the only time when the algorithm is allowed to trade.
II. Bollinger Bands
When allowed to trade by the Trend Filter, the algorithm uses the Bollinger Bands indicator to enter long and short positions. The Bolliger Bands indicator has a look-back period of 20 and a standard deviation of 1.5 for both upper and lower bands. When price crosses over the lower band, a Long Signal is generated and a long position is entered. When price crosses under the upper band, a Short Signal is generated and a short position is entered.
III. Money Management
Rule 1 - Each trade will use a limit order for a fixed quantity of 50,000 contracts (0.50 lot). The only exception is Rule
Rule 2 - Order pyramiding is enabled and up to 10 consecutive orders of the same signal can be executed (for example: 14 consecutive Long Signals are generated over 8 hours and the algorithm sends in 10 different buy orders at various prices for a total of 350,000 contracts).
Rule 3 - Every order will include a bracket with both TP and SL set at 50 pips (note: the algorithm only closes the current open position and does not enter the opposite trade once a TP or SL has been hit).
Rule 4 - When a new opposite trade signal is generated, the algorithm sends in a larger order to close the current open position as well as open a new one (for example: 14 consecutive Long Signals are generated over 8 hours and the algorithm sends in 10 different buy orders at various prices for a total of 350,000 contracts. A Short Signal is generated shortly after the 14th Long Signal. The algorithm then sends in a sell order for 400,000 contracts to close the 350,000 contracts long position and open a new short position of 50,000 contracts).
My5min1. Follow the instructions for entry and exit exactly as above. Don’t second guess, or assume/presume anything.
2. Avoid entering the trade when the price is temporarily above /below 10 day MA, but the price candle hasn’t fully formed yet. Enter the trade only after the price candle closes above/below the 10 day MA.
3. Exit the trade immediately when the price candle closes above/below 10 day MA in the direction opposite to the trade. Don’t remain in the trade wishing it to turn in your favor.
4. Never ever trade in the opposite direction of the market. i.e. don’t buy when the price is below 200 day MA and sell when the price is above 200 day MA.
5. Take profits when limit is reached. Don’t be greedy and keep on increasing the target. Remember- A bird in hand is worth two in the bush.
MACD, backtest 2015+ only, cut in half and doubledThis is only a slight modification to the existing "MACD Strategy" strategy plugin!
found the default MACD strategy to be lacking, although impressive for its simplicity. I added "year>2014" to the IF buy/sell conditions so it will only backtest from 2015 and beyond ** .
I also had a problem with the standard MACD trading late, per se. To that end I modified the inputs for fast/slow/signal to double. Example: my defaults are 10, 21, 10 so I put 20, 42, 20 in. This has the effect of making a 30min interval the same as 1 hour at 10,21,10. So if you want to backtest at 4hr, you would set your time interval to 2hr on the main chart. This is a handy way to make shorter time periods more useful even regardless of strategy/testing, since you can view 15min with alot less noise but a better response.
Used on BTCCNY OKcoin, with the chart set at 45 min (so really 90min in the strategy) this gave me a percent profitable of 42% and a profit factor of 1.998 on 189 trades.
Personally, I like to set the length/signals to 30,63,30. Meaning you need to triple the time, it allows for much better use of shorter time periods and the backtests are remarkably profitable. (i.e. 15min chart view = 45min on script, 30min= 1.5hr on script)
** If you want more specific time periods you need to try plugging in different bar values: replace "year" with "n" and "2014" with "5500". The bars are based on unix time I believe so you will need to play around with the number for n, with n being the numbers of bars.
Daily High-Low RangeThis Pine Script calculates the daily range (High - Low) for each trading day to measure intraday volatility.
The orange line shows the actual daily high-low range.
The purple line represents the 10-day simple moving average of the daily range, smoothing out fluctuations for trend observation.
This indicator helps identify whether intraday volatility is increasing or decreasing over time and can be used to assess market momentum or risk.
이 Pine Script는 각 거래일의 고가와 저가의 차이 (일중 변동폭)을 계산하여 일중 변동성을 시각화합니다.
주황색 선은 매일의 고가-저가 범위를 나타냅니다.
보라색 선은 일중 변동폭의 10일 단순 이동평균(SMA)으로, 변동성의 추세를 부드럽게 보여줍니다.
이 지표를 통해 최근 시장의 변동성이 커지고 있는지 줄어들고 있는지를 파악할 수 있으며, 시장 리스크 또는 모멘텀 판단에 활용될 수 있습니다.
Price Deviation from MA5 (%)This Pine Script calculates and visualizes the percentage deviation of the current price from the 5-day simple moving average (SMA5).
The blue line represents the daily deviation (%) from the 5-day moving average.
The orange line shows the 10-day average of the deviation, providing a smoother trendline for volatility analysis.
A gray baseline at 0% helps identify whether the price is trading above or below the SMA5.
This indicator is helpful for identifying short-term overbought or oversold conditions and tracking intraday volatility behavior.
이 Pine Script는 현재 종가가 5일 이동평균선(MA5)으로부터 얼마나 떨어져 있는지(이격률, %)를 계산하고 시각화합니다.
파란색 선은 매일의 이격률(%)을 나타냅니다.
주황색 선은 이격률의 10일 평균값으로, 보다 부드러운 추세선을 제공합니다.
**0% 기준선(회색)**을 통해 현재 가격이 MA5 위에 있는지 아래에 있는지를 한눈에 파악할 수 있습니다.
이 지표는 단기 과열/과매도 구간을 파악하거나, 일중 변동성의 흐름을 분석할 때 유용합니다.
Range Breakout Statistics [Honestcowboy]
⯁ Overview
The Range Breakout Statistics uses a very simple system to detect ranges/consolidating markets. The principle is simple, it looks for areas where the slope of a moving average is flat compared to past values. If the moving average is flat for X amount of bars that's a range and it will draw a box.
The statistics part of the script is a bit more complicated. The aim of this script is to expand analysis of trading signals in a different way than a regular backtest. It also highlights the polyline tool, one of my favorite drawing tools on the tradingview platform.
⯁ Statistics Methods
The script has 2 different modes of analyzing a trading signals strength/robustness. It will do that for 2 signals native to the script.
Upper breakout: first price breakout at top of box, before max bars (100 bars by default)
Lower breakout: first price breakout at bottom of box, before max bars
The analysis methods themselves are straightforward and it should be possible for tradingview community to expand this type of analysis to other trading signals. This script is a demo for this analysis, yet some might still find the native signals helpful in their trading, that's why the script includes alerts for the 2 native signals. I've also added a setting to disable any data gathering, which makes script run faster if you want to automate it.
For both of the analysis methods it uses the same data, just with different calculations and drawing methods. The data set is all past price action reactions to the signals saved in a matrix. Below a chart for explaining this visually.
⯁ Method 1: Averages Projection
The idea behind this is that just showing all price action that happened after signal does not give actionable insights. It's more a spaghetti jumble mess of price action lines. So instead the script averages the data out using 3 different approaches, all selectable in the settings menu.
Geometric Average: useful as it accurately reflects compound returns over time, smoothing out the impact of large gains or losses. Accounts for volatility drift.
Arithmetic Average: a standard average calculation, can be misleading in trading due to volatility drift. It is the most basic form of averaging so I included it.
Median: useful as any big volatility huge moves after a signal does not really impact the mean as it's just the middle value of all values.
These averages are the 2 lines you will find in the middle of the projection. Having a clear difference between a lower break average and upper break average price reaction can signal significance of the trading signal instead of pure chaos.
Outside of this I also included calculations for the maximum and minimum values in the dataset. This is useful for seeing price reactions range to the signal, showing extreme losses or wins are possible. For this range I also included 2 matrices of highs and lows data. This makes it possible to draw a band between the range based on closing price and the one using high/low data.
Below is a visualisation of how the averages data is shown on chart.
⯁ Method 2: Equity Simulation
This method will feel closer to home for traders as it more closely resembles a backtest. It does not include any commissions however and also is just a visualisation of price reaction to a signal. This method will simulate what would happen if you would buy at the breakout point and hold the trade for X amount of bars. With 0 being sell at same bar close. To test robustness I've given the option to visualise Equity simulation not just for 1 simulation but a bunch of simulations.
On default settings it will draw the simulations for 0 bars holding all the way to 10 bars holding. The idea behind it is to check how stable the effect is, to have further confirmation of the significance of the signal. If price simulation line moves up on average for 0 bars all the way to 10 bars holding time that means the signal is steady.
Below is a visualisation of the Equity Simulation.
⯁ Signal filtering
For the boxes themselves where breakouts come from I've included a simple filter based on the size of the box in ATR or %. This will filter out all the boxes that are larger top to bottom than the ATR or % value you setup.
⯁ Coloring of Script
The script includes 5 color themes, each carefully created using color themes from the pantone color institute. There are no color settings or other visual settings in the script, the script themes are simple and always have colors that work well together. Equity simulation uses a gradient based on lightness to color the different lines so it's easier to differentiate them while still upper breaks having a different color than lower breaks.
This script is not created to be used in conjunction with other scripts, it will force you into a background color that matches the theme. It's purpose is a research tool for systematic trading, to analyse signals in more depth.
Metaverse color theme:
⯁ Conclusion
I hope this script will help traders get a deeper understanding of how different assets react to their assets. It should be possible to convert this script into other signals if you know how to code on the platform. It is my intention to make more publications that include this type of analysis. It is especially useful when dealing with signals that do not happen often enough, so a regular backtest is not enough to test their significance.