Example of how to input multiple symbols at once using a CSV list of ticker IDs. The input list is extracted into individual ticker IDs which are then each used within an example screener function that calculates their rate of change. The results for each of the rate of changes are then plotted. For code brevity this example only demonstrates using up to 4...
An example of how to limit the input number of allowed signals using a function containing a condition counter with a reset.
As a colorblind trader, I think accessibility is a big deal. This script auto detects the chart background color and optimizes text color based on luminance. Luminance detection is based on pine script new chart.bg_color feature, allowing lines, tables, etc to be optimized. Thanks to TV team for releasing this in the latest update/blog post today! This makes it...
Looking into a question from user Alex100, i realized many people do want some kind of values displayed on chart when they hover the mouse over different bars. As pinescript does not have any feature like pop up box, the only way is to plot a line and than see indicator values at top left. So when mouse is moved around the value displayed changes. As we just...
I'm currently working on v5 of my Pine Script Programming Course. As a part of it, I'm building a few tools/widgets to help students get the content easier. Here is one of the tools. It's quite basic with it you can select a bar and see all the build-in variables for this bar (Except strategy variables) I hope it will help you in learning Pine Script! ...
The retracement tracker function(s) in this script outline how to: Track conditions using "toggle" booleans. Use multiple coinciding conditions to trigger an event just once. What is a retracement? "Retracements are temporary price reversals that take place within a larger trend. The key here is that these price reversals are temporary and do not...
This is an example of how to reference higher timeframe data without the need for a 'security()' call. I have attempted to create the function example: f_insecurity() with the purpose of wrapping up and pumping out all common relevent HTF price data that's needed for your everyday indicators in a reliable fashion.
This is a script written as an example of how to build a simple strategy with user-defined inputs based on a simple Moving Average crossover. -- This indicator is used for backtesting Moving Average crossover strategies (only for long trades). A "short" and "long" moving average period and calculation method (the "smoothing type") are user-adjustable. The...
This script extends my other two Array examples (which I've also provided to you open source): The Ticker-centric 5m,15m,45m,1h,4h,1d resolution labels using arrays: And the more Macro VIX,GLD,TLT,QQQ,SPY,IWM 1d resolution labels using arrays: This script aims to show how to use min/max/avg with Arrays easily. My next example after this will be exploring the...
Ever wish you didn't have to rapidly flip between 6 different tickers to get the full picture? Yeah, me too. Do you also wish that you kind of understood how the shift / unshift function works for arrays? Yeah, I did too. Both of those birds are taken care of with one stone! The Macro Consolidated Interval Display uses the new Array structure and security to...
Ever wish you didn't have to rapidly flip between 6 different intervals to get the full picture? Yeah, me too. Do you also wish that you kind of understood how the shift / unshift function works for arrays? Yeah, I did too. Both of those birds are taken care of with one stone! The Consolidated Interval Display uses the new Array structure and security to display...
This script illustrates how to create simple alerts, triggered by a share price moving above (or below) an arbitrary threshold.
Higher TimeFrame using custom source function for toggling traditional Candle sources or Heikin-Ashi sources on a traditional Candles chart. Thanks to PineCoders for rounding method: www.pinecoders.com Thanks to @LucF and @RicardoSantos for their advice and enlightenment as always. NOTICE: This is an example script and not meant to be used as an actual...
Example of various methods to show dashed or solid vertical lines on chart based on using either session or time. Credit for line method goes to midtownsk8rguy -> Credit for plot method goes to PineCoders -> www.pinecoders.com Special thanks to LucF, midtownsk8rguy, and PineCoders for permission to use their work. NOTICE: This is an example script and not...
Example how to limit the number of round trips per day. If entry condition is never met logic will force a round trip at end of day. Set chart to a timeframe that is lower than 1 Day period. NOTICE: This is an example script and not meant to be used as an actual strategy. By using this script or any portion thereof, you acknowledge that you have read and...
Custom source function for toggling traditional Candle sources or Heikin-Ashi sources on a traditional Candles chart. Thanks to PineCoders for rounding method: www.pinecoders.com Thanks to @LucF and @RicardoSantos for their advice and enlightenment as always. NOTICE: This is an example script and not meant to be used as an actual strategy. By using this script or...
Example how to overlay the first lower timeframe bar of the day across the entire day. Set chart to a timeframe that is lower than 1 Day period. Also included option for coloring wick pressure of that bar. NOTICE: This is an example script and not meant to be used as an actual strategy. By using this script or any portion thereof, you acknowledge that you have...
Example how to color patterns of 3 bodies growing or waning by percentage with or without trend. Also included option for alert triggers. The yellow triangles on the chart denote where the alert triggers will fire. • Choose Pattern Of Filter: shows bodies growing or waning or both. • Sample Lengths Of AvgBar: number of recent bars to use for average size. •...