How to send Divergence signals to your Discord server- Do you have a Discord server set up for your own trading community?
- Do you use divergences as part of your trading strategy?
- Would you like to send automated notifications to your Discord server whenever a divergence appears on any chart?
If you have answered yes to all 3 questions above, please keep on reading.
The easiest way to receive automated Divergence alerts to your Discord server, is to combine the alert messages from "The Divergent" divergence indicator on TradingView with a Webhook endpoint on your Discord server.
Step 1: Open Discord, and go to Server Settings
Step 2: Go to Integrations and create a new Webhook
Step 3 (optional): Rename your Webhook to "The Divergent (Divergence indicator)"
Step 4: Select the channel you wish to receive the divergence signals to (i.e. #divergence-signals)
Step 5: Save your Webhook
Step 6: Copy your Webhook URL to your clipboard and head over to TradingView
Step 7: Apply "The Divergent" or "The Divergent (Pro)" indicator to your chart and configure it as you prefer (The free version of The Divergent can signal Regular Divergences only, while the Pro version can signal both Regular and Hidden Divergences)
Step 8: Create a new alert, select "The Divergent" from the top drop down and select one of the Divergence signals (i.e. Regular Bullish)
Step 9: Use the Webhook URL from your clipboard as the Webhook URL of the alert
Step 10: Use the following alert message:
{"content": "The Divergent detected a Regular Bearish Divergence (RSI) on {{exchange}}:{{ticker}} ({{interval}}) @TradingView #divergence $BTC "}
Sample message delivered on Discord:
"The Divergent detected a Regular Bearish Divergence (RSI) on BINANCE:BTCUSDT (60) @TradingView #divergence $BTC"
Feel free to change the content to match your chart / type of divergence you are signalling in the alert.
Note : It is important that you format your alert message as a JSON string, and that you key the message with "content". If you have never used JSON before, it is a good idea to validate your message via jsonlint.com to make sure it is a valid JSON string.
Repeat the same steps for other charts / divergences. Create as many alerts, as many markets / divergences you want to signal to your Discord server.
If you have any questions, please feel free to post it in the comments section below.
If this tutorial was helpful to you, please consider giving it a thumbs up!
Thank you!
Pinescript
The easiest way to use divergences in your own Pine strategiesDetecting divergences in a Pine indicator / strategy is easy.
You simply have to compare the pivot lows and the pivot highs on the price and the oscillator, and if you can identify a difference between the last & previous pivots made on the price and the oscillator, you have likely found a divergence.
Using this theory, here is an example how you would detect a Regular Bearish divergence:
While the theory of divergence detection is simple, more often than not, things go wrong (the divergence indicator used in the example below is TradingView's built-in Divergence Indicator ):
Would you identify this as a divergence? If not, why not? Is it because the divergence line is slicing through the candles? Or because the line is slicing through the oscillator? Or something else?
Wouldn't it be great if somehow you could filter out invalid divergences from code, such as this one?
We at Whitebox Software were wondering about the same thing, and decided to find a solution to this problem. This is when we realised that while detecting divergences is easy, detecting valid divergences is hard...
After several months in development, we are proud to present to you our divergence indicator called The Divergent .
The Divergent is an advanced divergence indicator with over 2500 lines of Pine Script, exposing over 30 different configuration options, including 9 built-in oscillators, to allow you to tweak every aspect of divergence detection to perfection.
For example, the Line of Sight™ filter in The Divergent would have easily filtered out this invalid divergence above. The Line of Sight™ filter will notice any interruption to the divergence line connecting the price or the oscillator, and will treat the divergence as invalid.
This filter is one of many, which has been created to reduce the false positive detections to a minimum. (In later publications, we will discuss each and every filter in detail).
Alright, so The Divergent knows how to detect accurate divergences, but how is it going to help you detect divergences in your own Pine strategy?
The Divergent is not simply a divergence indicator - it can also emit divergence signals * which you can catch and process in your own strategy. You can think of The Divergent being a DaaS ( D ivergences a s a S ervice)!
* Please note, that divergence signals is a Pro only feature.
To use the signals, simply place The Divergent onto the same chart you have your strategy on, import "The Divergent Library" into your code, link your strategy to The Divergent using a "source" input, and act on the signals produced by The Divergent !
Here is a simple strategy which incorporates divergence signals produced by The Divergent in its entry condition. The strategy will only open a position, if the moving average cross is preceded by a regular bullish or bearish divergence (depending on the direction of the cross):
//@version=5
strategy("My Strategy with divergences", overlay=true, margin_long=100, margin_short=100)
import WhiteboxSoftware/TheDivergentLibrary/1 as tdl
float divSignal = input.source(title = "The Divergent Link", defval = close)
var bool tdlContext = tdl.init(divSignal, displayLinkStatus = true, debug = false)
// `divergence` can be one of the following values:
// na → No divergence was detected
// 1 → Regular Bull
// 2 → Regular Bull early
// 3 → Hidden Bull
// 4 → Hidden Bull early
// 5 → Regular Bear
// 6 → Regular Bear early
// 7 → Hidden Bear
// 8 → Hidden Bear early
//
// priceStart is the bar_index of the starting point of the divergence line drawn on price
// priceEnd is the bar_index of the ending point of the divergence line drawn on price
//
// oscStart is the bar_index of the starting point of the divergence line drawn on oscillator
// oscEnd is the bar_index of the ending point of the divergence line drawn on oscillator
= tdl.processSignal(divSignal)
bool regularBullSignalledRecently = ta.barssince(divergence == 1) < 10
bool regularBearSignalledRecently = ta.barssince(divergence == 5) < 10
float slowSma = ta_sma(close, 28)
float fastSma = ta_sma(close, 14)
longCondition = ta.crossover(fastSma, slowSma) and regularBullSignalledRecently
if (barstate.isconfirmed and longCondition and strategy.position_size == 0)
strategy.entry("Enter Long", strategy.long)
strategy.exit("Exit Long", "Enter Long", limit = close * 1.04, stop = close * 0.98)
shortCondition = ta.crossunder(fastSma, slowSma) and regularBearSignalledRecently
if (barstate.isconfirmed and shortCondition and strategy.position_size == 0)
strategy.entry("Enter Short", strategy.short)
strategy.exit("Exit Short", "Enter Short", limit = close * 0.96, stop = close * 1.02)
plot(slowSma, color = color.white)
plot(fastSma, color = color.orange)
One important thing to note, is that TradingView limits the number of "source" inputs you can use in an indicator / strategy to 1, so the source input linking your strategy and The Divergent is the only source input you can have in your strategy. There is a work around this limitation though. Simply convert the other source inputs to have a string type, and use a dropdown to provide the various sources:
string mySource = input.string("My source", defval = "close", options = )
float sourceValue = switch mySource
"close" => close
"open" => open
"high" => high
"low" => low
=> na
---
This is where we are going to wrap up this article.
We hope you will find the signals produced by The Divergent a useful addition in your own strategies!
For more info on the The Divergent (Free) and The Divergent (Pro) indicators please see the linked pages.
If you have any questions, don't hesitate to reach out to us either via our website or via the comment section below.
If you found value in this article please give it a thumbs up!
Thank you!
POW Edge Reversal is HERE 🚀🚀🚀🚀🚀🚀🚀We've been sharing ideas on this strategy for quite some time now as part of our 'forward testing' approach and log.
In this video, I run through the strategy, how it works and how it can help.
Everything we do at POW is based on 'proof it works' - this is no different and you'll see this in the data I run through for you.
Any questions about gaining access please drop me a DM on here.
This just shows how powerful Pine script is - to automate a strategy and confirm you have an edge in the market.
Removing stress, decisions, overwhelm and all of the emotional struggles trading can bring.
Let me know in the comments what you think please - be nice right 😅?
Please scroll through some of my previous ideas to see some trades in action.
Regards
Darren
A "Welcome to" Pinescript coding, Part 3In this lesson, the third in the series, I'll show you how to write a "non-overlay" script.
These sit below or above the price chart. They are best for cases where the values the indicator generates are nowhere near the price.
Trying to plot a value of 100 on a chart where the price is 42,000 is pretty pointless, after all!
Why trading with Pine script can give you an extra month a year!I've spent around 9/10 years trading with technical analysis.
I used to spend 2/3 hours on a weekend and easily 1/2 hours each day on the screen - that doesn't include the amount of times I'd be checking from my phones on and off throughout the day too!
So add that all up - its 620-700 hours per year.
Frightening.
We trade for freedom and time - not to spend that time looking at a chart.
Well, in my opinion anyway.
A month is 720 hours - so pretty much an extra month a year.
Crazy right?
Fed up, I created a systematic approach.
This video highlights how my systematic strategy works vs. how you would see the markets technically on the last GJ sell.
Pinescript makes all this easier too, I have data at the click of a button!
Any questions feel free to drop me a DM.
Thank you,
Darren.
Bitcoin Dip Buying - Part 0: Coding the IndicatorThis is a prequel video for a series on how to identify and buy liquidation dips in Bitcoin and other cryptocurrencies. Most aspiring traders do not have time to dig into the full process of becoming a successful trader and instead want to skip straight to making millions of dollars so this video is labeled as Part 0; it is optional. This video is for those that want an overview of Tradingview's Pine Script coding so that they may better understand what it takes to build a trading strategy from scratch.
Tips on securing your own Pine Script code and sharing10 Pine Commandments
Rule number uno: never share something you don't intend on open-sourcing. It will be archived forever.
2. If you believe ideas are intellectual property and you have a 1 in a million unique idea, tell them that you would like that idea to not be shared.
3. If someone randomly sends you scripts without you prompting, don't send them some of your (valuable) ones because you feel as if there has been rapport or trust built.
4. Never get high on your own supply
The rest of these biggie lyrics don't make any sense for this. Anyways:
When you turn "sharing on" for your chart and add a script from console, anyone can copy the script and see the source code. This is expected behavior but should be known for those who don't like sharing.
When you publish an idea and add a script from console, the same thing happens as above. If you've done this on accident, you have 15 minutes to delete it.
Tip: never work on a private project on a chart that has sharing on. Label chart names with 'Sharing' to help identify them.
If you want to allow trial use, create an invite-only indicator. Do not use closed-source indicators and assume updating them will stop trial usage.
Don't use pastebin lol.
You're not that original, and neither am I. We all use the same sites, read the same articles; mind meld is bound to happen. I used to publish scripts pre-emptively because of this.
When you share your indicator, it can be reverse engineered if it is simple enough/uses well known functions.
Here's a funny example that is slightly related:
Person is accused of stealing script, the accuser is accused of copy/pasting the Pine Legends Chris Moody/LazyBear:
www.trading view.com/script/4IfUS1Jd-SNG/
Accuser actually reverse engineered this script as far as I can tell:
www.trading view.com/script/pvGZhYxm-Canadian-Trader-Dream-Strategy/
New Pine Updates - Line.get_price(), label styles and much moreHello,
This video idea covers some of the big updates added to Pine and TradingView over the last several days. Most importantly, I show you how to use the following new features:
- line.get_price() - a function used to get the price of a line object on the chart at a specific bar value
- label styles - how to use the new styles added into Pine for your labels
I also discuss some other new features such as:
- label tooltips
- the addition of Candlestick patterns as built-in indicators on the platform
- syminfo.basecurrency
- timezone parameter when getting a bar's time
Thank you!
A More Efficient Calculation Of The Relative Strength IndexIntroduction
I explained in my post on indicators settings how computation time might affect your strategy. Therefore efficiency is an important factor that must be taken into account when making an indicator. If i'am known for something on tradingview its certainly not from making huge codes nor fancy plots, but for my short and efficient estimations/indicators, the first estimation i made being the least squares moving average using the rolling z-score method, then came the rolling correlation, and finally the recursive bands that allow to make extremely efficient and smooth extremities.
Today i propose a more efficient version of the relative strength index, one of the most popular technical indicators of all times. This post will also briefly introduce the concept of system linearity/additive superposition.
Breaking Down The Relative Strength Index
The relative strength index (rsi) is a technical indicator that is classified as a momentum oscillator. This technical indicator allow the user to know when an asset is overvalued and thus interesting to sell, or under evaluated, thus interesting to buy. However its many properties, such as constant scale (0,100) and stationarity allowed him to find multiple uses.
The calculation of the relative strength index take into account the direction of the price changes, its pretty straightforward. First we calculate the average price absolute changes based on their sign :
UP = close - previous close if close > previous close else 0
DN = previous close - close if close < previous close else 0
Then the relative strength factor is calculated :
RS = RMA(UP,P)/RMA(DN,P)
Where RMA is the Wilder moving average of period P . The relative strength index is then calculated as follows :
RSI = 100 - 100/(1 + RS)
As a reminder, the Wilder moving average is an exponential filter with the form :
y(t) = a*x+(1-a)*y(t-1) where a = 1/length . The smoothing constant being equal to 1/length allow to get a smoother result than the exponential moving average who use a smoothing constant of 2/(length+1).
Simple Efficient Changes
As we can see the calculation is not that complicated, the use of an exponential filter make the indicator extremely efficient. However there is room for improvement. First we can skip the if else or any conditional operator by using the max function.
change = close - previous close
UP = max(change,0)
DN = max(change*-1,0)
This is easy to understand, when the closing price is greater than the previous one the change will be positive, therefore the maximum value between the change and 0 will be the change since change > 0 , values of change lower than 0 mean that the closing price is lower than the previous one, in this case max(change,0) = 0 .
For Dn we do the same except that we reverse the sign of the change, this allow us to get a positive results when the closing price is lower than the previous one, then we reuse the trick with max , and we therefore get the positive price change during a downward price change.
Then come the calculation of the relative strength index : 100 - 100/(1 + RS) . We can simplify it easily, first lets forget about the scale of (0,100) and focus on a scale of (0,1), a simple scaling solution is done using : a/(a+b) , where (a,b) > 0 , we then are sure to get a value in a scale of (0,1), because a+b >= a . We have two elements, UP and DN , we only need to apply the Wilder Moving Average, and we get :
RMA(UP,P)/(RMA(UP,P) + RMA(DN,P))
In order to scale it in a range of (0,100) we can simply use :
100*RMA(UP,P)/(RMA(UP,P) + RMA(DN,P))
= 100*RMA(max(change,0),P)/(RMA(max(change,0),P) + RMA(max(change*-1,0),P))
And "voila"
Superposition Principle and Linear Filters
A function is said to be linear if : f(a + b) = f(a) + f(b) . If you have studied signal processing a little bit, you must have encountered the term "Linear Filter", its just the same, simply put, a filter is said to be linear if :
filter(a+b) = filter(a) + filter(b)
Simple right ? Lot of filters are linear, the simple moving average is, the wma, lsma, ema...etc. One of most famous non linear filters is the median filter, therefore :
median(a+b) ≠ median(a) + median(b)
When a filter is linear we say that he satisfies the superposition principle. So how can this help us ? Well lets see back our formula :
100*RMA(UP,P)/(RMA(UP,P) + RMA(DN,P))
We use the wilder moving average 3 times, however we can take advantage of the superposition principle by using instead :
100*RMA(UP,P)/RMA(UP + DN,P)
Reducing the number of filters used is always great, even if they recursion.
Final Touch
Thanks to the superposition principle we where able to have RMA(UP + DN,P) , which allow us to only average UP and DN togethers instead of separately, however we can see something odd. We have UP + DN , but UP and DN are only the positive changes of their associated price sign, therefore :
UP + DN = abs(change)
Lets use pinescript, we end up with the following estimation :
a = change(close)
rsi = 100*rma(max(a,0),length)/rma(abs(a),length)
compared to a basic calculation :
up = max(x - x , 0)
dn = max(x - x, 0)
rs = rma(up, length) / rma(dn, length)
rsi = 100 - 100 / (1 + rs)
Here is the difference between our estimate and the rsi function of both length = 14 :
with an average value of 0.000000..., those are certainly due to rounding errors.
In a chart we can see that the difference is not significant.
In our orange our estimate, in blue the classic rsi of both length = 14.
Conclusion
In this post i proposed a simplification of the relative strength index indicator calculation. I introduced the concept of linearity, this is a must have when we have to think efficiently. I also highlighted simple tricks using the max function and some basic calculus related to rescaling. I had a lot of fun while simplifying the relative strength index, its an indicator everyone use. I hope this post was enjoyable to read, with the hope that it was useful to you. If this calculation was already proposed please pm me the reference.
You can check my last paper about this calculation if you want more details, the link to my papers is in the signature. Thanks for reading !
Making A Good Indicator DescriptionIntroduction
When posting an indicator a good concept/code isn't the only thing required in order to have a quality indicator, its description is also extremely important. Each person has its own style,
mine is pretty academic, but as long as your description respect certain criterions you are free to do as you wish.
In this post i want to help you make the best of your published indicator by introducing basic concepts in post writing.
Basic Description
An indicator description should at least explain what kind of information your indicator is giving as well as how to interpret/use it. Lets take the Supertrend indicator as example, we'll be making a brief description of it.
The Supertrend indicator is a technical indicator created by the french trader Olivier Seban that aim to detect the current market trend direction. The indicator detect an up-trend when below the market price and a down-trend when above.
This indicator posses two setting, length and mult, higher values of length/mult allow the indicator to detect trends of longer period. This indicator can also be used as trailing stop loss, it can also provide a support level when below the price or a resistance level when above.
Lets breakdown this simple description.
-"The Supertrend indicator is a technical indicator created by the french trader Olivier Seban"
If the indicator is not yours, always credit/mention the original author, this is no option.
-"that aim to detect the current market trend direction"
Aim of the indicator.
-"The indicator detect an up-trending market when below the market price and a down-trend when above."
How to interpret the indicator.
-"This indicator posses two setting, length and mult, higher values of length/mult allow the indicator to detect trends of longer period."
Always try to introduce the indicator settings and explain how they affect the indicator output.
-"This indicator can also be used as trailing stop loss, it can also provide a support level when below the price or a resistance level when above."
Alternative uses of the indicator, try to provide a graphic showing the indicator acting as mentioned, i our case we should show a graphic showing the Supertrend acting as a support/resistance.
Once you write up your indicator description read it back several times (something i wish i could do more often) and always ask yourself if your indicator description fully describe the aim of the indicator. If you like writing you can of course add more elements, although try not to be redundant, this is really important, skip things such as :
"Yesterday i was dinning with a colleague and he asked me how to get zero-lag filters, since then i tried to..."
This is tiring for the reader and so try not including it.
More Complete Description
A more complete description introduce additional elements regarding your indicator such as your motivation behind its publishing, its calculation...etc.
Such description of the Supertrend indicator could look like this :
Detecting the current market price trend has always been a major challenge in technical analysis, systems relying on the cross between a noisy series and a certain level/indicator can produce whipsaws trades. In order to provide a solution to this problem more advanced indicators have been proposed, one of them being the Supertrend indicator developed by the french trader Olivier Seban.
This indicator aim to detect the current market trend direction, the indicator detect an up-trending market when the price is superior to the Supertrend, and a down trending market when the price is inferior to the Supertrend.
The indicator is an iterative calculation, the core element of its calculation involve creating two bands, denoted as upper/lower, calculated as follows :
upper = hl2 + atr(length)*mult
lower = hl2 - atr(length)*mult
where atr is the average true range of period length and hl2 is the median price defined as : (high + low)/2.
Higher values of length/mult allow the indicator to be less sensitive to shorter price variations, this allow to detect trends of longer period.
Apart from the basic indicator usage described above, the Supertrend indicator can also act as a :
- trailing stop loss, in this case if the closing price cross the value of the indicator, the trade will be closed.
- support/resistance level, in this case an upward movements can be expected after the low price cross the Supertrend, and a downward movement when the high price cross the Supertrend indicator.
In conclusion, the Supertrend indicator is an elegant solution when it comes to detecting the current market price trend, its ability to avoid whipsaws trades makes him a good ally for decision making.
Including Graphics
Graphics of your indicators can add more clarity to your description since visual examples are often easier to understand, the goal here is to see how your indicator interact with the market price. Try including readable graphics, this can mean charts without other indicators (except if your indicator can work in conjunction with other indicators).
However keep your main chart (your current chart layout when publishing the indicator) free of any other indicators/elements, it should only contain the price and your indicator, its the first image people we'll see and if it include other indicators then people will have an hard time telling which one is the one you are publishing.
It can be interesting to show your indicators using different settings rather than the one put by default. You can make use of figures such as arrows or crosses in order to highlight the signals made by your indicator.
Additional Advices
Use a bold text when declaring the title of a section, use italic with text that represent code, formulas, variables names.
You can first write your indicator description on a text editor.
If your code include another work from tradingview don't forget to mention it in the description, for example :
this indicator make use of the "name of the indicator" made by "name of the author" that you can find here "tradingview link of the indicator".
In this case make sure you have the consent of the author of the indicator you are using. This is no option, else you can have your indicator taken down.
Don't include bitcoin wallets/donation links in your indicator description, those go on your signature and nowhere else.
Knowing when not to make a description is important, and by that i mean knowing when not to publish, make sure to read the house rules before you are publishing an indicator.
If you are still struggling then you can try to read other indicators description on the net, if you want a deadly serious description then you can learn from the structure of research papers. For example if your indicator is similar to a moving average try reading descriptions of moving average indicators and inspire yourself from them.
Conclusion
Making a good indicator description is essential, the benefits of doing it are enormous, don't forget that scripts take space in servers. If you are publishing a script and that you know that your description is to short and doesn't explain the aim of your indicator then you are just adding more work for the moderators, its not nice.
Also great descriptions allow you to gain trust and credibility in the community, and more importantly it shows that you care about your indicator, i might be harsh but people that does not care about their indicators does not deserve to publish them (however its not case with you nice reader, right ?).
I hope i can help users with this post, its an important subject, if you have doubts about your indicator description try seeking for help in the pinescript chat, you can even contact me, i will be happy to help.
Thanks for reading, and if you plan to use those advices then thanks for caring, love u :kokoro:
Tips And Tricks In PinescriptConclusion
I’am starting with the conclusion since i don’t plan to be on tradingview for some time. Pinescript is a really easy to use and learn language and i had a lot of fun writing all my indicators, i remember the first time i used it, it was a really nice day and i opened the script editor to edit the awesome oscillator indicator, i changed the sma to an ema, how cute, changing a letter, i was 16.
However we made a lot of progress in three years, i have often heard that i was a prolific, creative and talented indicator maker, and since my only goal in tradingview was to share and help people, i will leave all the tips and tricks related to pinescript i have to help you make great indicators.
Show the code
When publishing you can hide the code of your indicator, my first tips is to always show the code of your indicator/strategy except if you have a really good reason to hide it. Showing your code can help other people spot errors thus making you improve. If you think that your code is the holy grail and this is why you have to hide it i must tell you that there are a lot of researchers publishing papers that you can read about machine learning and other mega complex stuff applied to financial markets. At the end sharing is caring so share everything from your indicator !
Structure Your Code
Its common to make an indicator, save it, and start a new project from scratch, then if you come back to the saved indicator you can get lost, this happened with me several times. First create sections in your code, then delimit each section with a commentary, commentaries can be made in pine with //, i personally use //---- but you can use whatever you want like //ma section or //plots etc. The name of your variables can also be important, i’am conformable with an alphabet like variable declaration. Therefore you could structure you code like this :
study(…..)
length = input(14)
//----
a = …
b = …
c = …
//----
plot(…)
So try to find a structure style such that you will be confortable with :)
Making Different Types Of Filters in Pine
There are different types of filters, i explain each ones in my post Digital Filters And DSP . Here is the code to compute all common types of filters :
low-pass (lp) = lp(x)
high-pass (hp) = x - lp(x)
bandpass (bp) = lp(x - lp(x))
band-reject (br) = x - lp(x - lp(x))
with a simple moving average this give you :
low-pass moving average = sma(close, length)
high-pass moving average = x - sma(x, length)
bandpass moving average = sma(x - sma(x,length),length)
bandreject moving average = x - sma(x - sma(x,length),length)
This is a easy way to compute each filters types. You can use other filters types instead of the simple moving average.
Understand The Exponential Window Function
The exponential window function is my favorite equation and in my opinion one of the most elegant thing i had the chance to use. This window function is widely used and have the following form :
alpha*x + (1-alpha)*y
or
y + alpha*(x - y)
alpha is called a smoothing constant, when a = 0.5 you are just computing the average between x and y because a = 0.5 and 1 - a = 0.5, therefore you end up with : 0.5*x + 0.5*y = (x + y)/2. But the beauty of this function is that as long as a is greater than 0 and lower than 1 you will give more weight to x or y depending of a. There are a lot of indicators using this, the most well known being the exponential moving average.
Rescaling Inputs in A Certain Range
Scaling involve putting the input in a certain range such that the output is always equal or lower than a certain value and always equal or higher than another value, there are several ways to rescale values in a certain range, here are some ways to rescale values in Pine :
rsi(x, length) - rescale values in range of (100,0), higher length will converge the results toward 50, if you don’t want that use smooth values for x.
stoch(x,x,x,length) - rescale values in range of (100,0)
correlation(x,n,length) - rescale values in range of (1,-1)
sign(x) - rescale values in a range of (1,-1), 1 when x > 0 and -1 when x < 0.
x/highest(x,length) - values will always be equal or greater than 0 and equal or lower than 1, when x is high the output will be closer to 1.
lowest(x,length)/x - values will always be equal or greater than 0 and equal or lower than 1, when x is low the output will be closer to 1.
a = change(src,length)
b = abs(a)/highest(abs(a),length) * sign(a) - rescale values in a range of (1,-1)
a/(a + b) - rescale values in a range of (1,0) if a > 0 or (1,-1) if a < 0 as long as a < (a + b)
(x - b)/(a - b) - rescale in a range of (1,0) if x > b and a > x.
see also :
Use operations to scale in a desired range, when the rescaling is in a range (1,-1) use the following operations :
0.5 * rescaling + 0.5 if you want to rescale in a range of
(1 + rescaling) * (maximum/2) if you need a custom range
Use Recursion With The Exponential Window Function
Recursion is the process of using outputs as inputs for a function. Pine allow you to use outputs as inputs thanks to the nz() function. Lets use an example, imagine the following code with the version 2 of pinescript :
a = change(nz(a ,close),9)
This code compute the difference between a and a 9 bars back, now when the code will make the first calculation you want a numerical value for a because a will be equal to na (non attributed), this is why you need to have an initial value (also called a seed) for a and this is what nz() do , attribute a value to a when a = na. By running the code above you will end up with a periodic results, so how can you use recursion with your indicators ? Here the following code example show you how :
alpha = 0.5
a = scale(close, length)
b = function(alpha*a+(1-alpha)*nz(b ,a))
When you want to use recursion in a function you must first declare alpha, alpha can be any value as long as alpha is greater than 0 and lower than 1, then you must scale your input (here the closing price), this is done because depending on the price scale you could get different results when using recursion, when your rescaling range is low (1,0) your results could be more periodic than in a range like (100,0).
function is the function you want to use, if you rescaled the input you should use a function that don’t plot in the chart, if your function is a simple moving average sma or another filter you won’t need to scale the input, however if you use function such as change, rsi, stochastic…or any other oscillator you will need to rescale the values in a certain range. Recursion can help you get smooth, predictive, periodic and reactive results. If you need adaptive results you can even make alpha a variable by rescaling something you want in a range of (1,0), for example :
alpha = scale(tr,length)
a = scale(close)
b = function(alpha*a+(1-alpha)*nz(b ,a))
Create Adaptive Exponential Filters Easily
Adaptive moving averages are greats because market exhibit a dynamical behavior, so adaptivity is a good way to have really great filters. An easy way to have adaptive filters is by using exponential averaging, in short using the structure of an exponential moving average, the ema of x is calculated as follow in pine :
y = alpha*x + (1-alpha)*nz(y ,x)
which can derived to :
y = nz(y ,x) + alpha*(x - nz(y ,x))
where alpha = 2/(length + 1)
As you can see we go back to the exponential window function and thanks to this function the ema is really efficient to compute. An adaptive filter will use a variable alpha instead of a constant one, so as long as 1 >= alpha >= 0 you will get an adaptive filter. If you want to adapt the filter to market volatility just rescale a volatility indicator like the atr in a range of (1,0), in pine this would look like :
alpha = scale(tr,length)
y = alpha*close + (1-alpha)*nz(y ,close)
If you need alpha to decrease when length increase you can divide your rescaling by length, for example if you use the stochastic of the true range as alpha you can make :
alpha = stoch(tr,tr,tr,length)/100 / sqrt(length)
y = alpha*close + (1-alpha)*nz(y ,close)
Create An Adaptive Simple Moving Average
In pine you can compute a simple moving average by using the sma() function :
sma = sma(x,length)
now imagine you want to use a non constant length, like for example the barssince() function, well you can’t because the sms function only work with constant integers, so how can you use non constant integers for calculating an adaptive sma ? Well you can derive the sma formula like this :
length = barssince(cross(close,vwap)) + 1
rsum = cum(close)
asma = (rsum - rsum )/length
Make sure that length is always greater or equal to 1, if length is a float use the round() function :
length = round(barssince(cross(close,vwap)) + 1)
Use Fixnan For Colors
When plotting an indicator with a plot fonction using a condition to change colors, you will have a different color if the indicator value is equal to its previous value, this image describe this case :
with :
a = highest(50)
c = if a > a
lime
else
if a < a
red
plot(a,color=c)
Instead you can use a ternary operator and use fixnan to fix this issue, the plot code look like this :
plot(a,color=fixnan(a>a ?lime:a 4000 ? 1 : 0
b = sma(a,length)
plot(a),plot(b)
The time it takes to the filter to get to the maximum value of the step function will tell you about its reactivity while seeing if the filter exceed the maximum value of the step function will tell you about its overshoot response, after an overshoot the filter can also go back under the step function, this is an undershoot, there are also tons of other things about the step response like ringing, but some only happen with recursive filter like the ema.
In order to check for smoothness against another filter you can use this code :
a = abs(change(filter1))
b = abs(change(filter2))
If you see that filter 1 have overall greater values than filter 2 it means that filter 1 smooth less.
Estimate A Gaussian Filter
You don’t really need fancy math’s to make a gaussian filter, the central limit theorem will help you estimate it just fine. A gaussian filter is a filter which impulse response is a gaussian function (bell shaped curve), a gaussian filter can be approximated with this code :
a = sma(sma(sma(sma(close,length/4),length/4),length/4),length/4)
In short the more sma function you add the better the estimation.
Some Other Tips
You can declare a float by using 0. instead 0.0
You can find the average highest frequency of a signal a with :
b = a > a and a < a or a < a and a > a ? 1 : 0
c = 1/(cum(b)/n) * 2
Learn all the shortcuts, some in mac :
cmd + enter = add to chart
cmd + i = new script
cmd + click on a function = display the reference manual of the function
Double click on one indicator line will display its settings window.
Know some maths, its not a requisite but it sure help.
And finally work and share with a group, its not something that i did but the truth is that it help a lot.
Final Words
I can’t cite all the person i want to thanks, there are to many, but without support its hard to improve, so thank you all. If this article helped you in any way then i’am more than satisfied. Oh and if you want to thanks and support me for all those years just use, change, improve and learn from my indicators as well as sharing your work or knowledge and have a lot of fun, that’s all i want.
Lets conclude this adventure with the memorable thanks for reading !
Week in Review: All of Old. Nothing Else Ever. Except Sometimes.First Off
If you enjoy these weekly publications and would like to keep up-to-date with the latest and greatest scripts, share this article and follow me on TradingView.
No Turning Back Now
Last week the TradingView community made an effort to publish some high-quality, open-source studies and strategies for everyone to benefit from, which in turn required from me a better quality articles on the week. This seemed to be a popular decision and (hopefully) better sponsors the script that I discuss.
This week I’ll try to do more of the same, but in order to improve I’ll need some input from the readers. So please, if you have any suggestions on how to improve these articles, don’t be afraid to express them either in the comments or via a direct message.
In this Week’s Charts
Let’s first mention MichelT’s “Average True Range in pine”. Although the function for the atr() is already available in Pine, it’s handy to understand the math behind the function should you need to circumvent some error messages that TradingView is giving you when using the built-in atr(), or if you wish to modify the formula to fit another purpose.
Speaking of changes to fit another purpose, jaggedsoft’s “RSX Divergence - Shark CIA” takes everget’s “Jurik RSX” and modifies it to include divergences, the code of which was snipped from Libertus’s “Relative Strength Index - Divergences - Libertus”. This implementation calmly spots meaningful anomalies between price action and the oscillator in question.
everget himself was relatively prolific this week, doing what he does best and adding to the open-source repository of moving averages available on TradingView (a repository that he’s had a heavy hand in establishing). This week he’s gifted us the “McNicholl Moving Average”, developed by Dennis McNicholl, as well as the “Quadruple Exponential Moving Average” and the “Pentuple Exponential Moving Average”, both developed by Bruno Nio. It’s great to see him publishing open-source work again and hopefully this continues into the future.
And Left Out of Last Week’s Charts
Last week was probably a more appropriate time to include them, but, alas, I had a (major) oversight. So allow me to give a quick introduction to puppytherapy through the two scripts published in the last week, “APEX - ADX/ADXR/DI+/DI- ” and “APEX - Moving Averages ”. Both are insightful compositions on how to get the most from simple indicators. I look forward to seeing more of his work (and I’ll try, in future, not to disclude good work like what he put out last week)
Milk it for What it’s Worth
I mean, who doesn’t enjoy seeing people apply simple methods to maximum effectiveness? Much like puppytherapy , nickbarcomb’s (a joke some of my Northern Irish friends would appreciate) “Market Shift Indicator” could be a lesson to a lot of us on how to get more from our moving averages and I’ll certainly be applying some of his concepts to develop prototypical signal systems with moving averages in the future.
Someone who’s concepts I’ve borrowed from before with great success is shtcoinr , a user who, along with many others, has appeared regularly in this series. A master of compiling simple and effective S/R indicators (something that was a bit of a mystery to the TradingView community for a while), shtcoinr has done it again with his “Volume Based S/R”, a S/R indicator that paints boxes according to volume activity, and “Grimes Modified MACD Supply Demand”, a modification of his “RSI-Based Automatic Supply and Demand”. shtcoinr has hopefully exhibited to the TradingView community that one can derive S/R areas with almost anything.
Another regular who’s recently released a few scripts that render S/R is RafaelZioni . This week he published his “Hull channel”, which is a creative use of the Hull MA and ATR. Like many of his past scripts, there’s a trove of helpful information buried deep in the code of his work, so don’t hesitate to get your fingers dirty. You’ll likely learn some very helpful things.
Nice to Meet You
Let’s go over some new faces this week, many of whom have brought something genuinely new to the TradingView community.
When I say new faces, I mean new to the series of articles, as many of you are likely very familiar with the psychedelic and, at times, enigmatic work of simpelyfe . This week he released two highly creative, open-source scripts that can have a number of applications; his “Randomization Algorithm ” (which returns a number between 1 - 10 and is a nice alternative to RicardoSantos’s “Function Pseudo Random Generator”) and his “Pivots High/Low ” (with a bit of tinkering this might have an application in automatically painting trendlines). It’s great to see how he does some of his wonderful work and I’ll definitely be following him closely in the future with the hopes of improving my own work.
westikon’s “Time Volume Accum” is (as far as I know) another new indicator to the TradingView community. Unfortunately the very short description is in Russian (I think) and I’m not too sure in what capacity this is supposed to be used, but I’m always looking to get new perspectives on volume and I’ll be studying this idea to do just that.
RyanPhang , also partial to speaking a language I don’t understand, has created , which roughly translates to “Volume drives ups and downs”. Again, not too sure what ideas or systems this pertains to, but (for me anyway) it’s, again, a new way of looking at something old.
Another volume indicator with the bunch is “Better X-Trend / Volume”, published by rimko . This is an iteration of emini-watch’s Better Volume indicator, which is available for purchase through his website. Due to the fact the TradingView doesn’t allow one to glean tick volume, this is as much fidelity rimko can show to the original as possible. Hopefully this will change in the future.
mwlang published “John Ehlers Universal Oscillator ” this week. The purpose of this release was to fix “a degrees to radians bug in LazyBear’s version” of the indicator, something I’m sure Ehlers’ fans will be thankful for.
Call Security
One of the benefits of using TradingView is having access to a wealth of data, but being allowed access to it is not the same as knowing how to get access to it, and even further from getting the most out of it. kishin’s “Mining Cash Flow Line” takes data from Quandl, does some mathemagic and spits out the price that it costs to mine Bitcoin. Knowing how to utilise this kind of data in the future will likely help to seperate the men from the boys, so it’s important we come to understand and learn how to apply it as a community in order to keep our head above water. kishin’s script leads the open-source foray into this unchartered TradingView territory.
Another user that’s made some great use out of Quandl data is deckchairtrader . This week they published “Deckchair Trader COT Index”, “Deckchair Trader COT MACD” and “Deckchair Trader COT Open Interest”. As it was in the paragraph above, this isn’t simply a matter of relaying the raw data from Quandl, but requires running it through a couple functions to get the final result. This is also one of the few scripts that performs fundamental analysis on TradingView.
Do you know what the maximum amount of securities you can call is? It’s 40. Just ask danarm , who’s “Aggregate RSI”, “TDI on Top 40 Coins” and “Top 5 coins cummulated Upvol/Dnvol and Money Flow” (r/increasinglyverbose) call on many securities. Each one can give good insight into the market breadth of any give move and each one invites the user to consider ways they might use the security() function.
At It Again
No doubt you know who I’ll be focusing on this week and regular readers are probably wondering, “where is he?”. But before I start (it’s dasanc by the way), let me say this: since the start of this month to the date-of-writing (27/02/2019) dasanc has published 20 open-source indicators, with (as far as I can count) fifteen of them being completely unique. Most of them are the work of the highly-renowned technical analyst John Ehlers, someone who many, if not all, algo traders are aware of. With four new open-source scripts under his belt from the past week, two of them unique, I feel justified in more thoroughly looking at dasanc’s work.
First off we’ll look at the “Bitcoin Liquid Index”. This is a script calling from the tickers that compose the BNC Index. If you’re a TradingView user that doesn’t have a PRO account, but that does want a “fair” price for BTC, this script can help you achieve exactly that. They’re not the exact same, but they’re very close (as the below screenshot shows).
The “Stochastic Center of Gravity” is dasanc’s stochastic translation of of Ehlers CG indicator. On the page for the indicator he’s provided a link to the paper that discusses it. As dasanc mentions, it’s reliability as a trading indicator is a kind of questionable that TradingView’s backtester doesn’t have the resources to answer. It doesn’t fit BTC on the daily, as you can see below (green line = buy, red line = sell).
“Fisher Stochastic Center of Gravity” simply runs the “Stochastic Center of Gravity” through a fisher transform, the result of which are smooth, filtered signals.. (As a sidenote, transforming data through a fisher transform, or some other transform, is applicable to many different indicators.)
To use the “Fisher Stochastic Center of Gravity” dasanc suggests first defining the direction of the trend. How do we do that? Luckily he’s provided an open-source method for us to do that called the “Instantaneous Trend”. (By the way, if someone says iTrend to you, they’re not talking about trading software released by Apple, they’re talking about the Instantaneous Trend by John Ehlers). The iTrend is a “low-lag trend follower for higher timeframes”.
Want to learn?
If you'd like the opportunity to learn Pine but you have difficulty finding resources to guide you, take a look at this rudimentary list: docs.google.com
The list will be updated in the future as more people share the resources that have helped, or continue to help, them. Follow me on Twitter to keep up-to-date with the growing list of resources.
Suggestions or Questions?
Don't even kinda hesitate to forward them to me. My (metaphorical) door is always open.
Profile’s of Mentioned
MichelT: www.tradingview.com
Libertus: www.tradingview.com
jaggedsoft: www.tradingview.com
everget: www.tradingview.com
puppytherapy: www.tradingview.com
nickbarcomb: www.tradingview.com
shtcoinr: www.tradingview.com
RafaelZioni: www.tradingview.com
simpelyfe: www.tradingview.com
RicardoSantos: www.tradingview.com
westikon: www.tradingview.com
RyanPhang: www.tradingview.com
rimko: www.tradingview.com
kishin: www.tradingview.com
deckchairtrader: www.tradingview.com
danarm: www.tradingview.com
mwlang: www.tradingview.com
LazyBear: www.tradingview.com
dasanc: www.tradingview.com
Week in Review: Chipper CodersFirst Off
If you enjoy these weekly publications and would like to keep up-to-date with the latest and greatest scripts, share this article and follow me on TradingView.
*sigh*
The TradingView community has been, unfortunately for me, very busy this week publishing useful indicators. Due to this, it wouldn’t be right to just glaze over everyone, so this week will be a little extended, taking a slightly deeper look at some of the work published and by who it’s published. I’ll still focus in on the coder that has, in my opinion, done the highest quality work. That aside, there’s no order.
Water, Water, All Around...
Someone (or some people) that’s no stranger to TradingView is BacktestRookies , who’s articles on their website have helped many budding Pine scripters. This week they published an indicator called “Volume Profile:Intra-bar Volume”. Through a function to loop, it looks at the close of lower timeframes and stores the volume as buying volume if the lower timeframe candle closed up, or selling volume if it closed down. This is as close as we can get to identifying volume flow imbalances without order flow data, but it’s not quite there (through no fault of its own). One issue I noticed was that during the current chart’s period the volume bars will stop updating volume and will only render it properly when current chart’s period finishes. This makes it difficult to use it within a trading system (as far as I can see)
Sticking with volume, mjslabosz has created “Volume+ (RVOL/Alerts)”, which is a relative volume indicator. Relatively simple, but highly applicable in volume studies. mjslabosz has also allowed the user to select what criteria needs to be met for the volume bars to be highlighted. No doubt this will be a useful addition to many people’s ideas.
Spiralman666’s “ETH HawkEye Aggregated Volume Indicator” takes NeoButane’s “Aggregated ETH Exchange Volume” and combines it with LazyBear’s “HawkEye Volume Clone Indicator”. This will give you an in-depth yet holistic overview of Ethereum’s volume. The concept can be extrapolated to other assets for volume analysis strategies.
… And Not A Drop To Drink
One issue I have with many reversal identification scripts is that they identify the conditions for a reversal as an instance as opposed to a zone or area. LonesomeTheBlues “Divergences for many indicators V2.0” attempts to rectify this by plotting reversal conditions as a line from one point to another, thereby giving you a zone/area from within which to take reversal trades should other conditions be met. The user has the option to choose from a range of indicators with which to identify reversals.
Lines In The Sky
Another familiar face to TradingView, and someone who constantly brings something new to the community, is alexgrover . This week he published a “Light LSMA” script. Rather than try and rehash the brilliant explanation he gave on it’s construction, I encourage you to visit his profile and view the trove of high-quality work he’s provided.
Peter_O’s “EMA NoHesi - cutting noise in EMA and any other data signals” (rolls of the tongue, eh?) is a function to remove noise from indicators that use lines, like MA’s, RSI, MACD etc. The function will guide the line in the same direction unless there is a significant change is the price. The script could be improved to automatically calculate the hesitation value based off what asset you’re trading, but that doesn’t take much away from it.
The “Multi Timeframe Rolling BitMEX Liquidation Levels” by cubantobacco allows users to gain insight into where a lot of liquidation may lie for BitMEX and where price may have to go to keep cascading in that direction. Combining this with some kind of sentiment index for Bitcoin can give great insight into what levels will cause huge reactions. In general the TradingView community can’t seem to get enough of tools for trading on BitMEX, so I’m sure this will see use.
Last of the lines, shtcoinr’s “The Center”, which was inspired by half a sentence from Adam H. Grimes, takes the high and low of the higher timeframe, divides it by half and then plots the halfway line. The result is a line that hints at the prevailing trend, can act as a momentum indication (by measuring the distance of the line from the price) and acts as a line of support and resistance.
Busy Bees
Two people were very active in producing high-quality work this week. The first I’ll mention is RafaelZioni (who’s been included in the previous two articles). He’s published five scripts this week, with one of them being a simple “5 min volume scalper” with alertconditions() that buy and sell based off volume activity. Another script with alertconditions() for buying and selling is his “Keltner Channel signals”, which is just an alteration of puppytherapys “Keltner Channel - APEX”. It also includes support and resistance levels. “linear regression new” and “BollingerRS” apply the same concept, with “linear regression new” being an attempt to render a linear regression channel (something that TradingView should really provide for us, along with the volume profile formula). Last but not least is RafaelZioni’s “Linear regression slope as SAR”, which is a creative alteration to the standard PSAR.
The other busy bee this week was xkavalis , who published three interesting scripts. The first was “Dynamic Price Channels”, which divides the price action into equal channels. When I first seen it I thought that maybe it could be a component for a volume profile overlay (combined with some other features). The “Manual Backtest Lines” can be used within another indicator for replaying price action and results. (He’s actually looking for a fix for a couple of issues, so if you think you can help him out, shoot him a message). “ATR SL Visualization (on chart)” plots appropriate stoplosses and take-profits for each bar (should you enter a trade on that bar) automatically and is, yet again, another script that would be a useful component within a strategy.
Expect More of the Same
The user I’ll be focusing on this week is dasanc , someone who’s been focused on in the past. It’s difficult not to shine the spotlight on him when he’s pumping out truly empowering ideas.
Last week dasanc published “Decent Martingale Strategy ”, which was inspired from a script with a similar name by RicardoSantos . Although it’s not ready for use in trading, it gives good insight into how to code strategies (although until TradingView’s backtester is suped up a little, backtesting doesn’t really mean anything in most cases, so don’t get too excited at those results)
The “Signal to Noise Ratio [SNR}” by dasanc gives traders confidence that the signal being fired isn’t just a stray note in a noisy market, but a meaningful one.
Keeping with Ehlers, dasanc has also published the “MESA Adaptive Moving Average”, which, rather than being a copy of the indicator, is, as dasanc puts it, a translation. His iteration seems to signal a period earlier than other versions without introducing any lag, due to how it’s calculated.
Following from the “Interquartile IFM” and the “Cosine IFM”, we now have the last of Ehlers IFM bunch, the “Robust Cycle Measurement”. This is similar to it’s cousins in that it outputs an adaptive period, but the output of this script is usually higher than it’s two cousins. I’ll definitely be including it in some of my future creations.
Last but certainly not least is dasanc’s “Multi-Instantaneous Frequency Measurement”, which is a script combining all three of the IFM’s that have been published, as well as the Hilbert Transform.
Quick Mention
I would just like to give nilux a shout-out for turning more than a handful of studies into their strategy counterparts. A lot of people seem to have trouble wielding the power of strategies and I’m sure many would learn something from studying his.
Also, look at this almost-2000 line script that shtcoinr called “... longer than the bible”:
Want to learn?
If you'd like the opportunity to learn Pine but you have difficulty finding resources to guide you, take a look at this rudimentary list: docs.google.com
The list will be updated in the future as more people share the resources that have helped, or continue to help, them. Follow me on Twitter to keep up-to-date with the growing list of resources.
Suggestions or Questions?
Don't even kinda hesitate to forward them to me. My (metaphorical) door is always open.
Profile’s of Mentioned
Dasanc: www.tradingview.com
RafaelZioni: www.tradingview.com
xkavalis: www.tradingview.com
nilux: www.tradingview.com
Spriralman666: www.tradingview.com
shtcoinr: www.tradingview.com
BacktestRookies: www.tradingview.com
alexgrover: www.tradingview.com
Peter_O: www.tradingview.com
TheViciousVB: www.tradingview.com
cubantobacco: www.tradingview.com
LonesomeTheBlue: www.tradingview.com
mjslabosz: www.tradingview.com
Mission Statement for the "- in Review" seriesI'm not sure of the exact figures, but I think TradingView has about 7M+ users. That's 7M+ people working towards the same end. 7M+ people with insights and ideas. 7M+ people with access to an in-house programming language tailored for trading and technical analysis. Yet despite this there's only a small, mumbling community for discussing Pine, trading and how to bring them together.
A few people have endeavored to change this and I'd like to play my part. So I'm going to begin publishing a series of articles through TradingView that will try to bring light to the secretly-active Pine community. The three titles I suggest will be: (1) "Week in Review", (2) "Coder in Review" and (3) "Script in Review".
One of the reasons I want to do this is because I think it's incredibly difficult for new users to get recognition for their brilliant work due to the current TradingView search system being an echo-chamber. Those with the most followers get the most views and the most likes and then more followers and more views and... LazyBear, a cherished asset of the TradingView community, is all some people will know and search for. This can be disastrous for building a lasting community around Pine and for developing your own concepts around trading. So I want to give more exposure to those who publish now so that we can all have the opportunity to be involved in conceptual progress. Hopefully in due time TradingView will revamp their search engine. Most popular scripts of the week/month/year would be a start, but I'm sure more could be done.
The articles written will never be defamatory or provocative. I don't want to rouse spirits, but focus minds. In that same vein, I will never shill someone's profile or scripts. All choices will be mine alone (unless I can poll effectively and transparently) and, as such, will have my biases (unless others join me in this effort)
Week in Review
Every Tuesday I'll pore through the scripts that have been published in the last week and select one for review, once it meets the minimum criteria. The criteria for being considered is: (A) for the script to be open-source and (B) not to be a direct copypasta-job from another coder. There's nothing wrong with using something not made by you to help you create something better though, but there has to be obvious improvements made from the original.
The script reviewed is meant to be my pick-of-the-bunch, but that is by no means an ultimate opinion. Some qualities that I'll most likely be looking for are: (A) creativity and innovation; just do as Ezra Pound did and "Make it new!", (B) usefulness: it can either be useful in it's own right, or it can be useful when used as a component within another script; both will be considered, neither will be favored and (C) a decent description of what it's supposed to do or how it's supposed to be used. Clean charts are a plus too: you only need the indicator you're publishing on the chart most of the time.
Aside from the script, there will be a brief mention of the programmer and their body of work.
Coder in Review
This is where I'll look over the portfolio of a user on TradingView and comment on their body of work, some of their best (my favorite) scripts and how they've helped the community to grow as a whole. The criteria for being considered are: (A) must have an account for over six months and (B) must have published at least ten scripts.
These won't be published regularly (at least not at the start), so I'll just push them out when I get the itch. From referencing so much of RicardoSantos' work in my initial builds, I felt indebted enough that I wanted to write him an essay explaining my thanks. I've since had that feeling for a lot of programmers. Some qualities I'll be looking for will be: (A) breadth of analysis and (B) efficient code.
Script in Review
Some weeks we're going to have a handful of top-notch scripts, most which we don't want discluded from the narrative. So in order to accommodate for them there'll also be a "Script in Review" thread of articles. This will also give me the opportunity to discuss scripts that were published a long time ago. Criteria to be included will be the same as the "Week in Review" selection. Like the "Coder in Review", these won't be regularly publications for the time being, but may become so in the future.
Disclaimer
I'm going to talk about scripts and programmers that I like, but that is by no means an endorsement. If someone I talk about sells products or services, I do not want you to make a decision to engage with their products or services based on my opinions. I'm not selling anything or trying to get you to buy something. I just want to open up the discussion about Pine and bring together a community of like-minded people.
Want to learn?
If you'd like the opportunity to learn Pine but you have difficulty finding resources to guide you, take a look at this rudimentary list: docs.google.com
The list will be updated in the future as more people share the resources that have helped, or continue to help, them. Follow me on Twitter to keep up-to-date with the growing list of resources.
Suggestions or Questions?
Don't even kinda hesitate to forward them to me. My (metaphorical) door is always open.
New Video Tutorials - Coding Custom Indicators - Ask Questions!I am currently recording a Video Tutorial Series on PineScript...Creating Custom Indicators.
ASK QUESTIONS BELOW....QUESTIONS WILL BE ANSWERED IN ON-GOING VIDEO SERIES.
Each Video will be 10 Minutes in Length, Covering a Specific Topic.
I will Start By Taking A Common Indicator Like the MACD and Starting From The Very Basics, Then Adding In All Customizable Options.
Topics Include:
- The Basics You Need To Know.
- Available Reference Materials.
- Creating Custom Colors Based On Conditions.
- Changing Bar Colors Based On Conditions.
- Using Multi-TimeFrames.
- And More...
We Will Have Guest Appearances From Some Of The Top Coders On TradingView Showing Advanced Techniques!!!
We Will Also Cover Other Types Of Indicators!!!
ASK QUESTIONS BELOW...ANYTHING REGARDING CODING IN PINESCRIPT.
QUESTIONS WILL BE ANSWERED IN VIDEO SERIES.
New Donchian Channels Modified_V2 With Alert CapabilityBelow are links to 2 updated indicators with Alert Capability...
***This Indicator was created by user Request to Add Alerts Capabilities for Donchian Channels.
New Features:
***Alerts Work - Ability To Create Alerts From Main Indicator.
***Can Also Be Used In Conjunction with Lower Indicator - CM_Donchian Channels Modified_V2_Lower_Alert
***Added Ability To Turn On/Off Highlight Bars.
***Added Ability to Turn On/Off Donch Channel Midline
***Added Ability to Turn On/Off Triangles That Plot At Top and Bottom Of Chart When Breakout Condition is TRUE.
Special Indicator Features:
***Ability To Use Different LookBack Period on Upper and Lower Donch Channel Lines.
How To Create Alerts:
***Create Alert by selecting Indicator - Either the name of the Upper Or Lower Indicator...
***Then select either Alert Breakout Upside or Downside(To The Right Of Indicator Name)
***Select Greater Than
***Select Value
***For Value put .99
Original Post Explaining Indicator is -
***If You Need Help Getting Custom Indicators to Trigger Alerts then View This Post.
Famous Filtered Pivots Indicator - Many Time Frames Available!!!CM_Pivot Points_M-W-D-4H-1H_Filtered
***Special Thanks to TheLark...AKA...The Coding Genius For Providing His Expertise...
***New Feature - Ability to turn On/Off Pivot Moving Average
***New Feature - Ability to turn On/Off Filtered Pivots (Explained Below)
Available Timeframes (Change In Inputs Tab):
1 Hour
4 Hour
Daily
Weekly
Monthly
Yearly
***All Features Available in Inputs Tab
-Ability to Plot just 1, or all Pivot Timeframes
-Defaults to Monthly Pivots
-Ability to turn On/Off Pivot Moving Average
-Ability to turn On/Off Filtered Pivots
-Ability to Plot S3 and R3 on 1 Hour and 4 Hour Pivots
***FILTERED PIVOTS!!!
-THIS IS A WAY TO FIND THE HIGHEST PROBABILITY MOVES
-IF CURRENT PIVOT IS GREATER THAN PREVIOUS PIVOT (INCLUDING MARKET THRESHOLD CALCULATION) THEN PIVOT, S1, & R2 PLOT
-IF CURRENT PIVOT IS LESS THAN PREVIOUS PIVOT (INCLUDING MARKET THRESHOLD CALCULATION) THEN PIVOT, S2, & R1 PLOT
-***THIS IS A WAY TO FILTER OUT PIVOTS AND ONLY PLOT THE LEVELS THAT ARE EXPECTED TO BE MAJOR SUPPORT AND RESISTANCE
***VIDEO COMING SOON WHERE i WILL GO OVER IN DETAIL THE THOUGHT PROCESS AND METHODOLOGY
Link To Code Below Under Related Ideas
New Pivot Bands Indicator W/ Link To Video Explaining Features!CM_Pivot Bands V1
Special Thanks to Michael S for Introducing Code.
Instead of a Long Write Up I Recorded A 8 Minute Video Going Into Detail On V1 Of This Indicator. Please View To See My Initial Findings, My Thoughts For V2, And Items I Need YOUR Help With!!!
In Inputs Tab Indicator Has Ability to Turn On/Off Multiple TimeFrames…Thought Process Explained In Video.
Link To Video:
vimeopro.com
Link To PDF Mentioned In Video:
d.pr
Pivots Indicator - I Made A Living Trading This System For 2 YrsCustom Pivots Indicator - Plots Yearly, Quarterly, Monthly, Weekly, and Daily Levels.
For 2 years I traded this system Exclusively and made a nice living. The reason I created this indicator Vs. the one on TradingView is mentioned in the last line on the first post.
See First Post For Details….