Percentage Up/Down vs lowest/highestPercentage difference at current price (close) to lowest and highest certain number of bars ago (14, 36, 96).
Statistics
Quantity Theory of Money (Inflation Growth Rate)Quantity Theory of Money ( Inflation Growth Rate)
Equation:
%ΔM+%ΔV=%ΔP+%ΔY
M - Money Supply , V - Money Velocity , Y - Real GDP, P - Price
This script only takes into account money supply theory and does not account for increases/decreases in inflation due to energy costs. QTM Calculation is compared to USIRYY , USCCPI , and Sticky Price CPI . Flex_CPI and Flex_Core_CPI are not available in Trading View for comparison.
Simple Moving Average Default it set to 3 quarters for smoothing purposes. You can change this via the input window as you see fit.
FLEX KDJ INDHi Dears!
Here you have this ability to define different methods to aquire high and low bonds in KDJ indicator.
Thses Topologies are available in Popup menu and could be defined by user:
- "AVG" : Use average of cashed data in both High and low Bond
- "MEDIAN" : Use median of cashed data in both High and low Bond
- "MAX" : Use Max of cashed data in both High and low Bond
- "MIN" : Use Min of cashed data in both High and low Bond
- "WIDE" : Use Max of cashed data in High and Min of them for low Bond
- "NARROW" : Use Min of cashed data in High and Max of them for low Bond
- "FIX" : Use predefined constant values by user in 'Max BOND' and 'Min BOND'
- "GAUSS" Use statistical standard deviation method and 'Mult. Max BOND' and 'Mult. Min BOND' to calculate High and low Bond.
In "LEFT RANGE" and "RIGHT RANGE" you can define the range which be used to find pivot and extremum points in calculation of highest and lowest LONG-TERM KDJ Line.
'MEMORY' is the size of cash that you want to collect the extracted data from extreimum points for highest and lowest LONG-TERM-KDJ. If overflowing from this point the oldest value would be kicked from cash.
Other parts are same in KDJ Indicators.
Enjoy trading!
Shakib.
Market Sessions(4sessions)Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM))) Special for CLUB SM)))
Historical US Bond Yield CurvePreface: I'm just the bartender serving today's freshly blended concoction; I'd like to send a massive THANK YOU to all the coders and PineWizards for the locally-sourced ingredients. I am simply a code editor, not a code author. Many thanks to these original authors!
Source 1 (Aug 8, 2019):
Source 2 (Aug 11, 2019):
About the Indicator: The term yield curve refers to the yields of U.S. treasury bills, notes, and bonds in order from shortest to longest maturity date. The yield curve describes the shapes of the term structures of interest rates and their respective terms to maturity in years. The slope of the yield curve tells us how the bond market expects short-term interest rates to move in the future based on bond traders' expectations about economic activity and inflation. The best use of the yield curve is to get a sense of the economy's direction rather than to try to make an exact prediction. This indicator plots the U.S. yield curve as maturity (x-axis/time) vs yield (y-axis/price) in addition to historical yield curves and advanced data tickers . The visual array of historical yield curves helps investors visualize shifts in the yield curve that are useful when identifying & forecasting economic conditions. The bond market can help predict the direction of the economy which can be useful in crafting your investment strategy. An inverted 10y/2y yield curve for durations longer than 5 consecutive trading days signals an almost certain recession on the horizon. An inversion happens when short-term bonds pay better than longer-term bonds. There is Federal Reserve Board data that suggests the 10y3m may be a better predictor of recessions.
Features: Advanced dual data ticker that performs curve & important spread analysis, plus additional hover info. Advanced yield curve data labels with additional hover info. Customizable historical curves and color theme.
‼ IMPORTANT: Hover over labels/tables for advanced information. Chart asset and timeframe may affect the yield curve results; I have found consistently accurate results using BINANCE:BTCUSDT on 1d timeframe. Historical curve lookbacks will have an effect on whether the curve analysis says the curve is bull/bear steepening/flattening, so please use appropriate lookbacks.
⚠ DISCLAIMER: Not financial advice. Not a trading system. DYOR. I am not affiliated with the original authors, TradingView, Binance, or the Federal Reserve Board.
About the Editor: I am a former FINRA Registered Representative, inventor/patent holder, futures trader, and hobby PineScripter.
Month/Month Percentage % Change, Historical; Seasonal TendencyTable of monthly % changes in Average Price over the last 10 years (or the 10 yrs prior to input year).
Useful for gauging seasonal tendencies of an asset; backtesting monthly volatility and bullish/bearish tendency.
~~User Inputs~~
Choose measure of average: sma(close), sma(ohlc4), vwap(close), vwma(close).
Show last 10yrs, with 10yr average % change, or to just show single year.
Chose input year; with the indicator auto calculating the prior 10 years.
Choose color for labels and size for labels; choose +Ve value color and -Ve value color.
Set 'Daily bars in month': 21 for Forex/Commodities/Indices; 30 for Crypto.
Set precision: decimal places
~~notes~~
-designed for use on Daily timeframe (tradingview is buggy on monthly timeframe calculations, and less precise on weekly timeframe calculations).
-where Current month of year has not occurred yet, will print 9yr average.
-calculates the average change of displayed month compared to the previous month: i.e. Jan22 value represents whole of Jan22 compared to whole of Dec21.
-table displays on the chart over the input year; so for ES, with 2010 selected; shows values from 2001-2010, displaying across 2010-2011 on the chart.
-plots on seperate right hand side scale, so can be shrunk and dragged vertically.
-thanks to @gabx11 for the suggestion which inspired me to write this
.srb suite vol & infoThe volume indicator
what can replace the built-in volume indicator and It also has some useful features.
and designed to work as overlay in the same pane with open-source indicator by default.
Regular volume Indicator
Volume SMA plot
Large Volume ! emphasize by color & mark.
Ultra Volume ! overlay marking ; x2 x4 x6 lager than regular average volume. it will help you can take the reversal
BTC-agg. Volume
4 BTC-spot & 4 BTC-PERP volume aggregated.
It might helps you don't miss out on important volume flows.
Weighted to spot trading volume when using PERP+spot volume.
If enabled, BTC-agg.Vol automatically applied when selecting BTC-pair.
Information panel (optimized for crypto-currency)
BTC-PERP price & delta (when Binance:BTCUSDT selected)
BTC dominance, Binance:BTCUSDTPERP OI
Symbol, Price, Daily up/down
ATR14 (for checking current volatility)
Recommended setup for .srb suite
tradingview | chart setting > Appearance > Top margin 0%, Bottom margin 0% for optimized screen usage
tradingview | chart setting > Appearance > Right margin 57
.srb suite vol & info --> Visual Order > Bring to Front
.srb suite vol & info --> Pin to scale > No scale (Full-screen)
CryptoCurrency Short X-RayIndicator to show the data on short sellers for cryptocurrencies. Color coded as the following:
Orange=Shortsellers are Shorting
Blue =Shortsellers are Covering
Red =Others are Selling
Green =Others are Buying
Includes lines to show the range that shortsellers have recently (within the last 1024 bars) been operating in to give indication on how extended they are, along with 25%, 50%, and 75% levels inbetween. Do not rely exclusively on this indicator as this can change wildly depending on the situation at hand, and be sure to select the short data in the settings that matches the ticker you're trading.
Beta CalculatorBeta is a measure of an asset's volatility relative to the market (the S&P500 is the most widely used index for this). A beta of 1 indicates that the asset moves exactly like the market, a beta < 1 indicates that the asset is less volatile than the market, and a beta > 1 means that the asset amplifies market movements.
This tool is used to calculate easily the Beta coefficient of an asset using 4 parameters :
- Symbol : The Asset's Ticker
- Reference : The Market Index Ticker
- Lookback Candles : The number of candles to include in the calculation
- (Implict) Resolution : The timeframe you are using, defines the precision
Chart gain/lossis not my code actually its a example in
Pine Script™ and charts become better acquainted
becaus is can useful and it unpublished i just publish that without any channges
As a trader scrolls or zooms on their chart – causing the range of visible bars on the chart to change – scripts using either of these new built-ins will automatically re-execute so that calculations and visuals can adapt to the new context. This opens the door to a whole new variety of scripts that dynamically adjust to changes in the range of visible bars.
This indicator draws an arrow from the open of the first visible bar to the close of the last, and shows the gain/loss for that range
Overloaded Volume-Canddle v1This indicator will detect the candle has volume "too strong" base on "n" previous candle.
The Yellow Line is avg volume base n candle previous.
The Red line show over power volume of canlde.
Important : This indicator can use for forex, but i recommend it for binary options only.
Greater Currency Correlation Matrix (Forex)Other available matrixes I found have a limited number of forex symbols. Consequentially, you need to keep switching them if you want to do a proper analysis. As a result of that, I produced my own currency matrix.
Correlation studies relationships between different price charts.
High correlation may be completely random in the short term, but it may signify a fundamental relationship between the two symbols if calculated over the long term.
For example, the currency of an oil-producing country may rally along with oil, whereas the importer's currency may drop. This means that watching the oil price chart may be worth it for such pairs.
The script includes all Major and Minor pairs with the addition of Gold (XAUEUR) and two optional symbols.
▬▬▬▬
To avoid too frequent use of security(), I decided to calculate all symbol values from EUR pairs. It should improve performance and keep room for some additional symbols in the future.
Please report any bugs.
BTC - Novel RPPI IndicatorHey Everyone,
This is a collab effort between me (a statistician) and @Stein3d (A coder). So if you like this indicator, be sure to also give him the credit!
This a novel indicator theorized by me and applied by Stein3d. We are calling it the RPPI indicator, standing for Regression based Price Prediction Indicator.
This is specifically coded for BTC and cannot be used for alt coins or ETH.
This is pretty beta so your feedback and comments are encouraged!
I will keep it brief, but here is the run down:
What does it do:
The indicator does 3 main things:
1. Predicts bullish targets;
2. Predicts bearish targets;
3. Predicts close price
Who is it applicable for:
This is generally targeted to day trades, but it can have swing trade applications as well. Feel free to get creative with combining it with other indicators that you feel complement it well.
How does it work:
It uses statistical based regressive analysis of BTC to compare current price action to previous price action and determine where the natural high and lows will fall intra-day based on the current price action of the day.
How to use it:
This does not omit the need for technical analysis and chart interpretation; however, it sets realistic expectations of intra-day bullish and bearish price targets as well as its best guess of where the current day close is most likely to fall. Take a look at some of the images below:
The image is pretty self explanatory but you see that there are 2 bull and bear targets. The bull targets, of course, are listed in Green and the bear targets are listed in Red.
There is a dummy neutral support and resistance target which is listed in yellow and the close price is in the purple dotted line.
Of course these are all customizable.
I think that pretty much covers it in a nut shell but let us know if you have any other questions and also please provide feedback!
Thanks for checking it out!
Bar Count for BacktestingHello!
Not much special about this script; you can use date & time, or bar count, to ascertain the number of bars in a time period for backtesting.
This script can be used in conjunction with large scripts incorporating complex intricacies that won't load on 20,000+ bar data sets.
If your script's load time transcends the TV allotted load time - use this script to quickly determine the number of bars in the data set.
Through trial & error you should be able to determine the approximate number of bars your script can execute on without exceeding the imposed time limit!
The image above shows a user-defined time window and, consequently, the script returns the number of bars that constitute the time period.
You can drag the white vertical lines to efficiently configure the calculated time period.
The image above shows functionality for the "Bars Back" feature.
Enjoy!
Binance Futures Swap-Spot Basis LabelNote: This script will only work with Binance Futures Symbols
This script calculates the basis between the Binance Future and Binance Spot market for the coin you are currently viewing and paints a label on the chart which displays the percentage difference between future and spot. If the future is trading below the spot market the text will be red indicating backwardation and if the future is trading above spot, it will be green indicating contango. Please note this script will only work on Binance perps against Binance spot. The script will change based on what perp you are looking at, no inputs are required.
Candle ImbalanceIndicator that shows the imbalance between bearish and bullish candles for a given period.
Average, Median, Mode, Biggest: Pip Range Measures & LabelsApply various simple statistical measures to series of full candle ranges over user input length (in bars).
Choose between AVERAGE, MEDIAN, MODE, BIGGEST.
All calculations derive from the high-low range of a candle.
Default length = 260, the number of daily candles in a year.
MODE is calculated from pip ranges rounded to reasonable increments (to nearest 10pips foreign currencies; to nearest 100 pips for DXY ; nearest $10 for other assets). Best only use MODE for the major FX pairs encoded, and on Daily timeframe .
User input 'unit multiplier' only applies when asset is NOT a major Forex pair (unit and multiplier is auto applied for for major FX pairs).
© twingall
Future PreviewFuture Preview
Calculate real-time future order profit with open price, leverage and commission fee. Simple and straight forward. If you need any additional feature, please leave a comment below. I am glad to help.
Usage:
When adding Future Preview to chart, it will ask order open time and open price on the chart by clicking with left mouse on the desired value. These value can be changed lately, as well as the leverage and commission fee. Default leverage is 10 and default commission fee is 0.06% (taker).
There will be two horizontal lines. The solid longer line is the open price line, it shows the order open price. The shorter line moving with real-time price is the current price line, it shows the current price. There will be preview data shows on top or below the price line. Open price line is red for short order and green for long order. The current price line is red when the order is losing and it is green when it profiting. The back ground color follows the color of current price line. Background color transparency and gain/loss color can be changed in options.
There will be one horizontal line on the left if the option of showing open time is on (default is on). It shows the time stamp when current order opened.
After adding Future Preview to chart, there is option to add Taking Profit(TP) or Stop Loss(SL) to the chart.
Font size can be changed in option
Weighted Harrell-Davis Quantile Estimator with AD Oscillatorxel_arjona
Licensing:
This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International Copyright (c) 2021 ( CC BY-NC-SA 4.0)
Copyright's & Mentions:
The Gamma Functions & Beta Probability Density Functions C# implementations by the Math.NET Numerics, part of the Math.NET Project.
The Regularized Incomplete (Left) Beta Function C# implementation by the SAMTools, htslib project.
The Weighted Harrell-Davis Quantile estimator; C# & R implementations by Andrey Akinshin.
External PineScript code, methods, support & consultancy by @PineCoders staff with special mention for:
+ "ma sorter ('sort by array' example)- JD" by @Duyck.
+ Porting, mods, compilation and debugging for this script by @XeL_Arjona for the TradingView's @PineCoders community.
I made it an oscillator. Features include normalization, line display, and smoothing. :DDD Enjoy!
(Ive been wanting to do this for a while but I wanted to make the library first but you know what this was fun so there you go its here now)
Gap Size Outcome Statistics [vnhilton]This indicator displays a table with statistics showing the outcomes of gap ups or downs based on your threshold (i.e. does the day end in green or red?). This can be useful for trading, where you're using relevant ETFs & see that they've gapped up/down, & can assume based on statistics that the ETF will end in green/red depending on which has the higher probability (however, you can use these on any other instruments such as stocks to find edges e.g. seeing whether stock XYZ is more likely to end in green/red when it gaps up 100%).
The table also includes sample sizes for your threshold tests for more confidence in the statistics, & also displays average gap up & downs & their respective sample sizes as well. This indicator is intended to be used on the daily timeframe, but can be used on lower or higher timeframes if you prefer.
In the chart snapshot image above, we can see that when the SPY gaps up > 1%, the day is more likely to end in green than in red. But when the SPY gaps down < -1%, it's also more likely to end in green than in red.
( IMPORTANT NOTE : There's 1 limitation with this indicator & it's that it assumes that days where close=open are green days, & that 0% gaps exact are considered gap ups.)
% Per BarThis script compute the average price swing per bar (between High and low)
It does not include gaps between bars in the calcul
4 main Stablecoin MarketCapThis indicator summarized 4 main stablecoin marketcap (USDT, USDC , BUSD, DAI).
It is given that most of the transactions of cryptocurrencies are traded by stablecoins, and USDT, USDC , BUSD and DAI shared 90%+ of the stablecoins market capacity. Therefore, by summarizing these 4 main stablecoins total market capacity, can reflect the overall demand power.
When the indicator goes up, it is expected that the overall market demand will increase.
When the indicator goes down, it is expected that the cryptocurrencies market might be in a recession.
This indicator could be more useful in a longer timeframe, day-trade or even shorter might not be the suitable timeframe.
-----------------------------------------
V2 update
Separate 4 sectors and shadowed in different colors for 4 different stablecoins for more accurated view.
XBT Average Electricity CostXBT Average Electricity Cost
Cambridge Bitcoin Electricity Consumption Index (CBECI) - Bitcoin's global electricity consumption in TwH.
Note: 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.
Source