BlackMEX - Production CostBitcoin's Value as determined by Joules of energy input only
Calculations per Medium article EV = (Energy-in) / (Supply Growth Rate) * (Fiat Factor)
Historic Energy Efficiency data can only be entered monthly due to processing speed constraints of below data load and should be considred an estimate only.
Energy Efficiency Data requires manual updating. Currently accurate as of 28 December 2019
Bitcoin Production Cost
Cambridge Bitcoin Electricity Consumption Index (CBECI) - Bitcoin's global electricity consumption in TwH.
NB: Uses MONTHLY averages of raw data from CBECI. TV script run-time is too slow with Daily/Weekly data here.
This requires manual updating once a month for ongoing accuracy.
Statistics
Everything Bitcoin [Kioseff Trading]Hello!
This script retrieves most of the available Bitcoin data published by Quandl; the script utilizes the new request.security_lower_tf() function.
Included statistics,
True price
Volume
Difficulty
My Wallet # Of Users
Average Block Size
api.blockchain size
Median Transaction Confirmation Time
Miners' Revenue
Hash Rate
Cost Per Transaction
Cost % of Transaction Volume
Estimated Transaction Volume USD
Total Output Volume
Number Of Transactions Per Block
# of Unique BTC Addresses
# of BTC Transactions Excluding Popular Addresses
Total Number of Transactions
Daily # of Transactions
Total Transaction Fees USD
Market Cap
Total BTC
Retrieved data can be plotted as line graphs; however, the data is initially split between two tables.
The image above shows how the requested Bitcoin data is displayed.
However, in the user inputs tab, you can modify how the data is displayed.
For instance, you can append the data displayed in the floating statistics box to the stagnant statistics box.
The image above exemplifies the instance.
You can hide any and all data via the user inputs tab.
In addition to data publishing, the script retrieves lower timeframe price/volume/indicator data, to which the values of the requested data are appended to center-right table.
The image above shows the script retrieving one-minute bar data.
Up arrows reflect an increase in the more recent value, relative to the immediately preceding value.
Down arrows reflect a decrease in the more recent value relative to the immediately preceding value.
The ascending minute column reflects the number of minutes/hours (ago) the displayed value occurred.
For instance, 15 minutes means the displayed value occurred 15 minutes prior to the current time (value).
Volume, price, and indicator data can be retrieved on lower timeframe charts ranging from 1 minute to 1440 minutes.
The image above shows retrieved 5-minute volume data.
Several built-in indicators are included, to which lower timeframe values can be retrieved.
The image above shows LTF VWAP data. Also distinguished are increases/decreases for sequential values.
The image above shows a dynamic regression channel. The channel terminates and resets each fiscal quarter. Previous channels remain on the chart.
Lastly, you can plot any of the requested data.
The new request.security_lower_tf() function is immensely advantageous - be sure to try it in your scripts!
trailing_drawdown
Description:
Drawdown was a tool to measure historical risk, derived from measuring current wealth from its previous peak, casually from portfolio construction (weights allocation), will consider to having a minimum drawdown. In this indicator, the drawdown for individual assets is utilized to measure its value or percentage from its trailing peak (default to 1-yr period).
Drawdown:
drawdown = (price/peaks)-1
Feature:
Static: display drawdown as percentage
Dynamic: display drawdown as value
Number of New Highs - Number of New Lows in US MarketShow numbers of new highs vs numbers of new lows for Nasdaq, NYSE and AMEA
Sequence Distribution Reporta basic tool to retrieve statistics of the distribution of price range sequences.
WpProbabilisticLibLibrary "WpProbabilisticLib"
Library that contains functions to calculate probabilistic based on historical candle analysis
CandleType(open, close) This function check what type of candle is, based on its close and open prices
Parameters:
open : series float (open price)
close : series float (close price)
Returns: This function return the candle type (1 for Bullish, -1 Bearish, 0 as Doji candle)
CandleTypePercentDiff(open, close, qtd_candles_before, consider_dojis) This function calculates the percentage difference between Bullish and Bearish in a candlestick range back in time and which is the type with the least occurrences
Parameters:
open : series float (open price series)
close : series float (close price series)
qtd_candles_before : simple int (Number of candles before to calculate)
consider_dojis : simple string (How to consider dojis (no consider "NO", as bearish "AS_RED", as bullish "AS_GREEN"))
Returns: tuple(float, int) (Returns the percentage difference between Bullish and Bearish candles and which type of candle has the least occurrences)
PhinkTrade Risk Manager EssentialsHello there, fellow traders!
So, happy to bring you a new, free tool: my Risk Manager Essentials .
(To use it, click on "Add to favorite indicators" below, and then look for it in your charts’ "Indicators & Strategies" dialog window, inside "Favorites" tab.)
The main objective of this indicator is to help and incentivize as many traders as possible to adopt essential risk management practices .
First and foremost, it helps you define how much you can buy or sell, at your chosen price levels, in order to keep your risk always under control (in other words: in order to limit the amount you can potentially lose with a trade if your stop loss order is hit).
This is fundamental if you want to have a lasting and successful trading career: protect your capital, always . Because without it, you know: it’s game over.
Indicator also helps you visualize where minimum ideal target / take profit level is , given your risk, using the popular 3:1 Return/Risk ratio (R/R) .
3:1 R/R ratio is popular because with it you only need to “be right” (have price reach your targets) about 33% of the time, in order to be profitable : in other words, the fewer successful trades will pay you more than the sum of your unsuccessful ones will take from you.
So, make sure your strategy has a success rate greater than 33% and apply 3:1 R/R to your trades . This indicator will help you that, and with developing the necessary discipline . For example, by knowing where the ideal target should be, given your choices, you can assess the likelihood of it being reached in current price context. If that would look like a hard to happen scenario, it would probably be a good idea to avoid taking that particular trade.
Now, let’s see how it works:
When you deploy the indicator to the chart for the first time, you’ll be asked to define:
Your 1st entry price (interactively: you can define and adjust levels directly on the chart, thanks to the new Interactive Mode introduced by TradingView (ty, TV team!))
Your stop loss price (likewise)
Your 1st target price (likewise)
Your starting capital (via initial Input dialog)
Your risk (likewise)
Your risk is how much of your starting capital you are willing to lose if your stop loss is hit (define it as a % of your starting capital).
There’s a good practice here too: to risk only 1 percent of your capital per trade . This way, you can reinforce the odds of making more money than you lose and keep your peace of mind in all trades – and avoid messing up with your plans – and statistics – along the way.
Successful trading is a statistics-based endeavor. So, you want to implement and maintain consistency. Again, this indicator helps with that.
After initial setup:
You can also define additional entries and targets (up to 3 each) . Just open indicator’s Settings window and adjust accordingly.
If you have more than one entry – or target, the amounts involved will be split evenly between them. You can also enable the display of the Average Entry and Average Target labels , to see the equivalent, should you have taken (or take) a single order for each.
You can also define (via Settings, then interactively) a particular date and time for the trade . This way, labels will be presented near that moment, instead of constantly show near the latest bar.
Finally, you can personalize some other display settings: levels precision (number of decimal places), labels positions , and labels colors .
In conclusion:
You are very welcome to check it out – and adopt it on your daily use!
Please let me know your feedbacks as well. If you find any issues, or have any suggestions, I’ll be glad to hear. You can contact me here, via TradingView, or Telegram.
Finally, check the updates section below , as new stuff may show from time to time.
Thank you very much for your attention, and enjoy!
PhinkTrade
Portfolio of open positions ENGHello, I became interested in investing and trading, and there was a huge problem where and how to manage my portfolio,
I tried websites, got a spreadsheet in microsoft excel, and eventually it became possible to manage a portfolio in TradingView.
You enter data about purchases and follow the dynamics of your shares anytime, anywhere.
Added automatic transfer to one currency if the shares are traded in different currencies
The last column is how many percentages each share occupies of the total portfolio
Thanks to the TradingView team for the unique opportunity!
Collective IndicatorKey notes are that this indicators markets the High and Low of the previous day, week month and quarter. It also marks the open of the day, week, month and quarter. These are levels that can be important areas to take trades towards and away from.
It includes additional features some may wish to use that I've included for your convenience that I don't personally use anymore. This is the 50 and 200 EMAs and high volume candle coloring. EMAs can be helpful for identifying the average markup and markdown of a a trend on any given timeframe. Be careful with mean reversion strategies alone since they tend not to have great entries and could result in high losses if used in isolation.
The "Length" and "High Volume" settings control how the coloration of candles is applied. Length is the amount of bars it will use to calculate a volume average. "High Volume" is the multiplier used to distinguish how much additional volume you want to be considered "high" volume. 1x meaning average 2x meaning double volume and etc.
High volume identification can help show distributive or accumulative characteristics around key areas.
I personally focus on the Open, Low, High close data, apply SMC concepts and Wyckoff concepts to look for trades around these key areas.
PivotThis library was designed to create three different datasets using Bill Williams fractals. The goal is to spot trends in reversal data and ultimately use these datasets to help predict future price reversals.
First, the pivot() function is used to initialize and populate three separate arrays (high pivot , low pivot , all pivots ). Since each high/low price depends on the bar_index, the bar_index, pivot direction(high/low), and high/low values are compressed into a string to maintain the data's integrity ("__"). Once each string array is populated and organized by bar_index, all three are returned inside a tuple. The return value must be deconstructed H,L,A =pivot() for each array's values to be accessed using getPivot() . This boilerplate allows for data to be accessed more efficiently in a recursive environment. getPivot() was designed to be used inside of a for or while block to populate matrices for further analyses. Again, getPivot() return values must be exposed through deconstruction. x,d,y =getPivot(). See code for more details.
pivot(int XLR) initializes and populates arrays
Parameters
XLR - number of bars to the left and right that must be lower for a high to be considered a pivotHigh, or vice versa. This number will drastically change the size and scope of the returned datasets. smaller values will produce much larger datasets, which might model short term price activity well. In contrast, larger values will produce smaller datasets which might model longer term price activity well.
Returns - tuple [string ]
getPivot(string arrayID, int index) accesses array data
Parameters
arrayID - the variable name for one of the three arrays returned by pivot().
index - the index of the provided array, with 0 being the most recent pivot point. can be set to " i " in a loop to access values recursively
Returns - tuple
ATH ATL ATX FinderHello!
This is an indicator to determine ATH, ATL and ATX:
ATH - All time high
ATL - All time low
ATX - All time X
X to ATH - how many X is possible to get when reach ATH
ATH from X - how many X is already archieved from ATL
How to use:
Select any market and see abovementioned parameters.
You may alter initial date to start from in the settings.
Enjoy!
Yearly Percentage ReturnsAn indicator that lets you visualize the historical Yearly Percentage returns of any symbol .
Key Features:
Displays the yearly returns from start to end of each year
Displays a table showing all yearly returns for current symbol
Displays start of each year as a vertical line
Displays up to 5 custom horizontal levels
Table Settings:
Enable table - Show/Hide the table
Size - Sets the size of the table
Position - Sets the position of the table on the screen
Direction - Sets the direction of the table to display the data (Vertically or Horizontally)
seasonThis script is meant to help verify the existence of a seasonal effect in asset returns, using a Z-test. There are three steps:
1. Think of a way to identify a season. The available methods are: by month, by week of the year, by day of the month, by day of the week, by hour of the day, and by minute of the hour.
2. Set the chart to the unit of your season. For example, if you want to check whether a crop commodity's harvest season has a seasonal implication, select "month". If you want to investigate the exchange's opening or close, select "hour".
3. Using the inputs, select the unit (e.g. "month", "dayofweek", "hour", etc.) and the range that identifies the season. The example natural gas chart has set "start" to 8 and "end" to 12 for September through December.
The test logic is as follows:
The "season" you select has a fixed length; for example, months eight through twelve has a length of four. This length is used to compute a sample mean, which is the mean return of all September-December periods in the chart. It is also used to calculate the mean/stdev of every other four-month period in the chart history. The latter is considered the "population." Using a Z-test, the script scores the difference between the sample returns and the population returns, and displays the results at two levels of significance (P = 0.05 and P = 0.01). The null hypothesis is "there is no difference between the seasonal periods and the population of ordinary periods". If the Z-score is sufficiently large or small, we can reject the null hypothesis and say that there is a seasonal effect at the given level of confidence. The output table will show green for a rejection of the null hypothesis (meaning there is a seasonal effect) or red of acceptance (there is no seasonal effect).
The seasonal periods that you have defined will be highlighted on the chart, so you can make sure they are correct. Additionally, the output table shows the mean, median, standard deviation, and top and bottom percentiles for both the seasonal and population samples.
Many news sites, twitter feeds, influences, etc. enjoy posting statistics about past returns, like "the stock market has gone up on this day 85 out of the past 100 years" and so on. Unfortunately, these posts don't tell you that many of these statistics are meaningless, as even totally random price fluctuations will cause many such interesting figures to occur. This script provides a limited means of testing some such seasonal effects so you can see if they are probably just random, or if they may have some meaning.
Note that Tradingview seems to use 1-based indexing for daily or higher timeframes, and 0-based indexing for intraday timeframes:
Months: 1-12
Weeks: 1-52
Days (of month): 1-31
Days (of week): 1-7
Hours (of day): 0-23
Minutes (of hour): 0-59
Front Angler Percent CJA nice little gadget.
Can be used to visually hint on volatility.
Will show a leading vertical bar which shows percentage of price, both up and down, in relation to current price.
[blackcat] L3 Financial Minesweeper: Altman Z ScoreLevel: 3
Background
The Altman Z-score is the output of a credit-strength test that gauges a publicly traded manufacturing company's likelihood of bankruptcy. The Altman Z-score is a formula for determining whether a company, notably in the manufacturing space, is headed for bankruptcy.
Function
The possibility of financial failure or bankruptcy of the enterprise is analyzed and predicted through the comprehensive score. The lower the Z value, the more likely the enterprise will go bankrupt. By calculating the Z value of an enterprise for several consecutive years, we can find out whether the enterprise has signs of financial crisis. Generally speaking, when the Z value is greater than 2.675, it indicates that the financial situation of the enterprise is good, and the possibility of bankruptcy is small; When the value is less than 1.81, it indicates that the enterprise is in a potential bankruptcy crisis; when the Z value is between 1.81 and 2.675, it is called a "gray area, indicating that the financial situation of the enterprise is extremely unstable.
Remarks
STOCKs ONLY which require financial data.
X1~X5 coefficients can be customized for different stock markets.
Compared to TradingView official Altman Z-Score Indicator.
Feedbacks are appreciated.
Correlation Coefficient Comparison (2 inputs)Same as Correlation Coefficient, but allows you to specify both inputs.
AutoFiboRetraceLibrary "AutoFiboRetrace"
TODO: add library description here
fun(x) TODO: add function description here
Parameters:
x : TODO: add parameter x description here
Returns: TODO: add what function returns
normalize_heatmap
Description:
This was a simple indicator to indicate the heatmap area of an asset price, in a relative given time period. In default the lookback period was set to 50 bars, indicating the current state of the price within the previous lookback period. The color scheme was using the rainbow palette, which set blue as the cooling-off area, and red as the heating area. The indicator doesn't take into account momentum strategy and thus doesn't consider the future direction of the asset price. Note: cooling-off area, can be considered to entry or adding position as a DCA strategy.
Data Normalize:
norm = (x - min) / (max - min)
Feature:
Heatmap color condition
Weighted Moving average (Additional)
% Price change (by OP)To visually evaluate the percentage change in price over any time period
This handsome indicator shows exact % price change at each candle by displaying a circle at the level of the change. To read numerical value, point at the circle of the relevant bar corresponding to the candle you are interested in, and look at the scale.
TotalCap Structure CandlesIdeal to see the overvaluation or undervaluation of the market observing the structural divergences.
You can also do your technical analysis on this structure, helping to understand the total market.
Let the simplicity of your strategy be your strength, successes.
trading YM based on pair tradingThis is inspired by some online free webinars. Didn't pay for the strategy/ course. I just figured it out myself. So there might be problem with this strategy.
Theory: It is based on something called cointegrated. Cointegration means the difference between 2 securities are stable in long term. When the difference is bigger / smaller than normal, then there is space to make profit. You can use some tests to check if they are cointegration. I don't think YM and NQ are strictly cointegrated. I used other platform to test the cointegration. They are not cointegrated. There are multiple ways to do pair trading. I use "Y = A - B * (A /B)" to do this. The back test on tradingview can only trade one security. This is not pair trading in this backtest. But only do long and short based on the theory of pair trading. The max drawdown is huge. You should be careful before doing anything with this strategy.
Welcome to give some advice on improvement.
VarianceVariance is a measure of dispersion, simply put, it is measuring how distant data is from it's mean(average). This indicator allows you to see when variance is increasing or decreasing, as well as when it is at an extreme value. Thru this, you can get a more accurate description of risk. When variance is increasing/high, you know to expect larger moves, as data(price) is far and getting farther from the mean. and when it is low/decreasing, you know that price movement is more likely to be less volatile due to data clustering closer to the mean, ie ; smaller values.
Variance is not a signal generating indicator in and of itself, but is more a tool to help tell you WHEN to trade. Use in conjunction with signal generating indicators such as Z-score to find entries.
For example, trading z score extremes when variance is increasing.
Variance works well alongside measurements of historical volatility to get a more accurate measurement of market risk/ volatility .