Example how to set the time range window to be backtested for both entries and exits. Additional examples are also included showing how to set the date range and toggle plot visibility.
By incorporating this code with your own strategy's logic, it will allow you to backtest various time windows.
Much gratitude to @LucF and @a.tesla2018 for help with including...
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.
- 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...
This is an old and incomplete script that is being pulled up and dusted off as per request.
The sole purpose of this script was to provide code snippets allowing one to easily convert their own script/strategy to include incremental order sizes. More control over your pyramiding orders.
**It may repaint, and was not intended for trading but more as an attempt...
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...
An example of Binary Option Arrows (BOA) for candlestick patterns bearish and bullish harami.
With results as coloured background and an option to choose your expiration (one candle by default).
It's just an example for those who has their own strategy and wants to make nice arrows in their chart.
All you need to do is rewrite piece of script in lines 9:13 -...
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! ->...
Simple signals example for Risk Management Wrapper
The unique part is that there is a single variable used for both Buy and Sell conditions.
Technically, a variable can have an infinity of values, so why not use that in our favour.
A value of -1 is used for the SELL alert condition, and a value of +1 is used for the BUY alert condition.
The Risk Management...
Example how to backtest specific date(s) which can be useful for testing seasonality strategy ideas such as "Sell in May", etc.
If using Daily period with wild card dates it will not trade on 1st day of month. If market is closed will trade on next open day.
Works only with Daily or lower timeframes. When using on Daily timeframe set dates 1 day earlier to...
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...
Example how to automatically set the date range window to be backtested from X days or weeks ago to present. Additional options are also included to manually set the date range or to show entire range available.
Normally when you change chart period it changes the number of days being backtested, which means as you increase the chart period (for example from 5min...
BORC, or Breakout Reversal Confirmation, is a signal based TV Indicator that analyzes multi-period price movements to determine when to enter in oversold and overbought tradeable assets. It works in any time frame and any type of security.
Green triangle means buy
Red Triangle means to get ready for the buy signal
$20 for access, $40 for access +...
Pinescript v3 Compatibility Framework (v4 Migration Tool)
This code makes most v3 scripts work in v4 with only a few minor changes below. Place the framework code before the first input statement.
You can totally delete all comments.
- to port to v4 you only need to make a few simple changes, not affecting the core v3 code functionality
Example how to select and set date range window to be backtested. Normally when you change chart period it changes the number of days being backtested which means as you increas the chart period (for example from 5min to 15min) you also increase the number of days traded, so you can not compare apples to apples for which period would yield best returns for your...