Example how to color the trigger bar of the condition and n-1 prior bars using only 1 barcolor() function. Currently when offsets are used in barcolor(), bgcolor(), plot(), plotarrow(), plotchar(), or plotshape(), the offset only works with a simple (static) integer. If series (dynamic) integers are used instead, there is not an error, but the series values are...
This script is for a triple moving average indicator where the user can select from different types of moving averages, price sources, lookback periods and resolutions. Features: - 3 Moving Averages with variable MA types, periods, price sources, resolutions and the ability to disable each individually - Crossovers are plotted on the chart with detailed...
Simple script to view Heiken-Ashi candles below a normal candles chart. Could also be useful for using HA calcs in strategy scripts on normal candles chart for proper backtesting. I adapted this to v4 from original v2 script by @samtsui. If you like please remember to give him a Thumbs Up for his original version! ->
This script is for a triple moving average indicator where the user can select from different types of moving averages and periods. This script improves upon tutorial 3 by adding source selection for MAs and another option for an MA that is not built-in, the HMA . It is meant as an educational script with well formatted styling, and references for specific functions.
This script is for a triple moving average indicator where the user can select from different types of moving averages and periods. This script improves upon tutorial 3 by adding source selection for MAs and another option for an MA that is not built-in, the HMA. It is meant as an educational script with well formatted styling, and references for specific functions.
This script is for a triple moving average indicator where the user can select from different types of moving averages. It is meant as an educational script with well formatted styling, and references for specific functions.
This script is for a triple exponential moving average indicator. It is meant as an educational script with well formatted styling, and references for specific functions.
This script is for a simple moving average indicator. It is meant as an educational script with well formatted styling, and references for specific functions.
Example of how to apply and use Dynamic Zones with an indicator by injecting it's source into my adaptation of the original idea by Leo Zamansky, Ph.D., and David Stendahl. • Load your desired oscillating indicator on your chart (CCI, RSI, etc). • Load my "How To Use Dynamic Zones" indicator on your chart. • In the "How To Use Dynamic Zones" indicator settings...
Problem Pine's implementation of the security() function behaves differently in realtime vs. historical bars. Specifically, for historical bars, calling security() for a time frame (TF) larger/slower than the current chart's TF will return information about the last completed bar of the higher TF. However, for realtime bars (i.e. if you allow the chart to...
After a long gap, I have written the 5th tutorial for the pine script. You can find the others below, if you read through all of these you should be good to do your own writing. This script mimics the Trading View Indicator . For example this one below. www.tradingview.com It shows the net result of the 28 indicator, either as buy or sell. I...
I was curious to see what Pine uses to accumulate numbers. It looks like it uses the simple "add em up" approach, rather than a compensated summation. This means that especially for large numbers, there is an inherent error amount. This script implements the Kahan Summation Algorithm, also known as compensated summation. en.wikipedia.org This is part 2 of my...
While trying to figure out how to make the STDEV function use an exponential moving average instead of simple moving average , I discovered the builtin function doesn't really use either. Check it out, it's amazing how different the two-pass algorithm is from the builtin! Eventually I reverse-engineered and discovered that STDEV uses the Naiive algorithm and...
In this second tutorial we build upon the previous tutorial. We add color shading for each different day and highlight Wednesday. The idea here is to manually count if on Wednesdays close is bigger then open. Hope it helps. Feel free to comment. MartinMystere
If you are just like me and cant just get your head around pine script, I have created this simple code so you get the main concept. Unfortunately there are no good step by step tutorials out there teaching scripting. Hope this helps. Comments are welcome. MatinMystere
type: pine series basic example time required: 10 minutes level: medium (need to know the "array" data variable as a generic programming concept, basic Pine syntax) tl;dr how variables and series work in Pine Pine is an array/vector language. That's something that twists how it behaves, and how we have to think about it. A lot of misunderstandings come from...