ATR Report & Tool█ OVERVIEW
This indicator reports the historical probabilities of the price trading past its Average True Range (ATR).
█ CONCEPTS
It is common knowledge that the market is not likely to trade past 1x ATR. Is this true? How much unlikely exactly? The indicator reports the data in a table and tells you precisely how often the price made it past x times ATR.
You have identified two plausible entries at different price structures or two targets at significant projections; which one should you choose? While is it possible to reach them, is this indeed probable? The indicator complements your analysis for making sounds trading decisions.
█ FEATURES
Price Selection Tool
The indicator has a price selection tool embedded. You can select a price on the chart and it will show the distance relative to the ATR so you can easily refer to the historical probability table.
Multi-Timeframe
By default, the indicator uses the daily timeframe for analyzing how much price moves compared to its average volatility during a day. To the same extent, you can set it to any other timeframe.
Configurable ATR
• Pick your preferred smoothing between the Simple Moving Average (SMA) or the Relative Moving Average (RMA).
• Set the length for getting the average price movement. For example, you can set it to 20 for the daily ATR (20 trading days in a month), 12 for the weekly ATR (3 months), or 6 for the monthly ATR.
• Select the reference between “previous” or “current” ATR value (default set on previous).
Data Window
The indicator provides additional volatility-related values and reporting data.
Others
Automatically hides the indicator when the chart’s timeframe is higher than the indicator’s one.
█ NOTES
Calculation
The volatility is calculated from the selected period's low to high. It may use the previous close when the market gaps up/down.
Statisticalprobability
SIMPLE CANDLESTICK PATTERN ALGO BACKTESTING - TESLA 4HMany traders spend a lot of time to create algorithms full of unrealistic and far from reality indicators and market conditions. With this script I want to help traders understand the advantage of the Pine language. Using indicators with no statistical foundation and creating algorithms with technical indicators and thousands of conditions is not always the right way to create an efficient tool.
With this script that we have called "SimpleBarPattern_LongOnly" we analyse the market through a simple condition, using bars or candles.
How it works
The condition is constructed as follows. You go long with 100% of the established capital and 0.03% commission. The first condition is that the minimum of the period under analysis falls below the opening level. The second condition is that the low of the period is below the low of the previous period. The third condition is that the close of the period is above the opening level. The final condition wants the current close to be higher than the previous open and higher than the previous close. We used a statistical approach in the creation of this script, some candlestick patterns that reflect these conditions are: Bullish Engulfing, Bullish Hammer and Morning Star .
This strategy aims to help traders make more accurate decisions while using candlesticks for their trading and scientifically demonstrates that candlesticks are valid statistical tools for financial analysis.
"SimpleBarPattern_LongOnly" is a very lightweight script created with Pine v5. We developed a user interface that can adjust the analysis period from a few days to several years.
The initial capital set is €1,000 (You can change this from the "Properties" section of the user interface).
Each individual trade uses 100% of the set capital, in this case €1,000.
The default commission per trade is 0.03% (You can change this in the "Properties" section of the user interface).
User Interface
1) General backtest time settings: Set the history period to be analysed
StartDate: backtest start date
StartMonth: backtest start month
StartYear: backtest start year
EndDate: backtest end day
EndMonth: backtest end month
EndYear: backtest end year
3) Stop Loss
4) Take Profit
Please do not hesitate to contact us for any questions or information.
Disclaimer
Be careful, the past is not a guarantee of future performance, so remember to use the script as a pure analysis tool. The developer takes no responsibility for any use other than research and analysis and can in no way be held liable for damages resulting from wrong use of this code.
Bar StatisticsThis script calculates and displays some bar statistics.
For the bar length statistics, it takes every length of upper or lower movements and calculates their average (with SD), median, and max. That way, you can see whether there is a bias in the market or not.
Eg.: If for 10 bars, the market moved 2 up, then 1 down, then 3 up, then 2 down, and 2 up, the average up bars length would be at 2.33, while the average for the down length would be at 1.5, showing that upper movements last longer than down movements.
For the range statistics, it takes the true range of each bar and calculates where the close of the bar is in relation to the true low of it. So if the closing of the bar is at 10.0, the low is at 9.0, and the high is at 10.2, the candle closed in the upper third of the bar. This process is calculated for every bar and for both closing prices and open prices. It is very useful to locate biasses, and they can you a better view of the market, since for most of the time a bar will open on an extreme and close on another extreme.
Eg.: Here on the DJI, we can see that for most of the time, a month opens at the lower third (near the low) and closes at the upper third (near the high). We can also see that it is very difficult for a month to open or close on the middle of the candle, showing how important the first and the last day are for determining the trend of the rest of the month.
Inferential Statistics And Quick Metrics For Strategy Analysis.Part of this script is used to calculate inferential statistics and metrics not available through the built in variables in the strategy tester.
A label will be created on the last bar displaying important strategy results, so you can test and analyze strategies quicker.
The built in strategy itself is just an example. You can copy and paste the metrics into any existing version 4 strategy and instantly use it**
**Just be sure all the variable names are unique in your target script.
I am looking for critique and would appreciate input on the statistical functions. I am aware that some of these functions are based on the assumption that the data is normally distributed. It's not meant to be perfect, but it is meant to be helpful. So if you think I can add or improve something to make it more helpful, let me know.
Bayes Probability Index by DGTWhat is Probability?
It is a measure for calculating the chances or the possibilities of the occurrence of a random event. In simple words, it calculates the chance of the favorable outcome amongst the entire possible outcomes. Mathematically, if you want to answer what is probability, it is defined as the ratio of the number of favorable events to the total number of possible outcomes of a random events.
Is this enough? May be or may be not
Let’s consider an example,
A simple probability question may ask: "What is the probability of Amazon.com's stock price falling?"
How about if we extend our question a step further by asking: "What is the probability of AMZN stock price falling given that the Dow Jones Industrial Average (DJIA) index fell earlier?"
Now we are ready to consider conditional probability and Bayes' Theorem is where we could find answer to this question
Bayes' Theorem
Bayes' theorem, named after 18th-century British mathematician Thomas Bayes, is a mathematical formula for determining conditional probability. Conditional probability is the likelihood of an outcome occurring, based on prior knowledge of conditions or another related event occurring. Bayes' theorem provides a way to revise existing predictions or theories (update probabilities) given new or additional evidence. Bayes' theorem thus gives the probability of an event based on new information that is, or may be related, to that event
Formula For Bayes' Theorem
P(A|B) = P(B∣A) * P(A) /P(B)
= P(B∣A) * P(A) / (P(B∣A)* P(A) + P(B∣A’)* P(A’) )
where
A and B are events and P is probability
P(A|B) is the posterior probability, the probability of A after taking into account B
P(A) is the prior probability, the probability of A belief
P(A’) is the prior probability, the probability of A disbelief : P(A’)=1- P(A)
P(B) is the prior probability, the probability of B belief
P(B∣A) is the conditional probability or likelihood, the degree of belief in B given that proposition of A belief (A true)
P(B∣A’) is the conditional probability or likelihood, the degree of belief in B given that proposition of A disbelief (A false)
Bitcoin was the first-ever cryptocurrency, designed by Satoshi Nakamoto. In its likeness, all other cryptocurrencies were then created. The relationship between Bitcoin and altcoins remains something crypto analyst watch closely. This study aims to display the likelihood of bullish movement for ALTS-USDT pairs taking into consideration of bullish move probability of BTC-USDT pair
What to look for:
Percentage Value of the Conditional Probability and/or Simple Probability. When value is above %50 than bullish move is more probable, conversely when the value is below %50 bearish move is more likely
Limitations : Conditional Probability Line will be shown for daily time frame only, Simply Probability Line would be available for all time frames
Conditional Probability is calculated with the condition of BTC-USDT pair so using Conditional Probability is suggested with ALTS-USDT pairs.
Indicators aim to generate a potential signal/indication of an upcoming opportunity, but, the Indicators themselves do not guarantee the future movement of a given financial instrument, and are most useful when used in combination with other techniques.
Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon solely
Disclaimer : The script is for informational and educational purposes only. Use of the script does not constitutes professional and/or financial advice. You alone the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold dgtrd TradingView user liable for any possible claim for damages arising from any decision you make based on use of the script