N Bars Down Backtest Evaluates for n number of consecutive lower closes. Returns a value
of 1 when the condition is true or 0 when false.
WARNING:
- For purpose educate only
- This script to change bars colors.
Backtest
Key Reversal Up Backtest
A key reversal is a one-day trading pattern that may signal the reversal of a trend.
Other frequently-used names for key reversal include "one-day reversal" and "reversal day."
How Does a Key Reversal Work?
Depending on which way the stock is trending, a key reversal day occurs when:
In an uptrend -- prices hit a new high and then close near the previous day's lows.
In a downtrend -- prices hit a new low, but close near the previous day's highs
WARNING:
- For purpose educate only
- This script to change bars colors.
How To Set Backtest Time Ranges
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 ':1234567' for time ranges on weekends. Thank you both!
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 understood that this is for research purposes only and I am not responsible for any financial losses you may incur by using this script!
Key Reversal Down Backtest A key reversal is a one-day trading pattern that may signal the reversal of a trend.
Other frequently-used names for key reversal include "one-day reversal" and "reversal day."
How Does a Key Reversal Work?
Depending on which way the stock is trending, a key reversal day occurs when:
In an uptrend -- prices hit a new high and then close near the previous day's lows.
In a downtrend -- prices hit a new low, but close near the previous day's highs
WARNING:
- For purpose educate only
- This script to change bars colors.
BEST Supertrend StrategyHello traders
Sharing a sample Supertrend strategy to illustrate how to calculate a convergence and using it in a strategy
I based the setup as follow:
- Entries on Supertrend MTF breakout + moving average cross. Entering whenever there is a convergence
- exit whenever a Simple Moving Averages cross in the opposite direction happen
- possibility to filter only Longs/Shorts or both
All the best
Dave
BEST Trend Direction Helper (Strategy Edition)Hello traders
A follower asked me to convert my Trend Direction Helper into a strategy
So blessed this indicator reached the 1400+ likes milestone - I can't believe how many people are trading with it
I based the setup as follow:
- Entries on those green/red labels
- exit whenever a Simple Moving Averages cross in the opposite direction happen
- possibility to filter only Longs/Shorts or both
Also...
The strategy includes the Zig Zag/Pivots high/low and other options from the indicator version. I only added a quick strategy component with a hard exit concept based on SMA cross
All the best fam and... HAPPY NEW YEAR !!!!!!!!!!!
Dave
Expert studio strategy 1 - GBPUSDThis is part of a series of strategies developed automatically by a online software.
I cannot share the site url, which is not related to me in any way, because it is against the TV reules.
This strategy was optimized for GBPUSD, timeframe 1D, fixed lots 0.1, initial balance 1000€.
LOGIC:
- LONG ENTRY when previous candle is bear
- LONG EXIT: RVI > signal line
- SHORT ENTRY when previous candle is bull
- SHORT EXIT: RVI < signal line
NOTE: I considered the open of actual candle instead of close otherwise there will be a back shift of 1 candle in pine script
Take profit = no
Stop loss = no
I have also a study with alarms.
Please use comment section for any feedback.
Combo Backtest 123 Reversal & D_DSP (Detrended Synthetic Price) This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
Detrended Synthetic Price is a function that is in phase with the
dominant cycle of real price data. This DSP is computed by subtracting
a half-cycle exponential moving average (EMA) from the quarter cycle
exponential moving average.
See "MESA and Trading Market Cycles" by John Ehlers pages 64 - 70.
WARNING:
- For purpose educate only
- This script to change bars colors.
NoNonsense Forex - high timeframe trading absurd NON-REPAINTINGSome time ago I bumped into NoNonsense Forex - pretty good-looking course with well-designed videos, reasonable rules, etc. Nice explanatory videos, not selling anything, building indicators-only strategy. But there was one thing that really annoyed me - it was supposed to work only on Daily timeframe. What is the point in trading such high timeframe, if decisions changing market direction are playing out within 1 minute? What is the point in evaluating trades from 1994 if we are 25 years later?
Anyway, I have developed this strategy, which is:
- non-repainting
- not using trailing-stop
- not using any other known TradingView backtest bugs
And I'm showing it as an example of OVERFITTING. Backtesting results look absurd: 100% profitable. But if you change any of the many parameters in the Settings popup, they will turn into disaster. It means, the rules of this strategy are very fragile. Don't trade this! Remember about backtesting rule #1: past results do not guarantee success in the future.
I'm giving this strategy out with the source code. Feel free to do anything you want with it. But if you find parameters or modifications on, which allow profitable trading on lower timeframes, don't be shy, let me know :)
*********
Forex / Indices / Commodities traders who want to start AUTO-TRADING might want to take a look at "TradingConnector", which allows no-latency trades execution from TradingView to MT4/MT5.
SuperTrend BacktesterThis is a backtesting script for the famous Super Trend.
Features
- Custom Date Range
- Custom Targets and Risks
Requested by Dlatrella
How To Set Trade Dates
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 execute on desired dates.
Entering 0 in any of the date fields acts a wild card. Example -> Entry Year: 0 is "Every Year", Exit Month: 0 is "Every Month", etc.
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 understood that this is for research purposes only and I am not responsible for any financial losses you may incur by using this script!
How To Auto Set Date RangeExample 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 to 15min), you also increase the number of days traded. So you can not compare apples to apples for which period would yield best performance for your strategy.
By incorporating this code with your own strategy's logic (replacing buy and sell), it will allow you to compare results of different period backtests over the same duration of time.
Date Range: ALL uses entire history.
Date Range: DAYS uses number you set in # Days or Weeks
Date Range: WEEKS uses number you set in # Days or Weeks
Date Range: MANUAL uses manual dates you set in From and To fields
Much gratitude to @pinechrix for suggesting this improvement to me, and to @Gesundheit for pointing me in the right direction on the original example I published previously. Thank you both!
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 understood that this is for research purposes only and I am not responsible for any financial losses you may incur by using this script!
RePaNoCHa V4 [Backtest]This is the Backtest version of the previous one.
It's important to correctly set the "TICKS / PIPS CORRECTION" parameter in each different chart.
Enjoy!
Hull Trend with Kahlman Strategy BacktestA simple backtest version of a Hull Trend with Kahlman strategy
Combo Backtest 123 Reversal & Breakout Range Short This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
Breakout Range Short Strategy
WARNING:
- For purpose educate only
- This script to change bars colors.
Ema BacktesterA simple, but useful script for backtesting purposes. Find the optimal Settings for your strategy.
tips are always welcome at: 38uGQJDDZDL6wX48x4gYTccPeQ3ZHVYmY4 (btc)
I hope you enjoy the script :)
Combo Backtest 123 Reversal & Bill Williams. AO with Signal Line This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
This indicator plots the oscillator as a histogram where blue denotes
periods suited for buying and red . for selling. If the current value
of AO (Awesome Oscillator) is above previous, the period is considered
suited for buying and the period is marked blue. If the AO value is not
above previous, the period is considered suited for selling and the
indicator marks it as red.
You can make changes in the property for set calculating strategy MA, EMA, WMA
WARNING:
- For purpose educate only
- This script to change bars colors.
Smeared VCI BacktestThis is the strategy with backtest date range and trailing-stop / stop-loss for vitelot's Smeared VCI indicator:
Generalized SSL Backtest w/ TSSLStrategy with Backtest Date Range and Trailing-Stop / Stop-Loss for vitelot's indicator:
VP Backtester skeletonSimple backtesting skeleton script which uses ATR based stop & profit targets based on the no-nonsense forex way of trading
Commodity Selection Index Backtest The Commodity Selection Index ("CSI") is a momentum indicator. It was
developed by Welles Wilder and is presented in his book New Concepts in
Technical Trading Systems. The name of the index reflects its primary purpose.
That is, to help select commodities suitable for short-term trading.
A high CSI rating indicates that the commodity has strong trending and volatility
characteristics. The trending characteristics are brought out by the Directional
Movement factor in the calculation--the volatility characteristic by the Average
True Range factor.
Wilder's approach is to trade commodities with high CSI values (relative to other
commodities). Because these commodities are highly volatile, they have the potential
to make the "most money in the shortest period of time." High CSI values imply
trending characteristics which make it easier to trade the security.
The Commodity Selection Index is designed for short-term traders who can handle
the risks associated with highly volatile markets.
WARNING:
- For purpose educate only
- This script to change bars colors.
Backtest Larry Williams 9.1 ( exemplo) - JBBacktest simples para compra no rompimento do topo do primeiro candle que abre abaixo e fecha acima da ema de 9 periodos e venda no rompimento do fundo do primeiro candle que fecha abaixo da ema de 9
Three Outside Down Backtest This is a three candlestick bearish reversal pattern consisting of a bearish
engulfing pattern formed by the first two candlesticks then followed by a down
candlestick with a lower close than the prior candlestick.
WARNING:
- For purpose educate only
- This script to change bars colors.