Bank Nifty VolumeWhy this Script : Nifty 50 does not provide volume and some time it is really useful to understand the volume .
This is the pine script which calculate the nifty 50 volume .
Logic :
Take each stock contribute to nifty 50 and find it's volume .
Multiply the same with contribution percentage of the same on Nifty 50
Add up all of them and find the total volume .
I took the open source code from @daytraderph script called, Custom Volume
I will make sure I will update the contribution percentage of all stocks my self instead o you update using input methods. This is the difference. Some people don't know where to look at this to update the value, so for them this script might be useful. And this is the only difference comparing to Custom Volume script.
Custom
LWMA: Linear Weighted Moving AverageCouldn't find searching for Linearly Weighted Moving Average (LWMA) in tradingview. Found one with the LWMA title, but it uses plain WMA calculation without the linearity which more heavily weights recent price data, which I need, so I try to made one.
LWMAs are also quicker to react to price changes than SMA and EMA. If you want a moving average with less lag than an SMA, try a LWMA.
It kind of also have a more clarity in defining the price trend and reversals. Trade signals usually based on crossovers, they can also indicate areas of potential support or resistance. But beware though, multiple false signals may also occur before a significant trend develops. Use a filter, some decent volatility oscillator might do the job.
--
The formula for this Linearly Weighted Moving Average is:
LWMA = (( P n∗ W 1)+( P n−1∗ W 2)+( P n−2∗ W 3)...) / ∑W
P = Price for the period
n = The most recent period, n-1 is the prior period, and n-2 is two periods prior
W = The assigned weight to each period, with the highest weight going first and then descending linearly based on the number of periods being used.
I hope I'm doing right translating it to Pine Script 4. Let me know if I miss something.
Hull Candles [BigBitsIO]This script is for custom candles based on an HMA calculation with a default period of 10 as well as an SMA of the close price, defaulted to 1 period to only show the current price. The purpose of the custom candles is to try and reduce noise from candles and help identify trends. These custom candles somewhat resemble Heikin-Ashi candles in their appearance.
Explained:
- Open, High, Low and Close (o, h, l, and c) are all calculated using an HMA calculation based on a user input length/period, defaulted at 10.
- Candle colors are determined by using the same HMA calculation on the ohcl4 and comparing it to the previous candle. Green candles have an ohlc4 greater than the previous candle, all other candles are red.
- The current price is plotted with the default blue line with an SMA calculation with 1 period to allow customization of smoothing if necessary to identify trends.
DISCLAIMER: For educational and entertainment purposes only. Nothing in this content should be interpreted as financial advice or a recommendation to buy or sell any sort of security or investment including all types of crypto. DYOR, TYOB.
ADX and DI For Cryptocustomized version to add my favourite settings for crypto
Best time frame is daily followed by 4H
ADX Near 20 or less means trend is choppy and weak
ADX Cross over 30 means trend is starting to gain momentum
ADX Near 75 means momentum is near maximum, trend needs to rest for a while ( The area between 70~90 )
Ehlers Correlation Trend Indicator CTI by Cryptorhythms [CR]Ehlers Correlation Trend Indicator CTI by Cryptorhythms
📜Intro
In his article “Correlation As A Trend Indicator” in issue May 2020 of TASC, author John Ehlers introduces a new trend indicator that is based on the correlation between a security’s price history and the ideal trend: a straight line. He describes methods for using the indicator to not only identify the onset of new trends but to identify trend failures as well. He presents what looks like a simple and elegant idea for a trend-detection and mode-switching indicator.
📋Comments
Careful market selection may be the key to a correct application of the indicator. Even such barebone rules could shine with stocks like AAPL that tend to develop prolonged trends. But for others like CAT, which can keep oscillating in ranges for years, results will be much less impressive. They require a different approach. For example, you would want to buy when Correlation Trend falls significantly below zero and sell when it reaches positive values.
Therefore, it would be an interesting problem to research Correlation Trend’s ability to identify the switch to a cycle mode. That might help develop countertrend systems and
trade pullbacks. Another possible application might be to act as a system filter of change from trending mode to mean-reversion mode.
Extras
As usual when porting indicators to the library here on tradingview, I like to add some extra flare!
💠Customizable Overbought and Oversold Zones for Alert Creation
💠Bar coloration based on trade state for easy visual at a glance chart checking
💠Some basic example Entry and Exit conditions and a simple Trade State Engine to get you going creating your own strategy
Enjoy!
👍 We hope you enjoyed this indicator and find it useful! We post free crypto analysis, strategies and indicators regularly. This is our 81st script on Tradingview!
Nth-Occurrence Custom barssince() Function by Cryptorhythms [CR]Nth-Occurrence Custom barssince() Function by Cryptorhythms
Description
The vanilla barssince() function in pine only finds the number of bars since the most recent occurrence of the condition. This version allows you to specify an Nth occurrence back to check the bars since! Its also a nice little one liner.
I really hope you enjoy it and if you're looking for more, this is our 79th script on TV, so there is plenty to choose from!
Let me know in the comments if you create anything useful from this or think of anyway to improve it!
Custom Alert Message With alertcondition Example [BigBitsIO]This was a follower suggested script. This script shows an example of how to create a custom alert message using the alertcondition() function in pine.
Features:
- Well documented code with links to documentation for specific functions.
- Two alertconditions in a different order than the plots they reference to show the importance of plot IDs.
In order to actually get an alert with this script, you must create an alert through TradingView and reference this indicator and then reference the specific alert condition you want that alert to use.
For more information, contact me on social media or check YouTube for the associated video.
*** DISCLAIMER: For educational and entertainment purposes only. Nothing in this content should be interpreted as financial advice or a recommendation to buy or sell any sort of security or investment including all types of crypto. DYOR, TYOB. ***
Line & Label RGB Color Editor [DW]This script is a template designed to provide developers with UI color customization for v4 lines and labels.
The color pallete used within this script is a full spectrum "web safe" format with 216 colors to choose from.
Colors are easily modified via the RGB inputs. The designated color selector function takes in the RGB values and returns the corresponding hex color.
Transparency can be modified as well. However, the color.new function only supports constant integers for transparency value, so it has to be manually adjusted within the code.
On line 42, you'll see a variable within the color selector function named trans. This is the transparency value, which can be set to any integer from 0 to 100. I have it set to 0 by default.
I included a sample label to demonstrate how the color editor works. It also displays the hex codes for the current label and text colors for some additional reference.
Implementing this in your own script is pretty straightforward.
All you need to do is copy the color selector function and inputs (feel free to name them whatever you want) into your desired script. Then, you can use them to declare your color variables.
[Birbicator] StochTKDBirbicator is a custom indicator prototype based on Stochastic oscillator, enriched with Stochastic of Tenkan and Kijun of Ichimoku with adjusted, prototyped settings. It includes the ribbon, which corresponds with the momentum per Stochastic oscillator crossovers. It involves histogram as well which displays the relation of distance between Tenkan and Kijun. It displays the coloured candles in the main chart also. The orange colour is bullish while dark candle is bearish. White candles are neutral.
The indicator displays the strength of the trend when Stochastic and TK are following the same direction. The stronger buy/sell signal appears on the Stoch crossover simoultaneous to Histogram crossover.
Multiple EMAs with marked zones and custom timeframe supportThis script plots 10 exponential moving averages and marks the areas between them.
The lengths are Fibonacci numbers starting from 5 and ending with 377.
The colors indicate the length of the moving average, green for the shortest and purple for the longest.
The zones between consecutive EMA's (e.g. 5 and 8 ema ) are market according to the color of the greater one in value.
By default the script plots values for the current time frame, but supports custom time frames.
I'm releasing this script with an open visibility. Feel free to suggest improvements!
Enjoy,
s0ullight
Custom Self-Adjusting SuperTrendA custom version of Self Adjusting SuperTrend that can be used as source for your trading frameworks and indicators.
Your CRYPTO Screener - MACD 0 LAG editionHello traders
What's good?
1 - Quick introduction
This script is to demonstrate a proof-of-concept - showing you again what you thought wasn't possible might become (with some tricks) in the realm of possibles !!!.
I get requests for people who want a custom screener because the native TradingView Stocks/Forex/Crypto screeners don't allow to plug external indicators. (example: www.tradingview.com
This is entirely true and I have also good news for you, we can hack the system one more time. As Hackerman would say, "IT"S HACKING TIME !!!" (ref : KUNG FURY . (#geek #reference #done #for #today)
What if you could build your own personalized screener based on your custom indicator? "No Dave stop smoking, that's not possible, go back to eating your baguette". Say no more, let me present you my new script called YOUR CRYPTO Screener (MACD 0 LAG)
2 - What is a MACD ZERO LAG?
We'll all agree this indicator is NOT in the TradingView screeners so I'm not cheating here :)
A MACD ZERO LAG is a MACD that .... suspens.... wait for it.... DOES NOT lag.
The traditional MACD is based on exponential moving averages and as moving averages are lagging, then the MACD is lagging also. I'll spare you all the maths behind the MACD ZERO LAG but in short, this is a way more reactive indicator than the traditional MACD
I shared before the version that I personally use for my own trading : MACD 0 LAG nTREND coloring
3 - Crypto Screener specifications
If I could do a screener as complete as the native one, this would be wonderful but ... we cannot and this is due to technical reasons. To call indicators from different timeframes, I have to use the security function. And we're limited to 40 security calls per indicator.
That explains why I selected 4 crypto assets and 5 timeframes and the MACD zero lag output for each asset/timeframe - which gives a total of 4 * 5 * 2 = 40
You'll be able to select from the interface the 5 timeframes that you want for your screener
In this script, you'll get a :
- BUY whenever the MACD ZERO LAG for your asset/timeframe is green.
- SELL whenever the MACD ZERO LAG for your asset/timeframe is red.
4 - Can you hack it even more?
If you want to add other timeframes or assets, you can either, change the code or add the indicator on another chart.
I made the source code generic enough so that you can update it yourself easily
Example:
Chart 1 will list BTCUSD, ETHUSD, LTCUSD, and XRPUSD in m5/m15/m30/H1/H4 and Chart2 could list BTCUSD, ETHUSD, LTCUSD and XRPUSD in H6/H8/H12/Daily, etc...
Once again the sky (and your computer RAM capacity) is the limit
5 - Can you super hack it even more?
1/ This script is only a proof-of-concept that you can build your own custom screener. Imagine having the Algorithm Builder and being able to connect it in a single click to a custom screener using your own configuration :)
How coooooooooooooooool would that be!!!
This screener version will be available on my website in a few weeks along with all the tools I'm spamming you about since the beginning of July (#shameless #self-advertising)
2/ For a nicer scripter, let's keep in mind that TradingView just enabled Webhooks this week. This will allow my company to offer custom screeners design and hosted on your own website. Those screeners will be for sure nicer than the indicator version
That's it for today and for this week
I won't even touch the laptop this weekend and will enjoy life a bit
Love you all
Dave
____________________________________________________________
Be sure to hit the thumbs up. Building those indicators take a lot of time and likes are always rewarding for me :) (tips are accepted too)
- If you want to suggest some indicators that I can develop and share with the community, please use my personal TRELLO board
- I'm an officially approved PineEditor/LUA/MT4 approved mentor on codementor. You can request a coaching with me if you want and I'll teach you how to build kick-ass indicators and strategies
Jump on a 1 to 1 coaching with me
- You can also hire for a custom dev of your indicator/strategy/bot/chrome extension/python
Customizable Trend Direction (Open-Source)Hello everyone
I received a ton of requests for this script so I decided to share it
I did it for a client who didn't want to pay (you can all blame... or even thank him for this script) in the end and I don't want to sell it on my website.
Not because it's not interesting but because my website will be a place to showcase and rent the Algorithm Builders mostly
What is it about?
Basically, it shows how you could convert a plotshape into a label.new object. Very interesting if you want someday to convert your V3 script into V4
With this script, it shows that you can in V4 ( but couldn't do in V3 ) do the followings :
- change dynamically the size (from tiny to huge) of any object
- change dynamically the text (from whatever to whatever) of any object
Screenshot of the user interface
imgur.com
Other use cases
I did it with the Trend Direction but could work with anything really.
- Any indicator with a visual signal. You can know personalized from a user interface the text, size and also the vertical shift. I didn't do it for that one but label.new takes a (x,y) coordinates so playing with y is fairly easy to achieve a dynamic vertical shift
- Even with this script Plotchar-How-to-draw-external-symbols-on-a-chart/ but would require to be updated with a label.new object and with a shape.none parameter so that we'll only see the icon/symbol displayed
- The colors also can be change dynamically using presets Presets-Selector-FRIDAY-NIGHT-CHALLENGE/ . If you have an indicator showing a BULLISH and a BEARISH signal, then you could, for instance, configure colors presets according to the timeframe of the chart or the indicator input, etc (sky is the limit ^^)
Be sure to hit the thumbs up at it motivates me to research what Pinescript can offer and share with the community
Dave
____________________________________________________________
- I'm an officially approved PineEditor/LUA/MT4 approved mentor on codementor. You can request a coaching with me if you want and I'll teach you how to build kick-ass indicators and strategies
Jump on a 1 to 1 coaching with me
- You can also hire for a custom dev of your indicator/strategy/bot/chrome extension/python
Customizable Trend DirectionHi everyone
Publishing this as a few clients want to try it out
It's basically a proof-of-concept to show that size and text can be manipulated :)
Size and text and label vertical position are udpatable
Will publish an open-source script today or tomorrow hopefully
Dave
420_MA_3 (3 moving average + custom ma + alerts) Three Moving Average System with Alerts
Saw a friend post a 3 ma script recently and I don't think it had this much functionality.
much love
gl hf
xoxo
snoop
Perigraph's Customizable Multi VWAP LinesCustomizable Multi VWAP Lines
input examples:
30, 60, 120, 180, 240,360,480, 720 = minutes
D = Days
W = Weeks
M = months
12M = 12 Months
FREE TRADINGVIEW FOR TIMEFRAMESWhen doing i.e the 3 minute timeframe turn on the closest timeframe available for you or the candles and wicks will be fucked up.
So if you're doing the 5 hour timeframe candles turn on the 4hr chart on your main chart.
To View the candles in full screen double click the windows with the candlesticks
If you don't have TradingView premium and want to look at custom timeframes you can use this.
For the ticker/coin/pair you want to show enter it like this:
For stocks, only the ticker i.e: MSFT, APPL
For Crypto, "Exchange:ticker" i.e: BITFINEX:BTCUSD, BINANCE:AGIBTC, BITMEX:ADAM19
When setting up the timeframe write i.e:
For minutes/hourly: 5, 240 (4 hour), 360 (6 hour)
For daily/weekly/monthly: 1D, 2W, 3M
When doing i.e the 3 minute timeframe turn on the closest timeframe available for you or the candles and wicks will be fucked up.
So if you're doing the 5 hour timeframe candles turn on the 4hr chart on your main chart.
Momentum Oscillator Momentum Oscillator
Concept for this leading indicator presented in IFTA by By M.Fawzy.
RSI oversold trend changeSimple script that will plot a circle indication on the chart when RSI returns above 30 from oversold position.
Also allows you to create a custom alert.
Custom Anchored VWAP Offset V2This is the anchored VWAP with offset option which can be used on any timeframe, including intraday.
The Hulk by Sakura w AlertsWritten by profghibli ( aka Karim Ghibli) as a custom script for LydiaBot.
The underlying indicator is made by @Sackura, obtained and built upon with his permission. The Hulk indicator is a high frequency, relatively low noise trend-based indicator.
Hulk seems to work best when used on longer timeframes, such as 3-6-12 hrs . If you wish to use this script please contact Sackura and/or LydiaBot first.
This is the indicator (study) version of
To properly setup alerts, here are the instructions: www.youtube.com
__________________________________________________________________________
If you are an authorized user of this script and something is not working/looks wrong please PM me.
Zindarra Multi Alerts Advanced (8 Symbols, 8 Levels) by RRBZindarra Multi Alerts Advanced by RRB by RagingRocketBull 2018
Version 1.0
This indicator lets you configure multiple alert levels for several assets. Zindarra Multi Alerts Advanced supports 8 symbols with 8 custom alert levels.
You can have an M:M relationship betweeen symbols and levels, for example:
- 4 symbols each boxed by 2 alerts above/below the price
- 3 symbols with 1 alert each
- 2 symbols, 1st with 2 alerts, 2nd - with 6 alerts
- 1 symbol with 8 alerts etc
There are several versions: Simple, Pro, Advanced and Ultimate. This is the Advanced version. The Differences are listed below.
- Simple: 10 Alert Levels, 1 plot mode, alert type: cross, no colors/triggered alerts
- Pro: 9 Alert Levels, 2 plot modes: plot/price line, alert type: cross, +change/swap colors, +hide/disable triggered alerts, 2 penetration modes (close, high/low), trigger on confirmed close
- Advanced: 8 Symbols/Tickers, 8 Alert Levels, +alert types: cross up/cross down, no color change. Display sources as lines/candles, normalize, scale/shift independently
- Ultimate: 5 Symbols/Tickers, 8 Alert Levels, +alert types: volume/price %/abs change, volume/ema/time cross
Features:
- 8 custom symbols, symbols:levels = M:M
- 8 custom alert levels with labels. For each alert there must be a corresponding non-empty symbol (can be a duplicate)
- alert types: cross/cross up/cross down
- normalize symbols (and alert levels) to 100% to compare,
- scale and shift each symbol (and alert levels) to position on a chart independently
- 1 alert levels plot mode: plot
- 2 symbol types: line/candles
- colorize symbol candles
- high/low or close level penetration modes
- show/hide levels/labels
- keep or auto disable triggered alerts
- trigger alerts only after a confirmed close
You will see all symbols on a single chart at the same time with their corresponding alert levels. From this chart you can manage all alerts configured for multiple assets.
Although TradingView has 2 percentage scale modes (Percent, Indexed to 100), somehow they still fail to be usefull when comparing multiple assets.
This indicator lets you normalize all symbols to 100% making a direct single scale comparison between assets with vastly different price levels possible.
All alert levels will be normalized as well.
TradingView does not let you move the plots attached to left scale. When scaled they all remain stuck in the center and can't be moved vertically or relative to each other.
This indicator lets you position all symbols independently using individual scale and shift settings. For example, you can:
- split your screen in 3 horiz areas and have a symbol in each of them without overlapping or
- have several partially overlapping assets with different scale each or
- have all assets fully overlapping and normalized to the same 100% scale
You have to manually create an alert in Manage Alerts Panel and configure it to use with this indicator.
Free accounts are limited to only 1 alert slot and this indicator will take it (any existing alerts must be disabled/stopped).
Once the alert is configured, the indicator can be removed from chart to free a slot for another indicator, but you won't see the alert levels.
Usage:
1. attach indicator to a chart
2. define alert levels in UI settings
3. in TradingView's Manage Alerts panel on the right:
- for free accounts: disable/stop all existing alerts, you are limited to 1 alert slot only. Otherwise you won't be able to save.
- create a new Alert:
- select 'Multi Alerts' indicator name in the Condition dropdown box, leave Level 1 and Multi Alerts Cross as default options
- select 'Once Per Bar' or 'Once Per Minute' instead of 'Only Once' to trigger the alert multiple times
5. click Save. Your 9 alerts are enabled now.
Change Settings:
1. change levels/settings in UI. Any changes will also reset already triggered levels visibility.
2. in Manage Alerts panel:
- open/edit the alert you created
- select new instance of 'Multi Alerts' indicator name in the Condition dropdown box (appears at the bottom)
- check the Condition dropdown again - a single instance should remain selected.
3. click Save. Your alert settings are updated.
Notes on using alerts:
- attaching this indicator to a chart and configuring alert levels will not automatically enable the alerts - you have to manually create/configure a new alert in the Alerts Panel
- removing this indicator from chart will not disable the alerts, you have to manually disable the alert you created in the Alerts Panel
- your alert in the Alerts Panel uses another instance (copy) of indicator/settings. Any changes won't affect the alert. You have to manually update the alert every time you change any settings in the indicator.
- recompiling and attaching your own version of indicator will require creating a new Alert (delete the old one).
- alerts are designed to work in realtime. In replay mode you will see triggered alert levels hiding/changing colors but there will be no system alert messages. It's best to test the indicator in realtime on M1 (1 min) chart
- you will only see 1 system alert per bar/60 sec when multiple alert levels are crossed with a single bar or across several symbols at the same time. However all of these levels will hide in the indicator as expected.
- you can only see the alert levels when the indicator is attached to chart, they are not shown by the system alert.
- For source=high/low a directional level penetration is used automatically (crossunder/low and crossover/high). For source=close a standard bidirectional cross is used unless another alert type is specified.
- normalization breaks/distorts alert levels and symbol price - this is normal and is expected. To view the real price of alert levels uncheck normalize - the first 8 outputs are alert levels. Unnormalized levels are straight lines.
- you will see alerts from all symbols in the system alert message box of the current symbol - a bit confusing, but there's no workaround, you can't have a customized alert message for each symbol/level
- many tickers as arguments can stretch/break TradingView's Create New Alert dialog but it's still possible to push all required buttons and Save.
- duplicate symbols will be displayed by default. You can manually hide duplicates using show/hide flags.
- empty tickers (and corresponding alerts) are essentially disabled
1. uses plot*, cross*, barssince, highest, security, alertcondition
Zindarra Multi Alerts by RRBZindarra Multi Alerts by RRB by RagingRocketBull 2018
Version 1.0
This indicator lets you configure multiple alert levels for an asset. Zindarra Multi Alerts supports 10 custom alert levels.
You have to manually create an alert in Manage Alerts Panel and configure it to use with this indicator.
Free accounts are limited to only 1 alert slot and this indicator will take it (any existing alerts must be disabled/stopped).
Once the alert is configured, the indicator can be removed from chart to free a slot for another indicator, but you won't see the alert levels.
This is the Zindarra Multi Alerts Simple version. You can't auto disable already triggered alerts in this indicator. All alerts will remain active.
If you want to be able to hide/disable/change color of the triggered alert levels use the Zindarra Multi Alerts Pro version.
Features:
- 10 custom alert levels with labels
- set open/high/low/close source point for level penetration
- show/hide levels/labels
Usage:
1. attach indicator to a chart
2. define alert levels in UI settings
3. in TradingView's Manage Alerts panel on the right:
- for free accounts: disable/stop all existing alerts, you are limited to 1 alert slot only. Otherwise you won't be able to save.
- create a new Alert:
- select 'Multi Alerts' indicator name in the Condition dropdown box, leave Level 1 and Multi Alerts Cross as default options
- select 'Once Per Bar' or 'Once Per Minute' instead of 'Only Once' to trigger the alert multiple times
5. click Save. Your 9 alerts are enabled now.
Change Settings:
1. change levels/settings in UI
2. in Manage Alerts panel:
- open/edit the alert you created
- select new instance of 'Multi Alerts' indicator name in the Condition dropdown box (appears at the bottom)
- check the Condition dropdown again - a single instance should remain selected.
3. click Save. Your alert settings are updated.
Notes on using alerts:
- attaching this indicator to a chart and configuring alert levels will not automatically enable the alerts - you have to manually create/configure a new alert in the Alerts Panel
- removing this indicator from chart will not disable the alerts, you have to manually disable the alert you created in the Alerts Panel
- your alert in the Alerts Panel uses another instance (copy) of indicator/settings. Any changes won't affect the alert. You have to manually update the alert every time you change any settings in the indicator.
- recompiling and attaching your own version of indicator will require creating a new Alert (delete the old one).
- alerts are designed to work in realtime. In replay mode you will see only the alert levels but there will be no system alert messages. It's best to test the indicator in realtime on M1 (1 min) chart
- you will only see 1 system alert per bar/60 sec when multiple alert levels are crossed with a single bar.
- you can only see the alert levels when the indicator is attached to chart, they are not shown by the system alert.
- a standard bidirectional cross is used for all penetration sources
1. uses plot*, cross*, alertcondition