Three Linear Regression ChannelsPlot three linear regression channels using alexgrover 's Computing The Linear Regression Using The WMA And SMA indicator for the linear regression calculations.
Settings
Length : Number of inputs to be used
Source : Source input of the indicator
Midline Colour : The colour of the midline
Channel One, Two, and Three Multiplicative Factor : Multiplication factor for the RMSE, determine the distance between the upper and lower level
Channel One, Two, and Three Colour : The channel's lines colour
Usage
For usage details, please refer to alexgrover 's Computing The Linear Regression Using The WMA And SMA indicator.
Statistics
Multi-Optimized Linear Regression ChannelA take on alexgrover 's Optimized Linear Regression Channel script which allows users to apply multiple linear regression channel with unique multiplicative factors.
Multiplicative Factors
Adjust the amount of channels and multiplicative factors of existing or additional channels using the "Mults" input.
An input of "1" creates a single linear regression channel with the multiplicative factor of one.
An input of "4" creates a single linear regression channel with the multiplicative factor of four.
An input of "1,4" creates two linear regression channels with multiplicative factors of one and four.
An input of "1,2,3" creates three linear regression channels with multiplicative factors of one, two, and three.
AmitN STDEV V5Often, a trader would like to predict the range for the next certain amount of period. This is useful for doing short strangles, Iron Fy, Iron Condor strategies.
This script calculates the price range for the next 'X' number of candles on the given timeframe based on Standard Deviation formulae.
It gives this range on 1 standard deviation and 2 standard deviations.
-----------------------------------------------------------
1SD Range : Probability of expiry in that range is 68 %
2SD Range : Probability of expiry in that range is 95 %
-----------------------------------------------------------
From the settings, you can choose the "lookback" period which is used to calculate the next price prediction based on those many candles.
The range is plotted in the form of lines. It marks the range and also the difference between spot and the range-value.
Market Beta/Beta Coefficient for CAPM [Loxx]Market Beta/Beta Coefficient for CAPM is not so much an indicator as it is a value to be used in future indicators to forecast stock prices using the Capital Asset Pricing Model, CAPM. CAPM is used by the likes of value investors such as Warren Buffet and valuation/accounting/investment banking firms. More specifically, CAPM is typically used in Discounted Cashflow Analysis to value revenue generating assets.
What is Beta?
In finance, the beta (β or market beta or beta coefficient) is a measure of how an individual asset moves (on average) when the overall stock market increases or decreases. Thus, beta is a useful measure of the contribution of an individual asset to the risk of the market portfolio when it is added in small quantity. Thus, beta is referred to as an asset's non-diversifiable risk, its systematic risk, market risk, or hedge ratio. Beta is not a measure of idiosyncratic risk.
By definition, the value-weighted average of all market-betas of all investable assets with respect to the value-weighted market index is 1. If an asset has a beta above (below) 1, it indicates that its return moves more (less) than 1-to-1 with the return of the market-portfolio, on average. In practice, few stocks have negative betas (tending to go up when the market goes down). Most stocks have betas between 0 and 3.
How to calculate Beta
To calculate beta you typically choose 5 years of monthly data; typically SPY is used here
Calculate log returns of both the asset for which you are calculating Beta and the benchmark market data
Calculation the covariance between the asset and benchmark
Calculate the variance of the benchmark returns
Divide the covariance by the variance
Read more here:
en.wikipedia.org(finance)
en.wikipedia.org
einvestingforbeginners.com
Candle wick averageThis tool shows all 4 values: (Candle chart can describe the size)
- Average wick length below It is calculated as the length of the candle wick under the rising candlestick. calculated average (AVG) and Standard Deviation (STDEV). plot on the chart at the current bar using (open price ) - (average + STDEV ).
- Average wick + average body above(high - open) is calculated from the upper wick and upper body wick length of the rising candle. take Average (AVG) and standard deviation (STDEV). plot on the chart at the current bar using (open price) + (average + 2*STDEV)
- The other 2 values are calculated in the same way. But using the data of the candlestick that the price has moved down.
Usage example
- Use the average of the lower wick length to determine the SL for buy order.
- Use the average wick length and the candle above to set the TP for buy order.
- The other 2 values use in the same way for sell order
Correlation with P-Value & Confidence Interval (alt)Shows the Pearson correlation between two symbols, including statistical significance test.
This is a fork of the original script by Balipour, with the addition of EMA that can be used instead of SMA in the Pearson correlation as an attempt to capture correlation trend changes more quickly, and conversion to pinescript v5. In the end, the EMA does not help much, for a faster capture of correlation trend changes, another kind of correlation is necessary, such as sign test correlation (another one of my indicators implement this idea).
Please show the original indicator's author some love if you appreciate this work:
BTC's #4 Whale Sells [TheSecretGuy]Hello there !
I have been tracking BTC richests wallets for some time - and one of them seems to be aligning its sells pretty well with what the market is about to do.
BTC's Whale #3 (now Whale #4) has been selling his BTC in very crutial moments - therefore I felt that converting this into an indicator will give us a pretty visual feedback of what that Whale expects to happen at a given point.
In order to do that, I have listed manually all of his sells (dates) until today and placed a vertical line on the chart on each of these dates.
This sadly can't be automated as Pinescript language doesn't allow to reach outter data - I'd need to update this manually.
Hope this helps you a bit, Cheers!
Dealar VIX Implied Range + Retracement LevelsThis Implied range Is derived by the VIX(1 sd annual +/- Implied move.)
This Indicator plots the daily Implied range, A lot of quantitative trading firms/ MM firms hedge their delta & gamma exposure around the Implied range(prop calc). I have added retracement levels as well, so you have more pivot levels.
Enjoy!
[MAD] TrendmonitorFollowing indicator is a multi-asset monitor
Possibilitys:
16 Custom tickers
7 Colorschemes
Smoothing and scaling of the assets
invert the colors
shift the labels left/right
Hussarya compare DJI SPX BTCScript shows relations between DJI downJones SPX and BTC:USD.
DJI chart must be set from candlestick to line
Red line is price (close). x 8
Green line ist te price BTCUSD from Binance price (close) x 1.5
Z Bollinger BandsThis version of Bollinger Bands measures the average volatility. By taking the 75th percentile of the average absolute value of the difference between the Source and the Mean divided by the Standard Deviation and using that as our multiplier for our Bollinger bands we can have a statistically safe trading zone.
You notice that its dynamic, this is because it take into account the real volatility levels of a window and uses that to determine an appropriate multiplier. As always I hope you enjoy this release.
Standard Deviation Histogram (SDH)This script tells you what standard deviation the price is from the mean. Due to the limitations of the calculations this study only works for stocks. Further limitations include and inability to calculate past 10 deviation. I have added a smoothing feature and the ability to change the colors. Dont be afraid to change the style to line instead of a histogram. Enjoy!
Candlestick Pattern Criteria and Analysis Indicator█ OVERVIEW
Define, then locate the presence of a candle that fits a specific criteria. Run a basic calculation on what happens after such a candle occurs.
Here, I’m not giving you an edge, but I’m giving you a clear way to find one.
IMPORTANT NOTE: PLEASE READ:
THE INDICATOR WILL ALWAYS INITIALLY LOAD WITH A RUNTIME ERROR. WHEN INITIALLY LOADED THERE NO CRITERIA SELECTED.
If you do not select a criteria or run a search for a criteria that doesn’t exist, you will get a runtime error. If you want to force the chart to load anyway, enable the debug panel at the bottom of the settings menu.
Who this is for:
- People who want to engage in TradingView for tedious and challenging data analysis related to candlestick measurement and occurrence rate and signal bar relationships with subsequent bars. People who don’t know but want to figure out what a strong bullish bar or a strong bearish bar is.
Who this is not for:
- People who want to be told by an indicator what is good or bad or buy or sell. Also, not for people that don’t have any clear idea on what they think is a strong bullish bar or a strong bearish bar and aren’t willing to put in the work.
Recommendation: Use on the candle resolution that accurately reflects your typical holding period. If you typically hold a trade for 3 weeks, use 3W candles. If you hold a trade for 3 minutes, use 3m candles.
Tldr; Read the tool tips and everything above this line. Let me know any issues that arise or questions you have.
█ CONCEPTS
Many trading styles indicate that a certain candle construct implies a bearish or bullish future for price. That said, it is also common to add to that idea that the context matters. Of course, this is how you end up with all manner of candlestick patterns accounting for thousands of pages of literature. No matter the context though, we can distill a discretionary trader's decision to take a trade based on one very basic premise: “A trader decides to take a trade on the basis of the rightmost candle's construction and what he/she believes that candle construct implies about the future price.” This indicator vets that trader’s theory in the most basic way possible. It finds the instances of any candle construction and takes a look at what happens on the next bar. This current bar is our “Signal Bar.”
█ GUIDE
I said that we vet the theory in the most basic way possible. But, in truth, this indicator is very complex as a result of there being thousands of ways to define a ‘strong’ candle. And you get to define things on a very granular level with this indicator.
Features:
1. Candle Highlighting
When the user’s criteria is met, the candle is highlighted on the chart.
The following candle is highlighted based on whether it breaks out, breaks down, or is an inside bar.
2. User-Defined Criteria
Criteria that you define include:
Candle Type: Bull bars, Bear bars, or both
Candle Attributes
Average Size based on Standard Deviation or Average of all potential bars in price history
Search within a specific price range
Search within a specific time range
Clarify time range using defined sessions and with or without weekends
3. Strike Lines on Candle
Often you want to know how price reacts when it gets back to a certain candle. Also it might be true that candle types cluster in a price region. This can be identified visually by adding lines that extend right on candles that fit the criteria.
4. User-Defined Context
Labeled “Alternative Criteria,” this facet of the script allows the user to take the context provided from another indicator and import it into the indicator to use as a overriding criteria. To account for the fact that the external indicator must be imported as a float value, true (criteria of external indicator is met) must be imported as 1 and false (criteria of external indicator is not met) as 0. Basically a binary Boolean. This can be used to create context, such as in the case of a traditional fractal, or can be used to pair with other signals.
If you know how to code in Pinescript, you can save a copy and simply add your own code to the section indicated in the code and set your bull and bear variables accordingly and the code should compile just fine with no further editing needed.
Included with the script to maximize out-of-the-box functionality, there is preloaded as alternative criteria a code snippet. The criteria is met on the bull side when the current candle close breaks out above the prior candle high. The bear criteria is met when the close breaks below the prior candle. When Alternate Criteria is run by itself, this is the only criteria set and bars are highlighted when it is true. You can qualify these candles by adding additional attributes that you think would fit well.
Using Alternative Criteria, you are essentially setting a filter for the rest of the criteria.
5. Extensive Read Out in the Data Window (right side bar pop out window).
As you can see in the thumbnail, there is pasted a copy of the Data Window Dialogue. I am doubtful I can get the thumbnail to load up perfectly aligned. Its hard to get all these data points in here. It may be better suited for a table at this point. Let me know what you think.
The primary, but not exclusive, purpose of what is in the Data Window is to talk about how often your criteria happens and what happens on the next bar. There are a lot of pieces to this.
Red = Values pertaining to the size of the current bar only
Blue = Values pertaining or related to the total number of signals
Green = Values pertaining to the signal bars themselves, including their measurements
Purple = Values pertaining to bullish bars that happen after the signal bar
Fuchsia = Values pertaining to bearish bars that happen after the signal bar
Lime = Last four rows which are your percentage occurrence vs total signals percentages
The best way I can explain how to understand parts you don’t understand otherwise in the data window is search the title of the row in the code using ‘ctrl+f’ and look at it and see if it makes more sense.
█ [b}Available Candle Attributes
Candle attributes can be used in any combination. They include:
[*}Bodies
[*}High/Low Range
[*}Upper Wick
[*}Lower Wick
[*}Average Size
[*}Alternative Criteria
Criteria will evaluate each attribute independently. If none is set for a particular attribute it is bypassed.
Criteria Quantity can be in Ticks, Points, or Percentage. For percentage keep in mind if using anything involving the candle range will not work well with percentage.
Criteria Operators are “Greater Than,” “Less Than,” and “Threshold.” Threshold means within a range of two numbers.
█ Problems with this methodology and opportunities for future development:
#1 This kind of work is hard.
If you know what you’re doing you might be able to find success changing out the inputs for loops and logging results in arrays or matrices, but to manually go through and test various criteria is a lot of work. However, it is rewarding. At the time of publication in early Oct 2022, you will quickly find that you get MUCH more follow through on bear bars than bull bars. That should be obvious because we’re in the middle of a bear market, but you can still work with the parameters and contextual inputs to determine what maximizes your probability. I’ve found configurations that yield 70% probability across the full series of bars. That’s an edge. That means that 70% of the time, when this criteria is met, the next bar puts you in profit.
#2 The script is VERY heavy.
Takes an eternity to load. But, give it a break, it’s doing a heck of a lot! There is 10 unique arrays in here and a loop that is a bit heavy but gives us the debug window.
#3 If you don’t have a clear idea its hard to know where to start.
There are a lot of levers to pull on in this script. Knowing which ones are useful and meaningful is very challenging. Combine that with long load times… its not great.
#4 Your brain is the only thing that can optimize your results because the criteria come from your mind.
Machine learning would be much more useful here, but for now, you are the machine. Learn.
#5 You can’t save your settings.
So, when you find a good combo, you’ll have to write it down elsewhere for future reference. It would be nice if we could save templates on custom indicators like we can on some of the built in drawing tools, but I’ve had no success in that. So, I recommend screenshotting your settings and saving them in Notion.so or some other solid record keeping database. Then you can go back and retrieve those settings.
#6 no way to export these results into conditions that can be copy/pasted into another script.
Copy/Paste of labels or tables would be the best feature ever at this point. Because you could take the criteria and put it in a label, copy it and drop it into another strategy script or something. But… men can dream.
█ Opportunities to PineCoders Learn:
1. In this script I’m importing libraries, showing some of my libraries functionality. Hopefully that gives you some ideas on how to use them too.
The price displacement library (which I love!)
Creative and conventional ways of using debug()
how to display arrays and matrices on charts
I didn’t call in the library that holds the backtesting function. But, also demonstrating, you can always pull the library up and just copy/paste the function out of there and into your script. That’s fine to do a lot of the time.
2. I am using REALLY complicated logic in this script (at least for me). I included extensive descriptions of this ? : logic in the text of the script. I also did my best to bracket () my logic groups to demonstrate how they fit together, both for you and my future self.
3. The breakout, built-in, “alternative criteria” is actually a small bit of genius built in there if you want to take the time to understand that block of code and think about some of the larger implications of the method deployed.
As always, a big thank you to TradingView and the Pinescript community, the Pinescript pros who have mentored me, and all of you who I am privileged to help in their Pinescripting journey.
"Those who stay will become champions" - Bo Schembechler
Market Sessions [Kaspricci]A simple indicator to show you the opening hours of the main markets in London, New York, Tokio and Sydney. It is not shown in your main chart window and as such does not make the chart more difficult to read.
You can turn each market on and off individually and also change the start and end time, if you wish so. All based on GMT timezone, but will be translated into your local timezone.
Happy to receive your feedback.
Crypto Map Dashboard v1.0🔰Overview
Charts are an essential part of working with data, as they are a way to condense large amounts of data into an easy to understand format. Visualizations of data can bring out insights to someone looking at the data for the first time, as well as convey findings to others who won’t see the raw data. There are countless chart types out there, each with different use cases. Often, the most difficult part of creating a data visualization is figuring out which chart type is best for the task at hand.
What are the types of metrics, features, or other variables that you plan on plotting? Although it depended on some multiple factors!
But my choices of the chart type for this Crypto datas was Pie chart or Donut char for crypto dominances ,and Colum (Bar) chart for Total MarketCaps .
The audiences that I plan on presenting this for them could be all tradingviewrs , especially crypto lovers ,or those who just aim to have an initial exploration for themselves ,like me!
so this indicator mostly could be an educational indicator script for pine coders !
We can use the " Crypto Map Dashboard " indicator to Get an quick overview of the crypto market and monitor where the smart money Flow changing by comparing the dominances and totals Caps .
In general, it consists of 4 parts:
✅1 =>> Table1 : If you like to see and compare and monitor the changes of dominances of (Bitcoin, Ethereum, Usdt , Usdc , etc.) and their market cap in different times you can see the table on The upper-right corner.
✅2 =>> Table2: Also, in the table lower-right corner, you can see the changes of the totals(Total, Total2 , Total3 and TotalDefi) in the same time periods.
✅3 =>> pie chart or donut chart: By viewing this , you understand better about Table1 Datas, that it depicts exactly how Dominance is distributed and specialized.
✅4 =>> column chart (bar chart) : And in the last you can clearly compare the total marketcaps and see how far they are from their ATHs.
You also can even notice the entry and exit of liquidity from the crypto market!
I must also mention that I am definitely still a beginner compared to more experienced pine coders, and there may be some bugs in my codes and calculations, but I am an open person and I welcome your comments ,Also Let me know if you have any questions.
Lots of Love to all tradingviewers and pineCoder ,Cheers!💚❤️💙
SMA 10/20/50 by Bull Bear Investing BabyThis script basically is a combination of 3 different simple moving averages line to determine the trend of the assets
The colour indicating which moving averages are as per following:
1) Green- 10MA
2) Red- 20MA
3) Blue- 50MA
When the moving averages are aligned as per following, the trend is indicating towards an uptrend:
---> 10ma > 20ma > 50ma
Likewise when the moving averages are aligned as per following, the trend is indicating towards a downtrend:
---> 10ma < 20ma < 50ma
Dollar Cost Averaging (Portfolio)
You can use it in daily, weekly and monthly candles. It can be used on multiple assets(10). All assets must have data and make sure they all use the same currency. See style in settings for plot titles If you are interested in passive investing, I hope it helps.
------------------
Günlük, haftalık, aylık mumlarda kullabilirsiniz. Birden fazla varlıkta kullanılabilir. Çoklu kullanım için hepsinin verisi olmalı ve aynı para birimini kullanmalı. Ayarlardan stilde grafik başlıklarını bulabilirsiniz. Pasif yatırım ile ilgiyseniz umarım yardımcı olur.
TPO Market Profile [Kioseff Trading]REPOST; SCRIPT WORKS!!
Due to technical error, this script was republished! Thank you for your support (:
Hello!
This indicator comprises a real time TPO Market Profile!
The script works on any timeframe 1 second or greater - the script calculates relative to the timeframe selected for your chart.
The image above shows the 1-minute BTCUSD chart; 650 +/- tick levels are set.
To see the script in full functionality - try using bar replay on a cryptocurrency 1-minute chart (start at the beginning of a regular hours session). Be sure to adjust the tick spread if necessary (:
So far, the script's held up in real time - I've not had any array loop errors or timeouts. The TPO profile updates accordingly with changes in time / high and low prices. Letters are appended to the profile in real time.
The image above shows configurations for the indicator. I plan to update the indicator quite a bit over the coming days - more to come.
You can select the timeframe change the indicator accounts for. For instance, you can have set the indicator to reset every day, every 30 minutes, every 5 minutes, every week, month, etc.
In the image above, I configured the indicator to recalculate every 3 months. Consequently, the indicator will record a TPO profile for three consecutive, reset, then record a TPO profile for the next 3 months. This setting makes the indicator compatible with any timeframe greater than 1 minute.
You can also use a drag & drop time-start bar to modify the starting point for the market profile TPO calculation.
The indicator hosts an option to auto calculate the tick spread between levels. However, as you switch timeframes and assets, sometimes, you'll have to manually set the tick range (:
Thanks for checking it out; more to come!
Sep 4
Release Notes: UPDATE: The indicator can work on seconds-based charts.
The image above shows the indicator working on the 1-second chart.
(Screenshot is old; characters are now numbered instead of strange unicode)
Release Notes: Added value area + vah + val. Font update. Changed characters to numbered once the alphabet is exhausted. POC, VAH, and VAL label located left of the first bar of the interval. Initial balance range can be toggled. Spaced the characters (more legible). Quite a bit of aesthetic changes so check it out!
Soon, I'll release a version of the script that shows VAH, POC, VAL, and TPO letters from previous sessions. I coded this feature into this indicator; however, it was removed due to load time complications. This feature will be its own script (:
If the script has trouble loading please let me know (:
TPO Letters [Kioseff Trading]Hello!
"TPO Letters" functions similarly to the script "Realtime TPO Profile"; however, TPO characters are appended to a developing bar. Simply, TPO characters display on the bar that formed them.
All colors are configurable.
The image above emphasizes functionality; TPO letters are colored on a gradient . Additionally, the value area range is shaded; characters that form within the range are gradient colored. Gray-colored characters extend beyond the value area.
The columned data displayed right of the TPO letters shows tick levels. Tick levels are shaded various colors, each color indicative of some occurrence.
Tick Levels
Red: Single Print
Yellow: POC
Lime Green: VAH or VAL
Lighter Green: Value Area Inclusive Level
Left of the TPO horizontal-axis, the aqua-colored line (blue-line inclusive) reflects the high-low range of the session; the blue-colored line reflects the initial-balance range (IBR).
You can select to color TPO letters within the IBR blue (any color).
Additionally, you can select to shade the IBR.
The image above shows auxiliary features.
Unfortunately, I'm unable to orient TPO letters at their intended tick levels using one label per bar, a contrasting feature of the "Realtime TPO Profile" script.
This means only 1000 TPO letters can be displayed simultaneously. If the number of TPO letters exceeds 1000, early-session and middle-session characters will begin to disappear. This isn't an issue for the "Realtime TPO Profile" script, as each tick level comprised one label, to which additional TPO characters were appended to the label as necessary and extended horizontally. Using this same method proved fallible for this indicator - vertical scaling is an issue. While I could append all letters formed for a bar to one label, the letters wouldn't superimpose atop their corresponding tick level (using " " didn't suffice).
Consequently, you'll have to, at times, rely on the label & box count oriented in the bottom-right table to see whether the number of labels & boxes transcends the upper threshold. You can hide this table at anytime (:
The image above exemplifies the "Fixed Range" portion of the indicator. A useful inclusion for the "Realtime TPO Profile" script however, while still useful for "TPO Letters", can only display 1000 TPO letters concurrently.
You can also reset the TPO profile at user-defined time intervals.
The indicator hosts an auto-calculate tick levels option; however, there will be times you'll need to manually adjust the tick levels to achieve digestible results (:
That's all! If the script would benefit from an excluded feature, or you notice an error, please let me know! Thank you (:
Shoutout to @kaigouthro for creating an exceptional library for gradient colors!! It was used in this script (:
YOY[TV1]Year-to-year comparison is a popular and effective way to evaluate a company's financial performance and investment performance.
Any measurable event that repeats yearly can be compared based on YoY.
As a rule, the indicator YoY (year to year) is the number of percentages indicating an increase or regression in relation to the future or past period.
For example, you can compare WM2NS using the YOY (Year to Year) method.
The Offset argument sets the data comparison period. For daily, weekly and monthly timeframes, if Offset is set to 0, it will be determined automatically.
Сравнение Год к году - популярный и эффективный способ оценки финансовых показателей компании и эффективность инвестиций.
Любое измеримое событие, которое повторяется ежегодно можно сравнить на основе YoY.
Как правило, показателем YoY (year to year) является количество процентов указывающее на прирост или регресс по отношению к будущему или прошлому периоду.
Например, вы можете сравнить WM2NS (эмиссию доллара) с помощью метода YOY (Год к году).
Допустим, в 2021 году вы эмитировали А долларов, а в 2022 вы эмитировали Б долларов
Итак итоговой формулой будет: ((Б - А) / А) * 100
Аргумент Offset устанавливает период сравнения данных. Для дневного, недельного и месячного таймфрейма, если Offset установлен в 0, будет определен автоматически.
Historical Crypto Conference DatesJust a basic list date script to display various conference dates from the crypto sector. Updates to add more conferences.
Red - BTC Miami
Blue - Consensus
VPT Timeleft v.10Timeleft counter for candle in minutes. It will countdown the time left for a candle to close and display near the running candle.