OPEN-SOURCE SCRIPT

TEMA Cross +HTF Backtest

Updated
This is a follow up to a previous script release called "TEMA Cross Backtest".

This new strategy uses two TEMA crosses, one for trend direction, one for entry and exit. The entry and exit parameters are the same as the previous script. The trend direction is based on a user configurable higher timeframe TEMA cross which determines when to take longs or shorts. When the indicator is purple, it is looking for shorts, and when it is yellow, it is looking for longs. The background of the chart is colored accordingly to see the trend direction at a glance.

The default settings are the ones I have found produce the highest backtest results. The backtest is set by default to use a $500 account, and use $500 for every entry and exit, no matter the direction or overall profit/loss.

Parts of script borrowed from other public scripts.

Release Notes
Remove repaint using code from
How to avoid repainting when using security() - PineCoders FAQ
Bitcoin (Cryptocurrency)LONGMoving AveragesshortTriple Exponential Moving Average (TEMA)trendTrend Analysistripleema

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer