CRYPTO HA Strategy money maker long termToday I bring you another amazing strategy.
Its made of 2 EMA in this case 50 and 100.
At the same time, internaly for candles we calculate the candles using the HA system ( while still using in live the normal candles). This way we can assure that even if we use HA candles, we avoid repainting, and its legit.
We first calculate the HA candles based on the EMA 50 values, and after that , we use that candle properties to apply to EMA 100.
Once we have that, for entries we have the next conditions :
sell = o2 > c2 and o2 < c2 and time_cond
buy = o2 < c2 and o2 > c2 and time_cond
For sell : Our open from HA 100 is bigger than Close from ha 100, and the previous open is smaller than previous close
For long : Our open from ha 100 is smaller than close from ha 100 and the previous open is bigger than previous close.
Then we have 2 options :
If we wnat to go only long , which is my prefered version ,or the original one where we go both long and short.
I found that the best results are in general around bigger timeframes, 1h+ , 3h works the best so far on my tests.
For exit we have 2 versions :
1 lets say we had a long signal, as soon as we have a short signal we close the trade. Viceversa for short.
2. Is based on price % movement. In this case I use 7.5% price movement of asset.
We have no TP in use for this system.
For the purpose of this test I use 10.000 $ account. For test I use 100% of it, without any leverage.
I use the SL based on price movement , which is a very risky tool, since it can fluctuate even at 20-30% of our capital.
For comission I used 0.1% for each deal, and a slippage of 5 points.
Be cautious with this system !
If you have any questions , message me.
Cari dalam skrip untuk "想象图:箱线图+折线组合,横轴为国家,纵轴为响应指数(0-100),箱线显示均值±标准差,叠加红色虚线标注各国确诊高峰时间点"
Easy Loot Golden CrossGolden/Death Cross Moving Average Indicator
30, 100 & 200 period Simple Moving Average (SMA).
30 = Yellow
100 = Green
200 = Black
Black crosses mark the 'golden crosses' as well as the 'death crosses'. These black crosses appear when the 30 crosses the 100 & when the 100 crosses the 200. These black crosses don't tell you when to buy/sell, but simply indicate interest in the market.
This code is open-source so feel free to add this indicator to your chart and play around with the different moving average timeframes & color schemes.
Golden Cross
The golden cross occurs when a short-term moving average crosses over a major long-term moving average to the upside and is interpreted by analysts and traders as signaling a definitive upward turn in a market. Basically, the short-term average trends up faster than the long-term average, until they cross.
There are three stages to a golden cross:
A downtrend that eventually ends as selling is depleted
A second stage where the shorter moving average crosses up through the longer moving average
Finally, the continuing uptrend, hopefully leading to higher prices
Death Cross
Conversely, a similar downside moving average crossover constitutes the death cross and is understood to signal a decisive downturn in a market. The death cross occurs when the short term average trends down and crosses the long-term average, basically going in the opposite direction of the golden cross.
The death cross preceded the economic downturns in 1929, 1938, 1974, and 2008.
VPoC per barThis study prints the current bar VPoC as an horizontal line.
It's aimed originally at BTCUSDT pair and 15m timeframe.
HOW IT WORKS
Zoom In mode: This is the default mode.
The study zooms in into the latest 15 1-minute bar candles in order to calculate the 15 minute candle VPoC.
Zoom Out mode: The VPoC from the last n bars from the current timeframe that match desired timeframe is shown on each bar.
In either case you are recommended to click on the '...' button associated to this study
and select 'Visual Order. Bring to Front.' so that it's properly shown in your chart.
HOW IT WORKS - Zoom In mode
Make sure that '(VP) Zoom into the VP timeframe' setting is set to true.
Choose the zoomed in timeframe where to calculate VPoC from thanks to the '(VP) Zoomed timeframe {1 minute}' setting.
Change '(VP) Zoomed in timeframe bars per current timeframe bar {15}' to its appropiated value. You just need to divide the current timeframe minutes per the zoomed in timeframe minutes per bar. E.g. If you are in 60 minute timeframe and you want to zoom in into 5 minute timeframe: 60 / 5 = 12 . You will write 12 here.
HOW IT WORKS - Zoom Out mode
Make sure that '(VP) Zoom into the VP timeframe' setting is set to false.
If you are using the Zoom out mode you might want to set '(VP) Print VPoC price as discrete lines {True}' to false.
Either choose the zoommed out timeframe where to calculate VPoC from thanks to the '(VP) Zoomed timeframe {1 minute}' setting or turn on the '(VP) Use number of bars (not VP timeframe)' setting in order to use '(VP) Number of bars {100}' as a custom number of bars.
WARNING - Zoom In mode last bar
The way that PineScript handles security function in last bar might result on the last bar not being accurate enough.
SETTINGS
__ SETTINGS - Volume Profile
(VP) Zoomed timeframe {1 minute}: Timeframe in which to zoom in or zoom out to calculate an accurate VPoC for the current timeframe.
(VP) Zoomed in timeframe bars per current timeframe bar {15}: Check 'HOW IT WORKS - Zoom In mode' above. Note : It is only used in 'Zoom in' mode.
(VP) Number of bars {100}: If 'Use number of bars (not VP timeframe)' is turned on this setting is used to calculate session VPoC. Note : It is only used in 'Zoom out' mode.
(VP) Price levels {24}: Price levels for calculating VPoC.
__ SETTINGS - MAIN TURN ON/OFF OPTIONS
(VP) Print VPoC price {True}: Show VPoC price
(VP) Zoom into the VP timeframe: When set to true the VPoC is calculated by zooming into the lower timeframe. When set to false a higher timeframe (or number of bars) is used.
(VP) Realtime Zoom in (Beta): Enable real time zoom for the last bar. It's beta because it would only work with zoomed in timeframe under 60 minutes. And when ratio between zoomout and zoomin is less than 60. Note : It is only used in 'Zoom in' mode.
(VP) Use number of bars (not VP timeframe): Uses 'Number of bars {100}' setting instead of 'Volume Profile timeframe' setting for calculating session VPoC. Note : It is only used in 'Zoom out' mode.
(VP) Print VPoC price as discrete lines {True}: When set to true the VPoC is shown as an small line in the center of each bar. When set to the false the VPoC line is printed as a normal line.
__ SETTINGS - EXTRA
(VP) VPoC color: Change the VPoC color
(VP) VPoC line width {1}: Change VPoC line width (in pixels).
(VP) Use number of bars (not VP timeframe): Uses 'Number of bars {100}' setting instead of 'Volume Profile timeframe' setting for calculating session VPoC. Note : It is only used in 'Zoom out' mode.
(VP) Print VPoC price as discrete lines {True}: When set to true the VPoC is shown as an small line in the center of each bar. When set to the false the VPoC line is printed as a normal line.
CREDITS
I have reused and adapted some code from
"Poor man's volume profile" study
which it's from TradingView IldarAkhmetgaleev user.
[Strategy] Simple Golden CrossSimple Golden Cross Strategy.
Works best on a daily chart on "Blue Chip" cryptos such as BTC, ETH, and LTC.
Entry Signal:
-50 day moving average crosses over the 100 day moving average.
Exit Signal:
-50 day moving average crosses under the 100 day moving average.
-Daily candle closes under the 100 day moving average (support).
-100 day moving average crosses under the 200 day moving average.
STRATEGY TESTER ENGINE - ON CHART DISPLAY - PLUG & PLAYSo i had this idea while ago when @alexgrover published a script and dropped a nugget in between which replicates the result of strategy tester on chart as an indicator.
So it seemed fair to use one of his strategy to display the results.
This strategy tester can now be used in replay mode like an indicator and you can see what happen at a particular section of the chart which was is not possible in default strategy tester results of TV.
Please read how each result is calculated so you will know what you are using.
This engine shows most common results of strategy tester in a single screen, which are as follows:
1. Starting Capital
2. Current Profit Percentage
3. Max Profit Percentage
4. Gross Profit
5. Gross Loss
6. Total Closed Trades
7. Total Trades Won
8. Total Trades Lost
9. Percentage Profitable
10. Profit Factor
11. Current Drawdown
12. Max Drawdown
13. Liquidation
So elaborating on what is what:
1. Starting Capital - This stays 0, which signifies your starting balance as 0%. It is set to 0 so we can compare all other results without any change in variables. If set to 100, then all the results will be increased by 100. Some users might find it useful to set it to 100, then they can change code on line 41 from to and it should show starting balance as 100%.
2. Current Profit Percentage - This shows your current profit adjusted to current price of the candle, not like TV which shows after candle is close. There is a comment on the line 38 which can be removed and your can see unrealized profit as well in this section. Please note that this will affect Draw-down calculations later in this section.
3. Max Profit Percentage - This will show you your max profit achieved during your strategy run, which was not possible yet to see via strategy tester. So, now you can see how much profit was achieved by your strategy during the run and you can compare it with chart to see what happens during bull-run or bear-run, so you can further optimize your strategy to best suit your desired results.
4. Gross Profit - This is total percentage of profit your strategy achieved during entire run as if you never had any losses.
5. Gross Loss - This is total percentage of loss your strategy achieved during entire run as if you never had any profits.
6. Total Closed Trades - This is total number of trades that your strategy has executed so far.
7. Total Trades Won - This is the total number of trades that your strategy has executed that resulted in positive increase in equity.
8. Totals Trades Lost - This is the total number of trades that your strategy has executed that resulted in decrease in equity.
9. Percentage Profitable - This is the ratio between your current total winning trades divided by total closed trades, and finally multiplied by 100 to get percentage results.
10. Profit Factor - This is the ratio between Gross Profit and Gross Loss, so if profit factor is 2, then it indicates that you are set to gain 2 times per your risk per trade on average when total trades are executed.
11. Current Drawdown - This is important section and i want you to read this carefully. Here draw-down is calculated very differently than what TV shows. TV has access to candle data and calculates draw-down accordingly as per number of trades closed, but here DD is calculated as difference between max profit achieved and current profit. This way you can see how much percentage you are down from max peak of equity at current point in time. You can do back-test of the data and see when peak was achieved and how much your strategy did a draw-down candle by candle.
12. Max Drawdown - This is also calculated differently same as above, current draw-down. Here you can see how much max DD your strategy did from a peak profit of equity. This is not set as max profit percentage is set because you will see single number on display, while idea is to keep it custom. I will explain.
So lets say, your max DD on TV is 30%. Here this is of no use to see Max DD , as some people might want to see what was there max DD 1000 candles back or 10 candle back. So this will show you your max DD from the data you select. TV shows 25000 candle data in a chart if you go back, you can set the counter to 24999 and it will show you max DD as shown on TV, but if you want custom section to show max DD , it is now possible which was not possible before.
Also, now let's say you put DD as 24999 and open a chart of an asset that was listed 1 week ago, now on 1H chart max DD will never show up until you reach 24999 candle in data history, but with this you can now enter a manual number and see the data.
13. Liquidation - This is an interesting feature, so now when your equity balance is less than 0 and your draw-down goes to -100, it will show you where and at what point in time you got liquidated by adding a red background color in the entire section. This is the most fun part of this script, while you can only see max DD on TV.
------------------------------------------------------------------------------
How to Use -
1 word, plug and play. Yes. Actual codes start from line 33.
select overlay=false or remove it from the title in your strategy on first line,
Just copy the codes from line 33 to 103,
then go to end section of your strategy and paste the entire code from line 33 to line 103,
see if you have any duplicate variable, edit it,
Add to chart.
What you see above is very contracted view. Here is how it looks when zoomed in.
imgur.com
----------------------------------------------------------------------------------
Feel free to edit and share and use. If you use it in your scripts, drop me tag. Cheers.
EulerMethod: CryptoCapEN
Shows the cryptocurrency market capitalization balance for the period
Initial data
Bitcoin Capitalization - CRYPTOCAP: BTC
Altcoin Capitalization - CRYPTOCAP: TOTAL2
Money circulates from fiat to bitcoin, from bitcoin to altcoins, from altcoins to fiat
This indicator applies the RSI algorithm to changes in capitalization
The divergence of indices shows an imbalance
Balance level: 0, Maximum: +100, Minimum: -100
(!) Artifacts of indicator readings may occur due to incorrect input data
RU
Показывает баланс капитализации крипторынка за период
Исходные данные
Капитализация Биткоина — CRYPTOCAP:BTC
Капитализация Альткоинов — CRYPTOCAP:TOTAL2
Деньги циркулируют из фиата в биткоин, из биткоина в альткоины, из альткоинов в фиат
В этом индикаторе применяется алгоритм RSI к изменениям капитализации
Расхождения индексов показывают дисбаланс
Балансовый уровень: 0, Максимум: +100, Минимум: -100
(!) Могут возникать артефакты показаний индикатора из-за неправильных исходных данных
Correlation MatrixIn financial terms, 'correlation' is the numerical measure of the relationship between two variables (in this case, the variables are Forex pairs).
The range of the correlation coefficient is between -1 and +1. A correlation of +1 indicates that two currency pairs will flow in the same direction.
A correlation of -1 indicates that two currency pairs will move in the opposite direction.
Here, I multiplied correlation coefficient by 100 so that it is easier to read. Range between 100 and -100.
Color Coding:-
The darker the color, the higher the correlation positively or negatively.
Extra Light Blue (up to +29) : Weak correlation. Positions on these symbols will tend to move independently.
Light Blue (up to +49) : There may be similarity between positions on these symbols.
Medium Blue (up to +75) : Medium positive correlation.
Navy Blue (up to +100) : Strong positive correlation.
Extra Light Red (up to -30) : Weak correlation. Positions on these symbols will tend to move independently
Light Red (up to -49) : There may be similarity between positions on these symbols.
Dark Red: (up to -75) : Medium negative correlation.
Maroon: (up to -100) : Strong negative correlation.
BO - CCI Arrow with AlertBO - CCI Arrow with Alert base on CCI indicator to get signal for trade Binary Option.
Rules of BO - CCI Arrow with Alert below:
A. Setup Menu
1. cciLength:
* Default CCI lenght = 14
2. Linear Regression Length:
* Periods to calculate Linear Regression of CCI,
* Default value = 5
3. Extreme Level:
* Default top extreme level = 100
* Default bottom extreme level = -100
4. Filter Length:
* Periods to define highest or lowest Linear Regression
* Default value = 6
B. Rule Of Alert Bar
1. Put Alert Bar
* Current Linear Regression Line created temporrary peak
* Peak of Linear Regression Line greater than Top Extreme Level (100)
* Previous Linear Regression is highest of Filter Length (6)
* Previous Linear Regression is greater than previous peak of Linear Regression Line
* Current price greater than previous low
* CCI(14) less than Linear Regression Line
2. Call Alert Bar
* Current Linear Regression Line created temporrary bottom
* Bottom of Linear Regression Line less than Bottom Extreme Level (-100)
* Previous Linear Regression is lowest of Filter Length (6)
* Previous Linear Regression is less than previous bottom of Linear Regression Line
* Current price less than previous lhigh
* CCI(14) greater than Linear Regression Line
B. Rule Of Entry Bar and Epiry.
1. Put Entry with expiry 3 bars:
* After Put Alert Bar close with signal confirmed, put Arrow appear, and after 3 bars, result label will appear to show win trade, loss trade or draw trade
2. Call Entry with expiry 3 bars:
* After Call Alert Bar close with signal confirmed, call Arrow appear, and after 3 bars, result label will appear to show win trade, loss trade or draw trade.
3. While 1 trade is opening no more any signal
C. Popup Alert/Mobile Alert
1. Signal alert: Put Alert or Call Alert will send to mobile or show popup on chart
2. Put Alert: only Put Alert will send to mobile or show popup on chart
3. Call Alert: only Call Alert will send to mobile or show popup on chart
Point and Figure (PnF) CCIThis is live and non-repainting Point and Figure Chart Commodity Channel Index - CCI tool. The script has it’s own P&F engine and not using integrated function of Trading View.
Point and Figure method is over 150 years old. It consist of columns that represent filtered price movements. Time is not a factor on P&F chart but as you can see with this script P&F chart created on time chart.
P&F chart provide several advantages, some of them are filtering insignificant price movements and noise, focusing on important price movements and making support/resistance levels much easier to identify.
Commodity Channel Index – CCI was developed by Donalt Lambert. CCI can be used to identify overbought or oversold, a new trend or warn of extreme conditions. CCI measures the difference between a security's price change and its average price change. High positive readings indicate that prices are well above their average, which is a show of strength. Low negative readings indicate that prices are well below their average, which is a show of weakness.
The Formula for the Commodity Channel Index ( CCI ) Is:
CCI = (Typical Price – L-period SMA of TP) / (0.015 * Mean Deviation)
Mean Deviation = (SumOf 1->L ( |TP – MA| )) / L
L = Length
TP = Typical Price
If you are new to Point & Figure Chart then you better get some information about it before using this tool. There are very good web sites and books. Please PM me if you need help about resources.
Options in the Script
Box size is one of the most important part of Point and Figure Charting. Chart price movement sensitivity is determined by the Point and Figure scale. Large box sizes see little movement across a specific price region, small box sizes see greater price movement on P&F chart. There are four different box scaling with this tool: Traditional, Percentage, Dynamic (ATR), or User-Defined
4 different methods for Box size can be used in this tool.
User Defined: The box size is set by user. A larger box size will result in more filtered price movements and fewer reversals. A smaller box size will result in less filtered price movements and more reversals.
ATR: Box size is dynamically calculated by using ATR, default period is 20.
Percentage: uses box sizes that are a fixed percentage of the stock's price. If percentage is 1 and stock’s price is $100 then box size will be $1
Traditional: uses a predefined table of price ranges to determine what the box size should be.
Price Range Box Size
Under 0.25 0.0625
0.25 to 1.00 0.125
1.00 to 5.00 0.25
5.00 to 20.00 0.50
20.00 to 100 1.0
100 to 200 2.0
200 to 500 4.0
500 to 1000 5.0
1000 to 25000 50.0
25000 and up 500.0
Default value is “ATR”, you may use one of these scaling method that suits your trading strategy.
If ATR or Percentage is chosen then there is rounding algorithm according to mintick value of the security. For example if mintick value is 0.001 and box size (ATR/Percentage) is 0.00124 then box size becomes 0.001.
And also while using dynamic box size (ATR or Percentage), box size changes only when closing price changed.
Reversal : It is the number of boxes required to change from a column of Xs to a column of Os or from a column of Os to a column of Xs. Default value is 3 (most used). For example if you choose reversal = 2 then you get the chart similar to Renko chart.
Source: Closing price or High-Low prices can be chosen as data source for P&F charting.
Upper Band : as default, Upper band is 100
Lower Band : as default, Lower band is -100
There are alerts when P&F CCI moves above Upper Band or moves below Lower Band.
Double MA CCI"What is the Commodity Channel Index (CCI)?
Developed by Donald Lambert, the Commodity Channel Index (CCI) is a momentum-based oscillator used to help determine when an investment vehicle is reaching a condition of being overbought or oversold. It is also used to assess price trend direction and strength. This information allows traders to determine if they want to enter or exit a trade, refrain from taking a trade, or add to an existing position. In this way, the indicator can be used to provide trade signals when it acts in a certain way.
KEY TAKEAWAYS
• The CCI measures the difference between the current price and the historical average price.
• When the CCI is above zero it indicates the price is above the historic average. When CCI is below zero, the price is below the hsitoric average.
• High readings of 100 or above, for example, indicate the price is well above the historic average and the trend has been strong to the upside.
• Low readings below -100, for example, indicate the price is well below the historic average and the trend has been strong to the downside.
• Going from negative or near-zero readings to +100 can be used as a signal to watch for an emerging uptrend.
• Going from positive or near-zero readings to -100 may indicate an emerging downtrend.
• CCI is an unbounded indicator meaning it can go higher or lower indefinitely. For this reason, overbought and oversold levels are typically determined for each individual asset by looking at historical extreme CCI levels where the price reversed from." ----> 1
SOURCE
1: (SINCE IM NOT A "PRO" MEMBER I C'ANT POST THE SOUCRE URL..., webpage consulted at : 8:50 GMT -5 ; the 2020-01-18)
I- Added a 2nd MA length and changed the default values of the source type and switched the SMA to a MA.
II- In process to add analytic MACD histogram correlation and if possible, ploting a relative histogram between the CCI upper and lower band.
P.S.:
Don't set your moving averages lengths to far from each other... This could result in fewer convergence and divergence, also in fewer crossing MA's.
Have a good year 2020 !!
//----CODER----//
R.V.
Multi momentum indicatorScript contains couple momentum oscillators all in one pane
List of indicators:
RSI
Stochastic RSI
MACD
CCI
WaveTrend by LazyBear
MFI
Default active indicators are RSI and Stochastic RSI
Other indicators are disabled by default
RSI, StochRSI and MFI are modified to be bounded to range from 100 to -100. That's why overbought is 40 and 60 instead 70 and 80 while oversold -40 and -60 instead 30 and 20.
MACD and CCI as they are not bounded to 100 or 200 range, they are limited to 100 - -100 by default when activated (extras are simply hidden) but there is an option to show full indicator.
In settings there are couple more options like show crosses or show only histogram.
Default source for all indicators is close (except WaveTrend and MFI which use hlc3) and it could be changed but for all indicators.
There is an option for 2nd RSI which can be set for any timeframe and background calculated by Fibonacci levels.
Open Interest Rank-BuschiEnglish:
One part of the "Commitment of Traders-Report" is the Open Interest which is shown in this indicator (source: Quandl database).
Unlike my also published indicator "Open Interest-Buschi", the values here are not absolute but in a ranking system from 0 to 100 with individual time frames-
The following futures are included:
30-year Bonds (ZB)
10-year Notes ( ZN )
Soybeans (ZS)
Soybean Meal (ZM)
Soybean Oil (ZL)
Corn ( ZC )
Soft Red Winter Wheat (ZW)
Hard Red Winter Wheat (KE)
Lean Hogs (HE)
Live Cattle ( LE )
Gold ( GC )
Silver (SI)
Copper (HG)
Crude Oil ( CL )
Heating Oil (HO)
RBOB Gasoline ( RB )
Natural Gas ( NG )
Australian Dollar (A6)
British Pound (B6)
Canadian Dollar (D6)
Euro (E6)
Japanese Yen (J6)
Swiss Franc (S6)
Sugar ( SB )
Coffee (KC)
Cocoa ( CC )
Cotton ( CT )
S&P 500 E-Mini (ES)
Russell 2000 E-Mini (RTY)
Dow Jones Industrial Mini (YM)
Nasdaq 100 E-Mini (NQ)
Platin (PL)
Palladium (PA)
Aluminium (AUP)
Steel ( HRC )
Ethanol (AEZ)
Brent Crude Oil (J26)
Rice (ZR)
Oat (ZO)
Milk (DL)
Orange Juice (JO)
Lumber (LS)
Feeder Cattle (GF)
S&P 500 ( SP )
Dow Jones Industrial Average Index (DJIA)
New Zealand Dollar (N6)
Deutsch:
Ein Bestandteil des "Commitment of Traders-Report" ist das Open Interest, das in diesem Indikator dargestellt wird (Quelle: Quandl Datenbank).
Anders als in meinem ebenfalls veröffentlichten Indikator "Open Interest-Buschi" werden hier nicht die absoluten Werte dargestellt, sondern in einem Ranking-System von 0 bis 100 mit individuellen Zeitrahmen.
Folgende Futures sind enthalten:
30-jährige US-Staatsanleihen (ZB)
10-jährige US-Staatsanleihen ( ZN )
Sojabohnen(ZS)
Sojabohnen-Mehl (ZM)
Sojabohnen-Öl (ZL)
Mais( ZC )
Soft Red Winter-Weizen (ZW)
Hard Red Winter-Weizen (KE)
Magerschweine (HE)
Lebendrinder ( LE )
Gold ( GC )
Silber (SI)
Kupfer(HG)
Rohöl ( CL )
Heizöl (HO)
Benzin ( RB )
Erdgas ( NG )
Australischer Dollar (A6)
Britisches Pfund (B6)
Kanadischer Dollar (D6)
Euro (E6)
Japanischer Yen (J6)
Schweizer Franken (S6)
Zucker ( SB )
Kaffee (KC)
Kakao ( CC )
Baumwolle ( CT )
S&P 500 E-Mini (ES)
Russell 2000 E-Mini (RTY)
Dow Jones Industrial Mini (YM)
Nasdaq 100 E-Mini (NQ)
Platin (PL)
Palladium (PA)
Aluminium (AUP)
Stahl ( HRC )
Ethanol (AEZ)
Brent Rohöl (J26)
Reis (ZR)
Hafer (ZO)
Milch (DL)
Orangensaft (JO)
Holz (LS)
Mastrinder (GF)
S&P 500 ( SP )
Dow Jones Industrial Average Index (DJIA)
Neuseeland Dollar (N6)
Well Rounded Moving AverageIntroduction
There are tons of filters, way to many, and some of them are redundant in the sense they produce the same results as others. The task to find an optimal filter is still a big challenge among technical analysis and engineering, a good filter is the Kalman filter who is one of the more precise filters out there. The optimal filter theorem state that : The optimal estimator has the form of a linear observer , this in short mean that an optimal filter must use measurements of the inputs and outputs, and this is what does the Kalman filter. I have tried myself to Kalman filters with more or less success as well as understanding optimality by studying Linear–quadratic–Gaussian control, i failed to get a complete understanding of those subjects but today i present a moving average filter (WRMA) constructed with all the knowledge i have in control theory and who aim to provide a very well response to market price, this mean low lag for fast decision timing and low overshoots for better precision.
Construction
An good filter must use information about its output, this is what exponential smoothing is about, simple exponential smoothing (EMA) is close to a simple moving average and can be defined as :
output = output(1) + α(input - output(1))
where α (alpha) is a smoothing constant, typically equal to 2/(Period+1) for the EMA.
This approach can be further developed by introducing more smoothing constants and output control (See double/triple exponential smoothing - alpha-beta filter) .
The moving average i propose will use only one smoothing constant, and is described as follow :
a = nz(a ) + alpha*nz(A )
b = nz(b ) + alpha*nz(B )
y = ema(a + b,p1)
A = src - y
B = src - ema(y,p2)
The filter is divided into two components a and b (more terms can add more control/effects if chosen well) , a adjust itself to the output error and is responsive while b is independent of the output and is mainly smoother, adding those components together create an output y , A is the output error and B is the error of an exponential moving average.
Comparison
There are a lot of low-lag filters out there, but the overshoots they induce in order to reduce lag is not a great effect. The first comparison is with a least square moving average, a moving average who fit a line in a price window of period length .
Lsma in blue and WRMA in red with both length = 100 . The lsma is a bit smoother but induce terrible overshoots
ZLMA in blue and WRMA in red with both length = 100 . The lag difference between each moving average is really low while VWRMA is way more precise.
Hull MA in blue and WRMA in red with both length = 100 . The Hull MA have similar overshoots than the LSMA.
Reduced overshoots moving average (ROMA) in blue and WRMA in red with both length = 100 . ROMA is an indicator i have made to reduce the overshoots of a LSMA, but at the end WRMA still reduce way more the overshoots while being smoother and having similar lag.
I have added a smoother version, just activate the extra smooth option in the indicator settings window. Here the result with length = 200 :
This result is a little bit similar to a 2 order Butterworth filter. Our filter have more overshoots which in this case could be useful to reduce the error with edges since other low pass filters tend to smooth their amplitude thus reducing edge estimation precision.
Conclusions
I have presented a well rounded filter in term of smoothness/stability and reactivity. Try to add more terms to have different results, you could maybe end up with interesting results, if its the case share them with the community :)
As for control theory i have seen neural networks integrated to Kalman flters which leaded to great accuracy, AI is everywhere and promise to be a game a changer in real time data smoothing. So i asked myself if it was possible for a neural networks to develop pinescript indicators, if yes then i could be replaced by AI ? Brrr how frightening.
Thanks for reading :)
Quadruple Kaufman Adaptive Moving AverageFour Kaufman Adaptive Moving Averages in one script. Useful for identifying trends and setting points to add to positions / exit trades. KAMA's are great for keeping you in trending markets and avoiding sideways chops and ranges. Try them out by tweaking the fast/slow ma's and lengths to get the right set for your charts that removes the thinking about whether to be long or short and when to add to positions.
A suggested trading strategy is to tweak the ma's (often you'll want larger values) until they span the price action well on past trends. Then each time price action closes and crosses one of your KAMA lines is an opportunity to add to your position. Once all lines are cleared and you've loaded up your position, hopefully your average price of entry falls short of the highest KAMA line's value. Once this happens you don't need to get out the trade until such time as a price close crosses again that largest KAMA line. For eager profit takers, close positions once any KAMA line is crossed once you're successfully loaded up on a direction.
I use this script with a renko chart and values -> 26 length 6 fast ma 100 slow ma, 26 8 100, 26 10 100, 26 12 100 and it's good to see these moving averages, unlike regular moving averages, bend around choppy action that come when trends pause, keeping me successfully in winning trades. Give it a try.
cci based potential buy/sell signal
Commodity Channel Index Potential Buy Signal
Commodity Channel Index (CCI) is below oversold line (-200).
CCI then crosses above -100 line
Commodity Channel Index Potential Sell Signal
Commodity Channel Index (CCI) is above overbought line (+200).
CCI then crosses below +100 line.
Türkçe Açıklama;
CCI Potansiyel Al Sinyali
CCI indikatörünün -200 altında bulunduğu bölgeler aşırı satış bölgeleri,
Sonrasında aşağıdan gelerek -100 çizgisinin üzerine çıktığı yada çıkmak üzere olduğu noktalar al sinyali
CCI Potansiyel Satl Sinyali
CCI indikatörünün +200 üzerinde bulunduğu bölgeler aşırı alım bölgeleri,
Sonrasında yukarıdan inerek +100 çizgisinin altına indiği yada inmek üzere olduğu noktalar sat sinyali
Not: Tek başına kullanılması son derece hatalı sonuçlar verebilir. Sadece olabilirlik potansiyeli taşımaktadır.
Aroon Single Line This indicator converts double lined Aroon indicator into a single line oscillator.
It is simply obtained by subtracting Aroon down from Aroon Up.
*If Oscillator points 100 value, it means there is a Strong Uptrend.
*If Oscillator points values between 100 and 40, it means there is an uptrend.
*If Oscillator points values between 20 and -20, it means no trend, it is sideways.But, when it is sideways; generally, oscillator makes FLAT LINES
between 20 and -20 values. 0 value is pointed out when the trend is downward as well, which means aroon up=aroon down.
*If Oscillator points values between -40 and -100, it means there is a downtrend.
*If Oscillator points -100 value, it means there is a Strong downtrend.
(20, 40) and (-20, -40) intervals are not mentioned, because; generally these are transition values and hard to comment, it will be more certain to
wait till values are between or at the reference values given.
CCI 0Trend Strategy (by Marcoweb) v1.0Hi guys,
I am trying to create a strategy that consists in the crossover/under of the 0 line of the Commodity Channel Index . Every time the price crosses over the 0 line in the CCI the strategy has to long getting short on the cross under and viceversa.
I have published here another script strategy (consists in a crossover/under of the Overbought/Oversold levels of the CCI) that works so I could have the opportunity to share with you the main idea that as per now is mistaken:
//@version=2
strategy(title="CCI 0Trend Strategy (by Marcoweb) v1.0", shorttitle="CCI_0T_Stra_v1.0", overlay=true)
///////////// CCI
length = input(20, minval=1)
src = input(close, title="Source")
ma = sma(src, length)
cci = (src - ma) / (0.015 * dev(src, length))
plot(cci, color=black)
band1 = hline(100, color=blue, linestyle=solid)
band0 = hline(-100, color=red, linestyle=solid)
bandl = hline(0, color=orange, linestyle=solid)
fill(band1, band0, color=olive)
p1 = plot(band0, color=red,title="-100")
p2 = plot(band1, color=blue,title="100")
p3 = plot(bandl, color=orange,title="0")
///////////// CCI 0Trend Strategy (by Marcoweb) v1.0 Strategy
if (not na(cci))
if (crossover(cci, bandl)
strategy.entry("CCI_L", strategy.long, stop=bandl, oca_type=strategy.oca.cancel, comment="CCI_L")
else
strategy.cancel(id="CCI_L")
if (crossunder(cci, bandl)
strategy.entry("CCI_S", strategy.short, stop=bandl, oca_type=strategy.oca.cancel, comment="CCI_S")
else
strategy.cancel(id="CCI_S")
//plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)
With this coding I get the error : line 24 (if (crossover(cci, bandl): mismatched input '|E|' expecting RPAR
Hope you like the idea ;)
How to automate this strategy for free using a chrome extension.Hey everyone,
Recently we developed a chrome extension for automating TradingView strategies using the alerts they provide. Initially we were charging a monthly fee for the extension, but we have now decided to make it FREE for everyone. So to display the power of automating strategies via TradingView, we figured we would also provide a profitable strategy along with the custom alert script and commands for the alerts so you can easily cut and paste to begin trading for profit while you sleep.
Step 1:
You are going to need to download the Chrome Extension called AutoView. You can get the extension for free by following this link: bit.ly ( I had to shorten the link as it contains Google and TV automatically converts it to a symbol)
Step 2: Go to your chrome extension page, and under the new extension you'll see a "settings" button. In the setting you will have to connect and give permission to the exchange 1broker allowing the extension to place your orders automatically when triggered by an alert.
Step 3: Setup the strategy and custom script for the alerts in TradingView. The attached script is the strategy, you can play with the settings yourself to try and get better numbers/performance if you please.
This following script is for the custom alerts:
//@version=2
study("4All-Alert", shorttitle="Alerts")
src = close
len = input(4, minval=1, title="Length")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
rsin = input(5)
sn = 100 - rsin
ln = 0 + rsin
short = crossover(rsi, sn) ? 1 : 0
long = crossunder(rsi, ln) ? 1 : 0
plot(long, "Long", color=green)
plot(short, "Short", color=red)
Now that you have the extension installed, the custom strategy and alert scripts in place, you simply need to create the alerts.
To get the alerts to communicate with the extension properly, there is a specific syntax that you will need to put in the message of the alert. You can find more details about the syntax here : gist.github.com
For this specific strategy, I use the Alerts script, long/short greater than 0.9 on close.
In the message for a long place this as your message:
Long
c=order b=short
c=position b=short l=200 t=market
b=long q=0.01 l=200 t=market tp=13 sl=25
and for the short...
Short
c=order b=long
c=position b=long l=200 t=market
b=short q=0.01 l=200 t=market tp=13 sl=25
If you'll notice in my above messages, compared to the strategy my tp and sl (take profit and stop loss) vary by a few pips. This is to cover the market opens and spread on 1broker. You can change the tp and sl in the strategy to the above and see that the overall profit will not vary much at all.
I hope this all makes sense and it is enough to not only make some people money, but to show the power of coming up with your own strategy and automating it using TradingView alerts and the free Chrome Extension AutoView.
ps. I highly recommend upgrading your TradingView account so you have access to back testing and multiple alerts.
There is really no reason you won't cover the cost and then some on a monthly basis using the tools provided.
Best of luck and happy trading.
Note: The extension currently allows for automation on 2 exchanges; 1broker and Okcoin. If you do not have accounts there, we'd appreciate you signing up using our referral links.
www.okcoin.com
1broker.com
Indicator: Trend Trigger FactorIntroduced by M.H.Pee, Trend Trigger Factor is designed to keep the trader trading with the trend.
System rules according to the developer:
* If the 15-day TTF is above 100 (indicating an uptrend), you will want to be in long positions.
* If the 15-day TTF is below -100, you will want to be short.
* If it is between -100 and 100, you should remain with the current position.
More info:
Original Article by Mr.Pee: drive.google.com
Market Internal Strength (DJI/Nasdaq/S&P)Market Health Dow, Nasdaq & S\&P 500 Breadth
Track the true internal health of the US market's three most important indices the Dow Jones Industrial Average (DJI), the Nasdaq 100 (NDX), and the S\&P 500 (SPX).
Price action alone can be deceiving. A rising index might be driven by only a handful of mega-cap stocks, masking underlying weakness. This indicator provides a crucial look "under the hood" to measure the market's true breadth.
It visualizes the percentage of stocks within each index that are trading above their key moving averages (5, 20, 50, 100, 150, and 200-day). This allows you to instantly gauge whether a market trend is broadly supported by the majority of its constituent stocks.
Key Features
* Covers 3 Major US Indices Seamlessly switch your analysis between the Dow Jones, Nasdaq 100, and S\&P 500.
* Complete Breadth Picture Six MA periods offer a full view, from short-term momentum (5D, 20D) to the long-term institutional trend (150D, 200D).
* Fully Customizable Toggle the visibility of any line and adjust overbought/oversold levels to fit your personal strategy.
How to Use
1. Extreme Readings (Overbought/Oversold)
* Above 80% Signals a very strong, potentially overbought market. Caution is advised as a pullback could be near.
* Below 20% Signals a deeply oversold market, often indicating capitulation and potential buying opportunities.
2. Divergence (Powerful Warning Signal)
* Bearish The index price makes a new high, but this indicator makes a lower high. This warns that the rally is not broad-based and may be losing steam.
* Bullish The index price makes a new low, but this indicator makes a higher low. This suggests internal strength is building and a bottom may be forming.
3. Trend Confirmation
When the long-term lines (150D, 200D) remain high (e.g., \> 50%), the primary market trend is healthy and confirmed.
Advanced Price Ranges ICTThis indicator automatically divides price into fixed ranges (configurable in points or pips) and plots important reference levels such as the high, low, 50% midpoint, and 25%/75% quarters. It is designed to help traders visualize structured price movement, spot confluence zones, and frame their trading bias around clean range-based levels.
🔹 Key Features
Custom Range Size: Define ranges in points (e.g., 100, 50, 25, 10) or in Forex pips.
Forex Mode: Automatically adapts pip size (0.0001 or 0.01 for JPY pairs).
Dynamic Anchoring: Price ranges automatically align to the current price, snapping into blocks.
Multiple Ranges: Option to extend visualization above and below the current active block for a complete grid.
Level Types:
High / Low of the range
50% midpoint
25% and 75% quarters
Custom Styling: Adjustable line colors and widths for each level type.
Labels: Optional right-edge labels showing level type and exact price.
Alerts: Built-in alerts for when price crosses the range high, low, or 50% midpoint.
🔹 Use Cases
Quickly map out 100/50/25/10 point structures like Zeussy’s advanced price range method.
Identify key reaction levels where liquidity is often built or swept.
Support ICT-style concepts like range-based bias, fair value gaps, and liquidity pools.
Works for indices, futures, crypto, and forex.
🔹 Customization
Range increments can be set to any size (default 100).
Toggle which levels are shown (High/Low, Midpoint, Quarters).
Adjustable line widths, colors, and label visibility.
Extend ranges above and below for broader market context.
T-Virus Sentiment [hapharmonic]🧬 T-Virus Sentiment: Visualize the Market's DNA
Remember the iconic T-Virus vial from the first Resident Evil? That powerful, swirling helix of potential has always fascinated me. It sparked an idea: what if we could visualize the market's underlying health in a similar way? What if we could capture the "genetic code" of market sentiment and contain it within a dynamic, 3D indicator? This project is the result of that idea, brought to life with Pine Script.
The indicator's main goal is to measure the strength and direction of market sentiment by analyzing the "genetic code" of price action through a variety of trusted indicators. The result is displayed as a liquid level within a DNA helix, a bubble density representing buying pressure, and a T-Virus mascot that reflects the overall mood.
🧐 Core Concept: How It Works
The primary output of the indicator is the "Active %" gauge you see on the right side of the vial. This percentage represents the overall sentiment score, calculated as an average from 7 different technical analysis tools. Each tool is analyzed on every bar and assigned a score from 1 (strong bearish pressure) to 5 (strong bullish potential).
In this indicator, we re-imagine market dynamics through the lens of a viral outbreak. A strong bear market is like a virus taking hold, pulling all technical signals down into a state of weakness. Conversely, a powerful bull market is like an antiviral serum ; positive signals rise and spread toward the top of the vial, indicating that the system is being injected with strength.
This is not just another line on a chart. It's a comprehensive sentiment dashboard designed to give an immediate, at-a-glance understanding of the confluence between 7 classic technical indicators. The incredible 3D model of the vial itself was inspired by a design concept found here .
⚛️ The 4 Core Elements of T-Virus Sentiment
These four elements work in harmony to give a complete, multi-faceted picture of market sentiment. Each component tells a different part of the story.
The Virus Mascot: An instant emotional cue. This character provides the quickest possible read on the overall market mood, combining sentiment with volume pressure.
The Antiviral Serum Level: The main quantitative output. This is the liquid level in the DNA helix and the percentage gauge on the right, representing the average sentiment score from all 7 indicators.
Buy Pressure & Bubble Density: This visualizes volume flow. The density of bubbles represents the intensity of accumulation (buying) versus distribution (selling). It's the "power" behind the move.
The Signal Distribution: This shows the confluence (or dispersion) of sentiment. Are all signals bullish and clustered at the top, or are they scattered, indicating a conflicted market? The position of the indicator labels is crucial, as each is assigned to one of five distinct zones:
Base Bottom: The market is at its weakest. Signals here suggest strong bearish control and distribution.
Lower Zone: The market is still bearish, but signals may be showing early signs of accumulation or bottoming.
Neutral Core (Center): A state of balance or sideways consolidation. The market is waiting for a new direction.
Upper Zone: Bullish momentum is becoming clear. Signals are strengthening and showing bullish control.
Top Cap: The market is "heating up" with strong bullish sentiment, potentially nearing overbought conditions.
🐂🐻 The Virus Mascot: The At-a-Glance Indicator
This character acts as a shortcut to confirm market health. It combines the sentiment score with volume, preventing false confidence in a low-volume rally.
Its state is determined by a dual-check: the overall "Antiviral Serum Level" and the "Buy Pressure" must both be above 50%.
Green & Smiling: The 'all clear' signal. This means that not only is the overall technical sentiment bullish, but it's also being supported by real buying pressure. This is a sign of a healthy bull market.
Red & Angry: A warning sign. This appears if either the sentiment is weak, or a bullish sentiment is not being confirmed by buying volume. The latter could indicate a potential "bull trap" or an exhaustive move.
This mascot can be disabled from the settings page under "Virus Mascot Styling" if a cleaner look is preferred.
🫧 Bubble Density: Gauging Buy vs. Sell Pressure
The bubbles visualize the battle between buyers and sellers. There are two modes to control how this is calculated:
Mode 1: Visible Range (The 'Big Picture' View)
This default mode is best for getting a broad, contextual understanding of the current session. It dynamically analyzes the volume of every single candlestick currently visible on the screen to calculate the buy/sell pressure ratio. It answers the question: "Over the entire period I'm looking at, who is in control?" As you zoom in or out, the calculation adapts.
Mode 2: Custom Lookback (The 'Precision' View)
This mode is for traders who need to analyze short-term pressure. You can define a fixed number of recent bars to analyze, which is perfect for scalping or understanding the volume dynamics leading into a key level. It answers the question: "What is happening right now ?" In the example above, a lookback of 2 focuses only on the most recent action, clearly showing intense, immediate selling pressure (few bubbles) and a corresponding drop in the sentiment score to 29%.
ℹ️ Interactive Tooltips: Dive Deeper
We believe in transparency, not 'black box' indicators. This feature transforms the indicator from a visual aid into an active learning tool.
Simply hover the mouse over any indicator label (like EMA, OBV, etc.) to get a detailed tooltip. It will explain the specific data points and thresholds that signal met to be placed in its current zone. This helps build trust in the signals and allows users to fine-tune the indicator settings to better match their own trading style.
🎯 The Scoring Logic Breakdown
The "Antiviral Serum Level" gauge is the average score from 7 technical analysis tools. Each is graded on a 5-point scale (1=Strong Bearish to 5=Strong Bullish). Here’s a detailed, transparent look at how each "gene" is evaluated:
Relative Strength Index (RSI)
Measures momentum and overbought/oversold conditions.
Group 1 (Strong Bearish): RSI > 80 (Extreme Overbought)
Group 2 (Bearish): 70 < RSI ≤ 80 (Overbought)
Group 3 (Neutral): 30 ≤ RSI ≤ 70
Group 4 (Bullish): 20 ≤ RSI < 30 (Oversold)
Group 5 (Strong Bullish): RSI < 20 (Extreme Oversold)
Exponential Moving Averages (EMA)
Evaluates the trend's strength and structure based on the alignment of multiple EMAs (9, 21, 50, 100, 200, 250).
Group 1 (Strong Bearish): A perfect bearish sequence (9 < 21 < 50 < ...)
Group 2 (Bearish Transition): Early signs of a potential reversal (e.g., 9 > 21 but still below 50)
Group 3 (Neutral / Mixed): MAs are intertwined or showing a partial bullish sequence.
Group 4 (Bullish): A strong bullish sequence is forming (e.g., 9 > 21 > 50 > 100)
Group 5 (Strong Bullish): A perfect bullish sequence (9 > 21 > 50 > 100 > 200 > 250)
Moving Average Convergence Divergence (MACD)
Analyzes the relationship between two moving averages to gauge momentum.
Group 1 (Strong Bearish): MACD & Histogram are negative and momentum is falling.
Group 2 (Weakening Bearish): MACD is negative but the histogram is rising or positive.
Group 3 (Neutral / Crossover): A crossover event is occurring near the zero line.
Group 4 (Bullish): MACD & Histogram are positive.
Group 5 (Strong Bullish): MACD & Histogram are positive, rising strongly, and accelerating.
Average Directional Index (ADX)
Measures trend strength, not direction. The score is based on both ADX value and the dominance of DI+ vs DI-.
Group 1 (Bearish / No Trend): ADX < 20 and DI- is dominant.
Group 2 (Developing Bearish Trend): 20 ≤ ADX < 25 and DI- is dominant.
Group 3 (Neutral / Indecision): Trend is weak or DI+ and DI- are nearly equal.
Group 4 (Developing Bullish Trend): 25 ≤ ADX ≤ 40 and DI+ is dominant.
Group 5 (Strong Bullish Trend): ADX > 40 and DI+ is dominant.
Ichimoku Cloud (IKH)
A comprehensive indicator that defines support/resistance, momentum, and trend direction.
Group 1 (Strong Bearish): Price is below the Kumo, Tenkan < Kijun, and Chikou is below price.
Group 2 (Bearish): Price is inside or below the Kumo, with mixed secondary signals.
Group 3 (Neutral / Ranging): Price is inside the Kumo, often with a Tenkan/Kijun cross.
Group 4 (Bullish): Price is above the Kumo with strong primary signals.
Group 5 (Strong Bullish): All signals are aligned bullishly: price above Kumo, bullish Tenkan/Kijun cross, bullish future Kumo, and Chikou above price.
Bollinger Bands (BB)
Measures volatility and relative price levels.
Group 1 (Strong Bearish): Price is below the lower band.
Group 2 (Bearish Territory): Price is between the lower band and the basis line.
Group 3 (Neutral): Price is hovering around the basis line.
Group 4 (Bullish Territory): Price is between the basis line and the upper band.
Group 5 (Strong Bullish): Price is above the upper band.
On-Balance Volume (OBV)
Uses volume flow to predict price changes. The score is based on OBV's trend and its position relative to its moving average.
Group 1 (Strong Bearish): OBV is below its MA and falling.
Group 2 (Weakening Bearish): OBV is below its MA but showing signs of rising.
Group 3 (Neutral): OBV is very close to its MA.
Group 4 (Bullish): OBV is above its MA and rising.
Group 5 (Strong Bullish): OBV is above its MA, rising strongly, and showing signs of a volume spike.
🧭 How to Use the T-Virus Sentiment Indicator
IMPORTANT: This indicator is a sentiment dashboard , not a direct buy/sell signal generator. Its strength lies in showing confluence and providing a quick, holistic view of the market's technical health.
Confirmation Tool: Use the "Active %" gauge to confirm a trade setup from your primary strategy. For example, if you see a bullish chart pattern, a high and rising sentiment score can add confidence to your trade.
Momentum & Trend Gauge: A consistently high score (e.g., > 75%) suggests strong, established bullish momentum. A consistently low score (< 25%) suggests strong bearish control. A score hovering around 50% often indicates a ranging or indecisive market.
Divergence & Warning System: Pay attention to divergences. If the price is making new highs but the sentiment score is failing to follow or is actively decreasing, it could be an early warning sign that the underlying momentum is weakening.
⚙️ Settings & Customization
The indicator is highly customizable to fit any trading style.
Position & Anchor: Control where the vial appears on the chart.
Styling (Vial, Helix, etc.): Nearly every visual element can be color-customized.
Signals: This is where the real power is. All underlying indicator parameters (RSI length, MACD settings, etc.) can be fine-tuned to match a personal strategy. The text labels can also be disabled if the chart feels cluttered.
Enjoy visualizing the market's DNA with the T-Virus Sentiment indicator