Why is it ok to backtest on TradingView from now on!TradingView backtester has bad reputation. For a good reason - it was producing wrong results, and it was clear at first sight how bad they were.
But this has changed. Along with many other improvements in its PineScript coding capabilities, TradingView fixed important bug, which was the main reason for miscalculations. TradingView didn't really speak out about this fix, so let me try :)
Have a look at this short code of a swing trading strategy (PLEASE DON'T FOCUS ON BACKTEST RESULTS ATTACHED HERE - THEY DO NOT MATTER). Sometimes entry condition happens together with closing condition for the already ongoing trade. Example: the condition to close Long entry is the same as a condition to enter Short. And when these two aligned, not only a Long was closed and Short was entered (as intended), but also a second Short was entered, too!!! What's even worse, that second short was not controlled with closing conditions inside strategy.exit() function and it very often lead to losses exceeding whatever was declared in "loss=" parameter. This could not have worked well...
But HOORAY!!! - it has been fixed and won't happen anymore. So together with other improvements - TradingView's backtester and PineScript is now ok to work with on standard candlesticks :)
Yep, no need to code strategies and backtest them on other platforms anymore.
----------------
Having said the above, there are still some pitfalls remaining, which you need to be aware of and avoid:
Don't backtest on HeikenAshi, Renko, Kagi candlesticks. They were not invented with backtesting in mind. There are still using wrong price levels for entries and therefore producing always too good backtesting results. Only standard candlesticks are reliable to backtest on.
Don't use Trailing Stop in your code. TradingView operates only on closed candlesticks, not on tick data and because of that, backtester will always assume price has first reached its favourable extreme (so 'high' when you are in Long trade and 'low' when you are in Short trade) before it starts to pull back. Which is rarely the truth in reality. Therefore strategies using Trailing Stop are also producing too good backtesting results. It is especially well visible on higher timeframe strategies - for some reason your strategy manages to make gains on those huge, fat candlesticks :) But that's not reality.
"when=" inside strategy.exit() does not work as you would intuitively expect. If you want to have logical condition to close your trade (for example - crossover(rsi(close,14),20)) you need to place it inside strategy.close() function. And leave StopLoss + TakeProfit conditions inside strategy.exit() function. Just as in attached code.
If you're working with pyramiding, add "process_orders_on_close=ANY" to your strategy() script header. Default setting ("=FIFO") will first close the trade, which was opened first, not the one which was hit by Stop-Loss condidtion.
----------------
That's it, I guess :) If you are noticing other issues with backtester and would like to share, let everyone know in comments. If the issue is indeed a bug, there is a chance TradingView dev team will hear your voice and take it into account when working on other improvements. Just like they heard about the bug I described above.
P.S. I know for a fact that more improvements in the backtesting area are coming. Some will change the game even for non-coding traders. If you want to be notified quickly and with my comment - gimme "follow".
Backtester
Blackbox (Backtesting version)Blackbox Backtest version is a script with 12 built-in indicators, a list of different conditions you can check/uncheck to enter and exit the market on specific points and 3 different strategies styles.
Use this script to backtest different strategies.
It can't be used to create alerts.
If you found a good strategy and you want to do set alerts too you have to switch to Blackbox Alert version. It's the same script but without the strategy part.
Indicators:
Chaikin Money Flow
Chaikin Money Flow
Chaikin Oscillator
Volume Oscillator
Ichimoku Baseline
SSL
William R%
RSI
Bollinger Bands
ROC
RSI probability (custom)
EMAs
Aroon
ATR
... new indicators very soon
Conditions
Check/uncheck different conditions from setting panel for both entries and exits.
Combine them to create complex strategies and alerts.
This list is constantly updated.
Data Range
Set a data range to backtest.
From Year, Month, Day, Hour, Minute to Year, Month, Day, Hour, Minute.
Order size/settings
ATR Period
TP Multiplier (Used for Take Profit = ATR*TP Multiplier strategies)
SL Multiplier (Used for Stop Loss = ATR*SL Multiplier strategies)
Pips_tp Set a fixed amount of pips for your Take Profit level
Pips_sl Set a fixed amount of pips for your Stop Loss level
Select a strategy style
ATR as TP/SL
Fixed TP/SL
With Exit conditions
Stop Loss for exit conditions
Last update: 13/02/2020
Megalodon Pro Automated Trader BackTester
Why Megalodon?
We believe that enlightening others is an incredible way to make this world a better place. That's why we created the tools you need to stop worrying about your investments and focus on what really matters in your life.
What is Megalodon?
Megalodon uses Artificial Intelligence that combines 574 back-tested indicators and 2674 back-tested setups, simultaneously.
Megalodon works with any kind of asset , market state and time frame .
What is the win rate?
Megalodon is extremely accurate and offers insane profits as long as the fundamental analysis is done right .
Backtesting results can be found on our social media or down below .
How to use Megalodon Pro Automated Trader?
Simply, orange rectangles are buy signals and purple rectangles are sell signals .
Green clouds show buy signals and red clouds show sell signals.
Yellow line shows the difference between buy and sell counts.
How to set alarms on Megalodon Pro Automated Trader?
Click on Alert, select Megalodon Pro Automated Trader and click on Buy-Signal or Sell-Signal. More details can be found on our social media.
You may also watch our Megalodon Investing Tutorials on Youtube for more information.
How to purchase?
Megalodon is totally FREE .
You may upgrade to Megalodon Pro for the most important features , including automizing your trading on any asset profitably, setting up alarms to get notified , joining to our VIP telegram channel to get daily updates and our VIP telegram group to interact with the community. Simply go to our website on our TradingView page for learning more and joining us for free.
Some of the backtesting results are:
BTC/USD for longer time frame trading in the bear market for the last year.
APPLE for longer time frame trading in the bull market for the last 10 years.
EURO/USD for day trading in the neutral market for the last month.
BTC/USD for day trading in the bull market for the last 15 days.
APPLE for day trading in the neutral market for the last 2 days and 6 hours.
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
Jack MA Cross Backtester with TP, SL, TSLJack MA Cross is works based on a MA Crossover. What makes this script unique is the framework built behind it. With the ability of adding TP, SL, and TSL. It makes this script more advanced compare to other traditional MA Crossover scripts.
Will add more Moving Averages in the future, making this the Jack of all Trades .
To request a trial for this script, please PM me.
-----------------
Jack MA Cross V1.0.0
- Initial release
Power Penguin - Trend Trading Script BacktesterPower Penguin is a script that detects a trend and determines entry into the market based on the strength and price action.
Thanks to all my early backers for believing in my work!
This script is optimal for use in any market at this time.
To request a trial for this script, please PM me.
-----------------
Power Penguin V1.0.0
- Initial release
Crypto Reversal Scalper STARTER KIT BacktesterThis is a starter kit for people to try out.
Since many people were confused to how to properly config the original script, I decided to create this script.
This script uses the original script but is compiled to have presets.
Simple to use, EASY AS 1,2,3
1. Choose PAIR
2. Sync chart with chosen pair (Symbol and Timeframe)
3. DONE!
4. (Optional) Adjust Stoploss and Takeprofit
This will be FREE for people to consider giving it a try.
To automate the trades, you will need to have the alerts for the script.
If you want to automate the trades, PM me.
Omni Trader Accompanying Backtesting StrategyVersion 1.0
Purpose
This backtesting strategy indicator is a accompanying tool for use with my popular trading and alert indicator: Omni Trader | RMI EMA RSI VOL | Margin Focused Indicator
Reference Indicator Link:
Features
This strategy has been programmed to act exactly how the accompanying indicator would be used with an automated strategy such as Autoview or through manual trading
Has identical coloured signals with correct icons for reference with the indicators standard alert conditions (LONG/SHORT)
The ability to toggle on or off all the logic and UI presets you could previously use to enhance the standard indicator
Fully customisable in the settings regarding trading strategy to match exactly how you have the reference indicator set up with alerts or how you are trading manually with it.
Ability to choose a timeframe, want to ignore the crypto boom at the latter stages of 2017? Sure you can, change the time frames in the settings to see a more recent representation of your trades.
Stop Loss & Take Profit enabled in this back tester for fine tuning of your strategy, especially useful for automated users to refine the most profitable settings for your style.
Access
This indicator is free for existing owners of my Omni Trader | RMI EMA RSI VOL | Margin Focused Indicator linked above as an accompanying tool to improve their strategy and net more profit. If you would like access to any of my indicators or would like to know more please find me on my community discord channel where you can find indicator details/documentation and general help:
Discord Link: discord.gg
Thank you for the immense support everyone, happy trading!
- Falco