Bryan - Multi IndicatorCustom Indicator - Developed for a Backtest-Rookies customer and published for testing and acceptance.
Ichimoku + ADX combined indicator with custom entry criteria and plotting for buy signals.
Search in scripts for "backtest"
52 Week High/Low52 Week High / Low Indicator
A simple, unobtrusive indicator that can be used on any timeframe to display the 52 week high/low values.
Features
Works on any timeframe.
Unobtrusive: Simple horizontal lines showing only the current 52 week values.
Allows the user to select whether to calculate the 52-week values from candle close values or the respective highs/lows.
For full overview and code commentary - Visit the backtest-rookies website.
CB SDB HK VOL IndicatorIndicator version of designed for use with independent automation solution.
Custom development published for customer verification and acceptance.
If you are interested in development services, please visit the backtest-rookies website or message me to find out more.
CB SDB HK VOL Strategy Heikin-Ashi / Volume Filter Strategy
Custom development published for customer verification.
If you are interested in development services, please visit the backtest-rookies website to find out more.
Currency StrengthRepublished: The original script violated house rules by including an external link to Backtest Rookies.
Background
The currency strength indicator takes up to 4 forex pairs and calculates the average strength across all pairs. The indicator uses the pair's daily percentage change to calculate the overall strength. For flexibility, it can accept any instrument as an input. This means you can use multiple instances to track various currency strengths. It was designed with the major pairs in mind but there is no reason why it cannot be used for other FX pairs.
Note: The indicator defaults to GBP. When setting it up for other currencies, be sure to flag whether the currency is a counter currency or not.
The code is provided free and open source. Please modify it as you see fit.
Screenshots
Defaults with Annotation
Yen strength beating pound strength
Opposing Trends
Multi SMA'sRepublished: The original script violated house rules by including an external link to Backtest Rookies.
Background
This is a simple “multi” SMA indicator so that multiple SMA’s can be monitored whilst only using a single indicator slot. It also has a couple of features that let you mix time frames and de-clutter the chart.
The code is open for anyone to modify and a copy
About the Indicator
Although the indicator does nothing more than it says on the tin, There are a couple of points worth mentioning:
The indicator will let you view up to 4 SMA’s
You can set the period for each SMA independently
You can set the resolution for each SMA independently (So you can see the see the daily SMA level when on the 15-minute chart for example)
Each SMA can be turned on/off independently to avoid clutter.
Screenshot - Default Settings
Naresh - iJPASIMPORTANT NOTE
This strategy has been developed as a professional service. It was published only or testing and verification by the customer. As such, access cannot be granted to anyone else. Sorry about that!
Other open source scripts are available on the BacktestRookies profile.
Intra-day Japanese Candlestick Price Action Strategy
An intraday strategy which focuses on analyzing price action of the opening 3 bars to make trading decisions.
Once certain criteria are met, entry and exit targets are set and left until they are hit else we reset and start again on a new day.
Emmanuel - Squeeze StrategyPlease Read
This strategy has been developed as a professional service. It was published only or testing and verification by the customer. As such, access cannot be granted to anyone else. Sorry about that!
Other open source scripts are available on the BacktestRookies profile.
Squeeze Strategy
Entry Conditions: Undisclosed
Position Sizing: % Risk of Equity when stop loss is hit
Position Management: Take off 50%
Position Management: Move to break even
Exit Conditions: Undisclosed
Backtest Strategy Optimizer Adapter - Supertrend ExampleSample Code
This is a sample code for my Backtest Strategy Optimizer Adapter library.
You can find the library at:
Backtest Strategy Optimizer Tester
With this indicator, you will be able to run one or multiple backtests with different variables (combinations). For example, you can run dozens of backtests of Supertrend at once with an increment factor of 0.1, or whatever you prefer. This way, you can easily grab the most profitable settings and use them in your strategy. The chart above shows different color plots, each indicating a profit backtest equal to tradingview backtesting system. This code uses my backtest library, available in my profile.
Below the code you should edit yourself
You can use ChatGPT or write a python script to autogenerate code for you.
// #################################################################
// # ENTRIES AND EXITS
// #################################################################
// You can use the link and code in the description to create
// your code for the desired number of entries / exits.
// #################################################################
// AUTO GENERATED CODE
// ▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼
= ti.supertrend(10, 0.1)
= ti.supertrend(10, 0.2)
= ti.supertrend(10, 0.3)
= ti.supertrend(10, 0.4)
// 005 etc...
pnl_001 = backtest.profit(date_start, date_end, entry_001, exit_001)
pnl_002 = backtest.profit(date_start, date_end, entry_002, exit_002)
pnl_003 = backtest.profit(date_start, date_end, entry_003, exit_003)
pnl_004 = backtest.profit(date_start, date_end, entry_004, exit_004)
plot(pnl_001, title='0.1', color=backtest.color(001))
plot(pnl_002, title='0.2', color=backtest.color(002))
plot(pnl_003, title='0.3', color=backtest.color(003))
plot(pnl_004, title='0.4', color=backtest.color(004))
// Make sure you set the correct array size.
// The amount of tests + 1 (e.g. 4 tests you set it to 5)
var results_list = array.new_string(5)
if (ta.change(pnl_001))
array.set(results_list, 0, str.tostring(pnl_001) + '|0.1')
if (ta.change(pnl_002))
array.set(results_list, 1, str.tostring(pnl_002) + '|0.2')
if (ta.change(pnl_003))
array.set(results_list, 2, str.tostring(pnl_003) + '|0.3')
if (ta.change(pnl_004))
array.set(results_list, 3, str.tostring(pnl_004) + '|0.4')
// ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲
// AUTO GENERATED CODE
// #################################################################
QFL single TF with alertsBacktesting compatible QFL pine script w/alerts
This version of QFL was made based on this one:
From author:
www.tradingview.com
I made the following additions according to my requirements:
- I need to use pine script 4
- I needed to avoid repainting issues so I'm not calling directly security, I'm using the wrapper function.
- There might be still repainting issues when you use "max base age" which uses the function "barssince" so be careful, you can disable it by setting its value to zero.
- Alerts so I can use it for automated trading and bots
- In order to make this signal compatible with the backtest script there's an option provided in the settings. If you enable this option this indicator will plot 1 whenever there's a BUY signal. This will allow the backtest to pick the "QFL Buy" from external indicator so it can perform the backtest.
I recommend some of these settings to start playing with the chart in 15 min / QFL in 1, 2 or 4 hours.
The higher the TF the more conservative.
QFL with 3.5% is pretty popular but you can try higher QFL percentage settings for a more conservative approach.
Backtester UtilityLook ahead bias is the most evil bias responsible for overestimation of the performance of the trading system.
As the Bar replay feature is only available to paid users which is a great tool for manual testing of the trading system. Leaving other users prone to the evil of Look ahead bias.
So that I have developed this indicator which will help users to manually backtest the strategies.
This indicator hides the price action after specified date and time.
Here are the steps for using the indicator.
1) Hide your chart manually.
2) Plot the indicator.
3) Change the input of time and date after which you want to hide price action.
4) Change the script according to your trading strategy.
5) Enjoy the free of cost manual backtesting.
Good trading buddies !
Note : This post is only for educational purpose , it does not contain any financial advise.
Mosasaur Pro BacktesterBacktester indicator for Mosasaur ◬ | Comprehensive & Profitable Trading Setup Builder available for free here.
Scroll all the way down in the setting menu to adjust the backtesting strategy.
Current features:
Find out the backtesting results for your customized strategy.
Set alerts for strong buy, buy, strong sell and sell signals.
Option for waiting fractal candle stick pattern before entering or exiting.
All features and setups used can be found on this tradingview page.
This backtester has settings of:
Setting 1 lets user select the source for putting a buy order.
Setting 2 lets user select the source for putting a sell order.
Setting 3 defines how much percent user wants to risk per trade to buy.
Setting 4 defines maximum possible trades for buying.
Setting 5 lets user only buy with fractal bottom after a buy signal has been found.
Setting 6 lets user only sell with fractal top after a sell signal has been found.
Setting 7 lets user only buy if the pre defined time period has elapsed on the chart.
Setting 8 lets user only sell if the pre defined time period has elapsed on the chart.
Setting 9 lets user only buy with a strong buy signal (orange color).
Setting 10 lets user only sell with a strong sell signal (purple color).
Setting 11 defines the time period to be elapsed to trigger a buy.
Setting 12 defines the time period to be elapsed to trigger a sell.
Upcoming features:
Advanced pre-defined strategies for user to select from. This will also auto adjust the setups and time frames being combined.
Stop Loss and Stop to Trailing options for the strategy.
Stop Loss and Stop to Trailing alerts.
Defining risk/reward ratio before entering the trade.
~Bo
Founder of Megalodon Indicators
Backtests Are BrokenThis script demonstrates a fatal flaw with Trading View backtests involving trailing stops. Trading View assumes the most optimistic case for trailing stops, always giving you the best case high/low of a bar instead of the worst or average case. Within a bar, the price could reverse against your position after the open and trigger your trailing stop for a loss before the price goes in your favor, but Trading View backtests do not consider this and instead always give you the best case returns. This allows a trivial strategy to appear as though it would perform miracles.
This strategy enters on a random bar and sets a trailing stop triggered one tick better than the current price with 0 trailing distance. Trading View then generously gives this strategy the difference between the open price and best possible wick as a profit. The only way this strategy can lose money in simulation is if the price goes straight down after entry and never retraces. It works on all symbols on all timeframes due to this systematic problem with the Trading View backtester.
Backtesting Period Selector | ComponentDescription
It's nice to quickly be able to set the backtesting period when writing strategies.
To make this process faster I wrote a simple 'component'.
So this is not a strategy but rather code you can plug-into your strategy and use
if you need that specific functionality.
Then it's just a matter of selecting which dates you want to backtest.
You can also chose to color the background to visually show the testing period.
Unfortunately, the background color is fixed at 'blue' for now.
Ps. I like the idea of writing small components to be pluged into other strategies
I'll try to develop this idea a bit further and see how small pieces of code can
easily provide specific functionality to assist and make deving strategies a bit less 'Pineful'.
Usage
First copy the instructed part of the component code over to your strategy.
Next, use the testPeriod() function to limit strategies to the specified backtesting period.
Example usage:
if testPeriod()
strategy.entry("LE", strategy.long)
Todo / Improvements
There are many ways to improve this component and I'm not a very good coder so this is a very crude solutions.
Anyway, here are some things which would be nice to improve:
1. Enable color selection so that the user can choose the background color of his own liking.
2. Improve naming of variables.
3. Test for ilogical choices, such as test period start being at a later date, than test period stop.
4. Account for time zones.
As always, any feedback, corrections or thoughts are very much welcome!
/pbergden
Bactest Period MarkerSimple script that will mark backtest periods (if you have to run backtests in multiple parts, like on CryptoTrader )
Backtesting 3commas DCA Bot v2Updating previously published simulated 3commas DCA logic with a sexier insert and more meaningful default parameters.
Backtest Signal To Noise This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
© HPotter 05/01/2021
The signal-to-noise (S/N) ratio.
And Simple Moving Average.
Thank you for idea BlockchainYahoo
WARNING:
- For purpose educate only
- This script to change bars colors.
Strategy - Backtest Uber Baseline [UTS]Backtesting of Uber Baseline
equity 50k
2% Risk
optimized on USD pairs
start year and month input
ATR based Stop-Loss
no trade on Overshoot Up/Down
no trade against the trend
---
DM / Tip / Subscribe for access
[BACKTEST]Traders Dynamic Index Indicator Alert by JustUncleLBy request, this script is a "strategy" version of my "Traders Dynamic Index Indicator Alert" script, made available for backtesting to help find optimal trade settings for a particular asset.
RSI Alligator Strategy [forked from jedireza]Backtester for RSI alligator is Williams Alligator strategy using Relative Strength Index to predict entries
Original script can be found at