Improved Z-ScoreStandard Z-Score scripts lack customization of parameters that I personally desire when doing quantitative analysis. This is an improved Z-Score Indicator to add to your charts that lets you customize various inputs.
Below are the current features:
1) Ticker Type - which data would you like to use for the ticker input - Open, High, Low, Close, OHLC4
2) Ticker Smoothing? - sometimes if you have noisy data, it could be useful to smooth the ticker with a very fast EMA. If this is set to true, the ticker data will be smoothed with an EMA with period that you specify.
3) Ticker Smoothing Period - if Ticker Smoothing? is set to true, this will allow you to specify the smoothing period of the fast EMA - I usually use a 3-period for all of my quantitative analysis, if I am using smoothing.
4) MA Type - Z-Scores are normalized by subtracting a moving average. This allows you to select either a Simple Moving Average (SMA) or an Exponential Moving Average (EMA) - the standard is to use SMA.
5) MA Period - the previous X number of bars that you would like to use for normalization. The default is set to 21 (this is roughly 1 month of trading days data for a daily chart).
5) Standard Deviation Period - Z-Scores are normalized by dividing by the standard deviation over X previous periods. This allows you the chance to customize. Default is 252 (this is roughly 1 year of trading days data for a daily chart).
I can add more features if folks are interested, let me know! I hope you like the script.
Best regards,
-Jim Bosse-
Statistics
Yasir Hameed Advance RSI IndicatorRELATIVE STRENGTH INDEX ( RSI )
This is a tool that is widely used
Especially for Overbought and Oversold systems, but I have made some changes in this indicator,
How to use it...!
I have set it as the default setting
- RSI Length: 7
- Overbought: 70
- Oversold: 30
What is unique about this tool?
we can see 3 conditions:
1) RSI Overbought / Oversold with Bullish Engulfing / Bearish Engulfing
2) RSI Overbought / Oversold with Hammer and Shooting Star
3) RSI Overbought / Oversold with 2 Bullish Bars / 2 Bearish Bars
4) RSI Overbought / Oversold with All Patterns at the same time
When the RSI reaches its Oversold line, the code will wait for Bullish Engulfing pattren, when oversold and Bullish engulfing matched, This indicator will generate a buy signal when the condition is met,
and same as for Bear market, When the RSI reaches its Overbought line, the code will wait for Bearish Engulfing pattren, This indicator will generate a sell/exit signal when the condition is met,
2nd condition is that a Hammer candle will be waited for when RSI touches the Overbought line, for Bullish Move
and Shooting Star candle will be waited for when RSI touches the Overbought line, for Bullish Move, for Bearish Move
3rd Condition is also the same as Condition 1 and Condition 2,
When the RSI reaches its Oversold line, the code will wait for 2 Bullish Bars, when oversold and 2 Bullish Bars matched then this indicator will generate a buy signal, and same as for Bear market,
When the RSI reaches its Overbought line, the code will wait for 2 Bearish Bars, when overbought and 2 Bearish Bars matched then this indicator will generate a Sell signal,
4th Condition is that we can use All Conditions at the same time,
- Bullish Engulfing / Bearish Engulfing
- Hammer and Shooting Star
- 2 Bullish Bars / 2 Bearish Bars
Session backtest toolWith this tool you can easily backtest your trading strategy. You can set the times of a day session and evening session separately. The days of the week were indicated at the bottom of the chart.
For me personally, this saves me a lot of time with back testing. Hopefully I can help you with this too
Fed Funds Rate ProjectionsThis script makes projections via drawing boxes based upon changes in the fed funds rate (FRED:EFFR).
It works by turning the change in the fed funds rate into a user defined percentage (using a multiplier, by default a 1% rate of change implies a 10% change in the chart) and then drawing a box that distance away depending on the direction of the rate of change.
The size of the multiplier should depend on the duration of the asset which this is being applied to, for example, a long duration asset such as a high beta growth stock should use a larger multiplier.
Move Up/Down in X daysShows up and down moves off Y per cent for X days.
Also shows a bar for days that has a volume over a threshold.
Default configuration is 20% move up or down for 5 days and volume threshold of 9 Million.
52 Weeks Highs-Lows S&P 500 - MugurThe script uses the MAHP and the MALP index and subtracts the second from the first. So you can see how many stocks in the S&P 500 make new highs or new lows on a 52 weeks basis and see the trend of the market.
5 Day Highs-Lows S&P 500 - MugurThe script uses the M5HP and the M5LP index and subtracts the second from the first. So you can see how many stocks in the S&P 500 make new highs or new lows on a 5 days basis and see the trend of the market.
3 Month Highs-Lows S&P 500 - MugurThe script uses the M3HP and the M3LP index and subtracts the second from the first. So you can see how many stocks in the S&P 500 make new highs or new lows on a 3 month basis and see the trend of the market.
1 Month Highs-Lows S&P 500 - MugurThe script uses the M1HP and the M1LP index and subtracts the second from the first. So you can see how many stocks in the S&P 500 make new highs or new lows on a 1 month basis and see the trend of the market.
Range Gap/Open to Close/Close to CloseThis indicator shows the percentage variation of:
gap
close to close (day including gap)
open to close (without gap)
The green bars represent the days when the variation did not reach the selected range. The red bars show the days when the variation was higher than the selected range.
Best timeframe : DAY
Annual Returns % Comparison [By MUQWISHI]Overview
The Annual Returns % Comparison indicator aimed to compare the historical annual percentage change of any two symbols. The indicator output shows a column-plot that was developed by two using a pine script table, so each period has pair columns showing the yearly percentage change for entered symbols.
Features
- Enter date range.
- Fill up with any two symbols.
- Choose the output data whether adjusted or not.
- Change the location of the table plot
- Color columns by a symbol.
- Size the height and width of columns.
- Color background, border, and text.
- The tooltip of the column value appears once the cursor sets above the specific column. As it seen below.
Let me know if you have any questions.
Thanks.
Rolling QuartilesThis script will continuously draw a boxplot to represent quartiles associated with data points in the current rolling window.
Description :
A quartile is a statistical term that refers to the division of a dataset based on percentiles.
Q1 : Quartile 1 - 25th percentile
Q2 : Quartile 2 - 50th percentile, as known as the median
Q3 : Quartile 3 - 75th percentile
Other points to note:
Q0: the minimum
Q4: the maximum
Other properties :
- Q1 to Q3: a range is known as the interquartile range ( IQR ). It describes where 50% of data approximately lie.
- Line segments connecting IQR to min and max (Q0→Q1, and Q3→Q4) are known as whiskers . Data lying outside the whiskers are considered as outliers. However, such extreme values will not be found in a rolling window because whenever new datapoints are introduced to the dataset, the oldest values will get dropped out, leaving Q0 and Q4 to always point to the observable min and max values.
Applications :
This script has a feature that allows moving percentiles (moving values of Q1, Q2, and Q3) to be shown. This can be applied for trading in ways such as:
- Q2: as alternative to a SMA that uses the same lookback period. We know that the Mean (SMA) is highly sensitive to extreme values. On the other hand, Median (Q2) is less affected by skewness. Putting it together, if the SMA is significantly lower than Q2, then price is regarded as negatively skewed; prices of a few candles are likely exceptionally lower. Vice versa when price is positively skewed.
- Q1 and Q3: as lower and upper bands. As mentioned above, the IQR covers approximately 50% of data within the rolling window. If price is normally distributed, then Q1 and Q3 bands will overlap a bollinger band configured with +/- 0.67x standard deviations (modifying default: 2) above and below the mean.
- The boxplot, combined with TradingView's builtin bar replay feature, makes a great tool for studies purposes. This helps visualization of price at a chosen instance of time. Speaking of which, it can also be used in conjunction with a fixed volume profile to compare and contrast the effects (in terms of price range) with and without consideration of weights by volume.
Parameters :
- Lookback: The size of the rolling window.
- Offset: Location of boxplot, right hand side relative to recent bar.
- Source data: Data points for observation, default is closing price
- Other options such as color, and whether to show/hide various lines.
SuperVos Trade calculatorHave all your trade data in one small overview.
- TP amount in USD and %
- RR of the trade
- Cost if stoploss is hit
- Total profit in USD
- Account growth in percentage
- Sets automatic alerts on SL, entry en TP's if enabled
Enjoy!
Candle DifferenceA simple script to show the price different between the previous candle and all the points of the current open candle. (including: high, low, open)
They are color labeled. (You check what each color means in the settings of the script)
Value At Risk Channel [AstrideUnicorn]The Value at Risk Channel (VaR Channel) is a trading indicator designed to help traders control the level of risk exposure in their positions. The user can select a time period and a probability value, and the indicator will plot the upper and lower limits that the price can reach during the selected time period with the given probability.
CONCEPTS
The indicator is based on the Value at Risk (VaR) calculation. VaR is an important metric in risk management that quantifies the degree of potential financial loss within a position, portfolio or company over a specific period of time. It is widely used by financial institutions like banks and investment companies to forecast the extent and likelihood of potential losses in their portfolios.
We use the so-called “historical method” to compute VaR. The algorithm looks at the history of past returns and creates a histogram that represents the statistical distribution of past returns. Assuming that the returns follow a normal distribution, one can assign a probability to each value of return. The probability of a specific return value is determined by the distribution percentile to which it belongs.
HOW TO USE
Let’s assume you want to plot the upper and lower limits that price will reach within 4 hours with 5% probability. To do this, go to the indicator Settings tab and set the Timeframe parameter to "4 hours'' and the Probability parameter to 5.0.
You can use the indicator to set your Stop-Loss at the price level where it will trigger with low probability. And what's more, you can measure and control the probability of triggering.
You can also see how likely it is that the price will reach your Take-Profit within a specific period of time. For example, you expect your target level to be reached within a week. To determine this probability, set the Timeframe parameter to "1 week" and adjust the Probability parameter so that the upper or lower limit of your VaR channel is close to your Take-Profit level. The resulting Probability parameter value will show the probability of reaching your target in the expected time.
The indicator can be a useful tool for measuring and managing risk, as well as for developing and fine-tuning trading strategies. If you find other uses for the indicator, feel free to share them in the comments!
SETTINGS
Timeframe - sets the time period, during which the price can reach the upper or lower bound of the VaR channel with the probability, set by the Probability parameter.
Probability - specifies the probability with which the price can reach the upper or lower bound of the VaR channel during the time period specified by the Timeframe parameter.
Window - specifies the length of history (number of historical bars) used for VaR calculation.
Opening Price ChangeThis script shows the change from the market opening price to the market closing price of the previous day in percent.
With this you can quickly get an overview of historical data for the change of the respective day.
Important: the market closing price is always used for the calculation and not the pre/post market price.
The label with the change value is always placed above the first opens regular market bar. If the change is positive, the label is draw with a green background, is the change is negative you will have a red background.
SPY Volume Weighted CloseHey everyone!
Deciding to make this indicator public and open access.
This is a volume weighted close indicator for SPY. It is a statistics based indicator.
How it works:
It uses volume data mixed with some price action data to prospectively predict where SPY's price will close within a 30 minute interval.
As such, its different from other indicators in the sense that its not reactive, it proactive and actively predicts the price that SPY will see within the next 30 minutes and where SPY will most likely close at.
It has 3 bands. The main centre band (blue, but colour can be changed) is the most likely price that SPY will close at within the next 30 minutes.
The Upper Level Confidence and Lower Level Confidence bands are the expected range that the analysis thinks SPY will remain confined in based on current volume and price action.
How to Use it:
I personally use this in place of VWAP, but the applications are infinite. Take a look at the chart below:
Applications:
This is specifically programmed for SPY but I have used it with other stocks such as QQQ, UPRO and DIA. However, using it with those stocks, the upper and lower confidence bands are not helpful. But YMMV with other stocks. This is specifically designed for SPY.
Let me know your questions and thoughts!
Thanks for reading and checking this out!
deseasonalized_modDescription:
As in the decomposition of time series data, the indicator was modified from the deseasonalized process, to avoid overfitting as in the original format, aiming to exclude seasonal component (shorter time-period in consideration), thus leaving trend and irregularity. The indicator is expected to identify short-term trends, based on the given timeframe.
Notes:
Length set to 10-bar as default, while reducing the length to e.g. 8 increase more responsive of the fitted data, however inline to increase a false trend identification (bias-variance trade-off). To be noted, the indicator wasn't a momentum indicator, thus can only expect the trend identifier instead. If the price is above the fitted line (indicator), and experiencing a retracement, regularly expected to be bounced around the fitted line (support), while if breaks to the downside, expected a trend reversal, and become a (resistance).
Feature:
Buy/Long overlay signal
Sell/Short overlay signal
Alert
Plots CAGR lines for a given set of ratesPlots CAGR lines for a given set of rates from a specified time. It will be helpful to see how the rate of growth of a security's price is changing over a period of time. It also calculates the current CAGR from the time specified. Works on D, W, M timeframes.
Crypto Terminal [Kioseff Trading]Hello!
Introducing Crypto Terminal (:
The indicator makes use of cryptocurrency data provided by vendor INTOTHEBLOCK.
NOTE: The cryptocurrency on your chart must be paired with USD or USDT. Data won't load otherwise - possibly transient. For instance, BTCUSD or BTCUSDT, ETHUSD or ETHUSDT.
Provided datasets:
Twitter Sentiment Data
Telegram Sentiment Data
Whale Data (i.e. % of Asset Belonging to Whales)
$100,000+ Transactions
Bulls/Bears (Bulls Buying | Bears Selling)
Current Position PnL (Currently Open Positions for the Coin are Retrieved and Plotted. Data is Split into Currently Profitable Positions, Losing Positions, and B/E Positions)
Average Balance
Holders/Traders Percentage (Addresses are Retrieved and Classified as Holding Accounts or Trader Accounts)
Correlation
Futures OI
Perpetual OI
Zero Balance Addresses
Flow (Money Inflow & Outflow)
Active Addresses
Average Transaction Time
Realized PnL (Addresses with Realized Profits, Realized Losses, and B/E)
Cruisers
A few more data points are provided.
Additionally, you can plot the values of any dataset in a pane below price.
Below are images of plottable data; different cryptocurrencies will be shown for each example (:
Twitter sentiment data.
Assess this data lightly; difficult to confirm accuracy.
Telegram sentiment data.
Assess this data lightly; difficult to confirm accuracy.
Percentage of asset belonging to whales.
$100,000+ transactions (volume oriented)
Bulls buying; bears selling.
Current positions at profit; current positions at loss; current positions at breakeven.
Average balance.
Percentage of asset belonging to traders; percentage of asset belonging to holders.
Asset's 30-interval correlation to BTC.
Perpetual open interest.
Zero-balance addresses.
Flows.
Active addresses.
Average transaction time.
Addresses at realized profit; addresses at realized loss; addresses at breakeven.
Cruiser data.
Futures open interest.
Naturally, this data isn't provided for every cryptocurrency; NaN values are returned in some instances.
Table 1
I provided three data tables, which load independently, so you don't have to change plotted data to access values.
Table 2
Lastly, you can create a 10-asset crypto index and run calculations against it.
The image shows an example.
I'll update this script with additional calculations/data in the near future. If you've any suggestions - please let me know!
Enjoy (:
Inflation Adjusted Performance: Ticker/M2 money supplyPlots current ticker / M2 money supply, to give an idea of 'inflation adjusted performance'.
~In the above, see the last decade of bullish equities is not nearly as impressive as it seems when adjusted to account for the FED's money printing.
~Works on all timeframes/ assets; though M2 money supply is daily data release, so not meaningful to plot this on timeframe lower than daily.
~To display on same pane; comment-out line 6 and un-comment line 7; then save, remove and re-add indicator.
~Scale on the right is meaningless; this indicator is just to show/compare the shape of the charts.
Breakout Probability (Expo)█ Overview
Breakout Probability is a valuable indicator that calculates the probability of a new high or low and displays it as a level with its percentage. The probability of a new high and low is backtested, and the results are shown in a table— a simple way to understand the next candle's likelihood of a new high or low. In addition, the indicator displays an additional four levels above and under the candle with the probability of hitting these levels.
The indicator helps traders to understand the likelihood of the next candle's direction, which can be used to set your trading bias.
█ Calculations
The algorithm calculates all the green and red candles separately depending on whether the previous candle was red or green and assigns scores if one or more lines were reached. The algorithm then calculates how many candles reached those levels in history and displays it as a percentage value on each line.
█ Example
In this example, the previous candlestick was green; we can see that a new high has been hit 72.82% of the time and the low only 28.29%. In this case, a new high was made.
█ Settings
Percentage Step
The space between the levels can be adjusted with a percentage step. 1% means that each level is located 1% above/under the previous one.
Disable 0.00% values
If a level got a 0% likelihood of being hit, the level is not displayed as default. Enable the option if you want to see all levels regardless of their values.
Number of Lines
Set the number of levels you want to display.
Show Statistic Panel
Enable this option if you want to display the backtest statistics for that a new high or low is made. (Only if the first levels have been reached or not)
█ Any Alert function call
An alert is sent on candle open, and you can select what should be included in the alert. You can enable the following options:
Ticker ID
Bias
Probability percentage
The first level high and low price
█ How to use
This indicator is a perfect tool for anyone that wants to understand the probability of a breakout and the likelihood that set levels are hit.
The indicator can be used for setting a stop loss based on where the price is most likely not to reach.
The indicator can help traders to set their bias based on probability. For example, look at the daily or a higher timeframe to get your trading bias, then go to a lower timeframe and look for setups in that direction.
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!