Bollinger Bands SignalsDescription:
This indicator works well in trendy markets on long runs and in mean-reverting markets, at almost any timeframe.
That said, higher timeframes are much preferred for their intrinsic ability to cut out noise. The example chart is in 3H TF.
Be mindful, the script shows somewhat erratic jigsaw-like behaviour during consolidation periods when the price
jumps up and down in indecision which way to go. Fortunately, there are scripts out there that detect such periods.
You can choose between 4 Moving Averages, Vidya being the default. Period, Deviation and Bands Width parameters
all of them affect the signal generation.
For the Pine Script coder this script is pretty obvious.
It uses a standard technical analysis indicator - Bollinger Bands - and appends it with a 'width' parameter and
a signal generation procedure.
The signal generation procedure is the heart of this script that keeps the script pumping signals.
The BB width is used as a filter.
You can use this procedure in your own scripts and it will continue generate signals according to your rules.
Educational
change in rsiThis indicator will show how fast the rsi of a symbol is changing. you can see this as a differentiation function on rsi .
this will show the change in rsi in percentage.
Ex: suppose the rsi of a symbol at present is 60 and the previous value of rsi was 52,
as you can see the rsi has increased, which is a sign of the symbol being bullish .
this indicator will tell by what percentage the rsi of the symbol has increased or decreased.
for the above example, the change in rsi is 15.38% increase.
this is set to default chart time-frame.
InsideBar2.0Inside Bar: Inside Bar is defined as, " when candle body range falls within previous day candle body".
Some of us take the whole prices range . Here i have taken only the price range of the body of tehecandle.
I have created an indicator to identify Inside bras and draw target levels on both the sides. Traders can easily convert it into a strategy and checkout the success rate.
This script is written to identify InsideBar and then plot target 1 and target 2 irrespective the direction of following candles.
Inside Bar is here defined clearly when the whole body( Not high/Low, but Open and Close Only of the candle falls within the whole body of previous candle
Few static Variables are declared for one time use to store the following values
MotherCandle Index
High and Low of MotherCandle
Target 1 equal to size of the body of mother candle
Target 2 equal twice the size of Mother Candle
Depending upon the direction of the trend and breakout of the MotherCandle boundaries, target lines and labels are drawn.
Line.delete function is used to delete all the previous lines to keep the chart clean and not draw line on all every inside-bar detected in the past.
Label.delete function is used to delete all the previous labels for Target levels to clearly show current target levels.
barcolor() function is used to change the inside bar candle changed to "Yellow" .
Trend crossierHello there!
I would like to share my script.
This is S/R levels indicator based on custom range for each step used for computing minimum/maximum of the range.
For example - we predefined step with 50 candles as one, after we have got the minimum and maximum of it - we come to the next 50 candles and do the same to it.
Finaly - we have got 20 lines for 10 steps.
After that - we set the ( SMA * mult) to have step between lines and if N of lines in range of step from eachother(if a+step > b and b+step > c ...) we call it a strong level.
It is not my idea(but my code), so I do not claim the uniqueness of this idea (the customer asked me to code it, but I also read about this method in open sources before).
The second thing - vectors of current trend direction on different timeframes.
For this task I took the same ranges, but ema () of each range. After first step it has an array with N values.
The next thing it does is take out "chain" one by one on each iteration. How does it do that? We take new AVG with neighbor values.
If we have 10 length at start - after iteration it becomes 9. So it repeats computing till length is 2.
After we have 2 points left - we can plot the line using indexes.
This way we can see the trend direction on different timeframes.
Feel free to use, change, put into another scripts. You can even never use it!
The right to publish this particular code was issued by the customer.
Have fun!
Bursa Malaysia Index SeriesERVIEW
This indicator is intend to display Bursa Malaysia Index Series.
█ FEATURES
1. Choose available sector based on Bursa Malaysia Index.
2. Plot close or OHLC.
3. Color of Closing price plot adapt to chart background color.
4. Font size can be selected.
█ EXAMPLES / USAGES
Profit MonitorProfit monitor refers to a tool or system used to track and analyze a company's financial performance, specifically its profitability. This can be in the form of software, spreadsheet, or dashboard that displays key metrics such as revenue, expenses, and net profit over time. The goal of a profit monitor is to give stakeholders, such as business owners, investors, or managers, a clear and up-to-date view of the company's financial health, enabling them to make informed decisions and identify areas for improvement.
Financials - Comparing CompaniesHello All
For a while I have been working on this indicator to compare financials of the companies and sort them accordingly. Finally I completed and published it. I preferred using new object type feature in Pine language™ and I hope it might be an example and helpful for the developers.
First of all, as we have limitation on security calls, the indicator can get and compare financials for 5 companies only. also Chart time frame must be 1Day or higher! ( I recommend 1Day time frame ). if not then the indicator stops and shows the error message: "Please set the time frame 1Day or higher" . More important than others: You should choose the companies from the same sector! Compare apples to apples :)
The Financials in the indicator:
Earnings Per Share
Price to Earnings Ratio
Price to Sales Ratio
Price to Book Ratio
Profit Margin
Dept to Equity
Current Ratio
Market Capitalization
Also more information shown for each stocks:
Closing Price, sets the color accordingly
2 Simple/Exponential moving average, you can set the length, also it checks if it is rising/falling and sets the color accordingly
Volume info
Average volume (20 days), you can set the period
Currency for each security
Lets see some features in it:
it sorts the companies according to the financials:
If you move the mouse onto any header then it shows explanation about the financial:
You can change location and text size:
You can set the type of Moving averages as SMA or EMA and you can also set the length for both . Headers for both are changed automatically by MA type and length
Colors for Closing price and MA cells are set automatically:
For new Objects in Pine language click here
P.S. You can use this indicator while analyzing the financials of the companies in same sector/industry. So please don't ask for the alerts :)
Enjoy!
Global LiquidityPlots the sum of the balance sheets of the world's major central banks - FED, ECB, BoE, PBoC, BOJ, India and Switzerland - in a currency of your choice. Defaults to USD.
Also shows FED net liquidity (balance sheet - tga - rrp) for comparison. Uses a configurable multiplier to make the two lines viewable on the same price scale.
HTF Bar Close CountdownThis simple indicator displays a countdown for the amount of time left until a bar of your chosen timeframe closes.
Displays up to 5 different HTF countdowns.
Fully Customizable to fit any style, change the text colors, background colors, frame colors, display size and border & frame widths.
Flat display option for a sleek look to mesh with your charts.
Notes/Tips:
Higher Time Frames only! This is only intended to view HTF countdowns, will not work when trying to use a timeframe lower than your current chart's.
Some weird timeframes do not work, you'll know when.
Only works on live charts! Will display "Closed" when on an inactive chart.
Does not work for replay! A countdown is pretty pointless on a replay that is not real-time anyways...
Enjoy!
Price Swing Detection - Smart Money ConceptSince my own style is Smart Money Concept and these days I have seen a lot of my friends who are having trouble identifying structures for their indicators and strategies. I wrote this code so they could use it in their strategy . In fact, this type of structure, as one of the strongest technical structures, can increase the success of your strategy according to your personalization.
The script detects swings (i.e. significant highs and lows) in a financial instrument's price action over a specified period. The user can set the lookback period (number of candles to consider) and the colors of the lines representing bullish and bearish trends.
The script has two functions: detectSwing and pivot high. The detectSwing function calculates the swing highs and lows for the specified number of candles. The function uses the ta.highest and ta.lowest functions to find the highest and lowest prices, respectively, over the lookback period. The function also determines the swing state (high or low) of the current candle and returns the calculated swing values.
The pivot high function calculates the pivot high, which is an important step in detecting bullish structures in the market. If a new top (i.e. swing high) is found, the script updates the pivot high values and creates a line from the recent top to the last bar. The script also updates the trailing maximum values, which are used to extend the top extension line.
For Strategy :
The variable "trendDirection" in the code is used to keep track of the trend state, either bullish (up trend) or bearish (down trend), in the market. The variable is initialized to 0 which represents a downtrend. The value of this variable is updated later in the code based on the calculations of swing highs and lows, pivot crosses, and the trailing maximum. If a bullish structure is detected, the value of "trendDirection" is set to 1, indicating an uptrend.
OHLC [TFO]Keep higher timeframe OHLC in mind by watching the candle form on LTF charts. Inspired by ICT concepts, specifically concerning the daily OHLC.
Card DealerThis is a simple educational indicator that draws a pseudo-random new card from the deck every time the bar changes. This indicator is not intended to be used for making trading decisions; it's just for fun. The coding concept is a fork/iteration of the Inspirational Watermark indicator which can be found here
!! DISCLAIMER: The PineScript(v5) function math.random() returns a pseudo-random value. More information here: www.tradingview.com
Sup/Res Levels [QuantVue]Shows basic pivot point of support and resistance levels. Will show alerts for break of sup. or res. Allows for a volume filter for sup. res. breaks as well.
"B" means break of either a Sup. or Res. level with volume greater than the threshold.
"Bull/Bear Wick" means bullish/bearish candle on break.
Left - number of bars left hand side of the pivot .
Right - number of bars right hand side of the pivot .
Volume Thres. - the threshold value (%) for the Volume.
This indicator is useful to filter our insignificant breaks of sup. or res. Can help trader determine when to sit on their hands, or enter a trade.
Peer Performance - NIFTY36STOCKSI have created a peer performance dashboard for:
36 stocks from:
5 sectors of Nifty 100
This kind of dashboard is very useful for traders when they are planing to trade in a stocks and like to see how that is stocks is performing against other stocks in the same sector . Picking outperforming stocks will always give outstanding results when market starts moving. os having view on teh complete sector will always be good for traders before picking a specific stock.
Sectors covered in this indicators are:
Indian Auto Sector
Banking Sector
Oil, Gas and Energy Stocks
Cement Sector
Technology Sector
It will help traders reviewing performance ( stock return in last 1 year) of group of stocks from a particular sector .
Basically 5 functions are used to plot this dashboard
using "if " function to shortlist the stocks and the sector it belongs to.
tablo function to plot a table with specific parameters like number of row and columns, color of the frame of table
Getting yearly return into a series of variables using "request.security" function
str.tostring function is used to convert yearly return into a series of text so that it can inserted into the table cell.
finally plotting all the text and yearly return values using table.cell function
Position Sizer for UltraCap Trading Accreditation PlansWhen you enter a typical trading challenge, you are told that your accreditation assessment demo account is funded up to a certain amount. You are then told that you can only lose a small percentage of that account before you fail the accreditation/challenge. For example, if you are given a $100,000 dollar challenge demo account and are told that you can only lose up to 8% of that account ($8,000), then in reality, you really only have $8,000 to "trade" with before the game is over. That suggests that we need a risk management system that is initially based on the "true" amount of capital that we actually have to work with at the beginning of the assessment rather than an imaginary demo balance the prop firm gives us. Traditional forex risk management principles mandate that you never risk more than 2% of your trading capital on any one trade, the idea being that as long as your win rate is above some abysmally low level, it will take you a (hopefully) long time to run out of trading capital. That’s why the rules for passing an accreditation at the prop firm Ultra Cap mandate that you never risk more than 2% of your balance, or you will fail the assessment. With that in mind, I created this indicator/tool mostly for UltraCap accreditation candidates. In addition to using it to pass a prop firm assessment, you can also use it to increase your chances of surviving in an undercapitalized trading situation with your own money. For example, you could trade an actual $8,000 dollars (money that you really have) as if it were $100,000 (which is basically what any prop firm is asking you to do when they "give" you "$100,000" to trade with but only allow you lose a maximum of $8000). In that particular situation, the algorithm in this pricing model will base your initial risk exposure on an assumed account balance of $8000, and as you increase your balance, it proportionally increases risk exposure in the background until you reach a profit level of 6%, which just so happens to be the profit goal at Ultra Cap that gets you funded! This indicator uses a simple linear equation to progressively increase the risk exposure in the background based on your current stated account balance. Initially, your trade size will seem ridiculously small, but if your win rate holds up, the trade sizes will increase substantially as you get closer to the finish line.
[CLX] Progressbar - LogoThis script is part of the Library Progressbar - Showcase. You can find it under:
Momentum Deviation Bands [Loxx]Momentum Deviation Bands uses a variation of standard deviation. Instead of using price to calculate standard deviation, this uses momentum. This is another type of volatility that will be used in future indicators. This indicator serves more as an educational tool, but can also be used in trading.
You can read about the included moving averages here:
Included
Bar coloring
Profitable Supertrend v0.1 - AlphaThis a script to try detect the best combination of supertrend parameters in a space of time. Sadly the script is slow. Evaluate all possibilities params is hard for a pinescript and my knowledge too. In some cases, when you want evaluate many time could be the script fails for timeout. Perhaps with time I could enhance. For this problem of speed the calculate of combinatios it's not complete: In factor use a increment of 0.2 in each param (0.1, 0.3, 0.5 ...) in period the increment for each value is 3. The range for factor it's from 3.0 to 12.0. The range of period it's from 10 to 43
My knowledge don't let me go more far. Perhaps with time I can enhance the script.
Global Money Supply USD-AdjustedGlobal Money Supply Aggregates
- US, China, EU, Japan, UK
- Korea, India, Canada, HK, Australia
- Taiwan, Brazil, Swiss, Russia, Mexico
- Thailand, Indonesia, Saudi, Singapore, Vietnam
Unfortunately, TV Pine can only take in 40 tickers, Each country has Money Supply Data adjusted against its FX to USD.
The formula in TV only can contain 10 tickers. So would recommend doing it up yourself on the first big 5 countries,
Anyway US and China constitute close to 50% of the global money supply.
However, one can argue whether money supply data (broad money) is valid nowadays. But I would bring up that this is just for comparison and trend purposes. Yes, M3 was removed from the US Fed data releases in end-2005.
Aggregating all of the above tickers yield me around 120tn of money supply, USD-adjusted.
There's pretty much other countries that should be included but due to the lack of data and small size of the country, it is omitted.
Examples:
- Heavily Sanctioned: Iran (400-500bn) and Iraq (200-300bn)
- No Data/Bad Data: Algeria (100bn), Bangladesh (110bn)
- Fallen Angels: Venezuela (100bn?), Argentina (120bn)
- 400-500bn club: Israel, Turkey, Poland, Sweden, Ireland, UAE, Msia, Chile
- 200-300bn club: Norway, Czech, Philippines, S.Africa, New Zealand, Egypt, Denmark, Qatar
- 100bn club: Colombia, Lebanon, Pakistan, Morocco, Romania, Hungary, Nigeria, Kuwait
- GDP 1bn club: Peru, Kazakhstan, Angola, Sudan, Ukraine, Ecuador
All these could add up to 10-15tn money supply, but with currencies with bad adoption on some. End of the day, we still living in a dollarised world, with the big 5 nations taking up to 80% of the officially published money supply. The unfortunate issue is that the money supply data isn't that forward-looking. A simple linear extrapolation of historical 3-month rolling average for next month estimates can be decent, with possibility of manual meddling to add adjustments on huge macro-events eg QE infinity.
Perhaps, additional tweaking would be inflation-adjusting this. Against SPX, some housing index, crude oil, gold.
howmuch.net
ValueBands for Acceptable P/E/ and P/B# What's this script?
Plot BookValue/share and TangibleBookValue/share
Visualization of Price Bands for Acceptable P/E and P/B
Adaptation to Currency Change
When TTM(FQ) financial data is not available, FY financial data is used to supplement the TTM(FQ) data.
#Parameter
P/E : acceptable price ratio of Earnings per share. Default is 15
P/B : acceptable price ratio of Book value per share. Default is 1.5
P/TB : acceptable price ratio of Tangible Book value per share. Default is 1.5
#Line
## Books
BookValue : book value per share
TangibleBookValue :tangible book value per share
## Acceptable Prices
Acceptable P/E : P/E * EPS
Acceptable P/B : P/B * BVPS
Acceptable P/TB : P/TB * TBVPS
## Geometric mean
GeometricMean(APE&APB) : sqrt(APE*APB). Geometric mean of "Acceptable P/E" and "Acceptable P/B". if PE15 & PB1.5 then GrahamNumber .
GeometricMean(APE&APTB) : sqrt(APE*APTB). Geometric mean of "Acceptable P/E" and "Acceptable P/TB".
## color fill
BV -TBV .Fill color is TBV line
APE -APB .Fill color is the color of the larger APE and APB lines
I am not a programmer, so I can only provide crude functionality, but I hope it will be of some help to you
---------------------
◆これなに
指定したPEやPBの価格帯がチャートにのります
通貨変更に対応したスクリプトがなかったからつくりました
期のデータが無いところは年のデータをミックスして補完して、長短期どちらの検討でも使いやすくしました
プログラマーじゃないから必要なものだけですけど、よかったらつかってみてくださいね
1. 一株当たり純資産の線
2. 一株当たり有形固定資産の線
3. 1と2の間を2の線の色で塗りつぶし
4. 設定画面で指定した許容P/E相当の価格線。デフォルトは15
5. 設定画面で指定した許容P/B相当の価格線。デフォルトは1.5
6. 4と5のあいだを塗りつぶし。大きい値の方の線の色で塗りつぶされます
7. 設定画面で指定した許容P/TB相当の価格線。デフォルトは1.5
8. 4と5の相乗平均。もしPE15,PB1.5にしてたらGrahamNumber 。
9. 4と6の相乗平均
Reinforced RSI - The Quant Science This strategy was designed and written with the goal of showing and motivating the community how to integrate our 'Probabilities' module with their own script.
We have recreated one of the simplest strategies used by many traders. The strategy only trades long and uses the overbought and oversold levels on the RSI indicator.
We added stop losses and take profits to offer more dynamism to the strategy. Then the 'Probabilities' module was integrated to create a probabilistic reinforcement on each trade.
Specifically, each trade is executed, only if the past probabilities of making a profitable trade is greater than or equal to 51%. This greatly increased the performance of the strategy by avoiding possible bad trades.
The backtesting was calculated on the NASDAQ:TSLA , on 15 minutes timeframe.
The strategy works on Tesla using the following parameters:
1. Lenght: 13
2. Oversold: 40
3. Overbought: 70
4. Lookback: 50
5. Take profit: 3%
6. Stop loss: 3%
Time period: January 2021 to date.
Our Probabilities Module, used in the strategy example:
High/Low VolumeIn this indicator, I show you a better way to define high/low values of volume (or any other indicator).
Quite often, I get requests from my clients that an indicator level should be “high” or that it should be above a certain absolute level.
The first request is hard to interpret mathematically, but traders can easily spot it on the chart. The second one is not flexible, and it might not make sense in another market regime.
To solve that, you can compute dynamic high/low levels that represent unexpected extreme values that are adaptable to recent conditions.
There are two pretty simple methods I’m using quite often in my scripts percentiles and sigma (standard deviations).
Percentile looks back at X bars and computes the value under which a certain % of data points are located. So, for example, if we’re computing 90%tile and we’re looking at 100 bars, we’ll get a value under which we have values of precisely 90 bars for this indicator. It’s a good idea to use something like 5%tile for low level and 95%tile for high level.
Sigma(σ) is related to standard deviation. If we assume that our data is normally distributed, then 68% of data points should be in the range of mean +-1σ, 95% → mean +-2σ. So we can assume that something above 2σ is a pretty rare and extreme event.
In this script, I give you an example of how to compute both on volume, but you can easily change this to another indicator.
The issue with volume is that it’s not normally distributed, and your low level will be quite often too low to detect any low levels. Ideally, we have to use a more sophisticated formula that fits volume distribution better.
In this indicator, you can set the following parameters:
Choose type: Percentile or Sigma
Lookback Period
High/Low Percentiles
Sigmas #
You can also receive alerts for high/low volume events.
Disclaimer
Please remember that past performance may not indicate future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting.
This post and the script don’t provide any financial advice.