( FUTURE-LOOKING scripts know where it will go)

Pre-Amble

Many people can find strategies or indicators, that seem to give quite goo & profitable signals. However, non-technical people and novice traders doesn’t know the “dark” side of scripting, and they should know one detrimental thing if they want not to get misleaded. Please read this 2 min article.

PREDICTION-OF-FUTURE is acceptable, as opposed to KNOWING-THE-FUTURE ! ! !

Technically, there exist two kinds of back-testing mode: Forward-Looking (FL) and non-Forward-Looking (Non-FL). Here is a simple explanation:
Let’s, today it’s 2020, and you want to backtest strategy from 2015. When strategy is in back-test mode, and it evaluates on first bar of chart (say, 2015-01-01) with FL mode, it already “knows” what is the price 2016,2017 etc.. till today (Because, the platform holds the symbol data till this realtime world, and the script can access any available data). So, even though it’s in back-test mode, it knows what is data across the whole back-testing period. So, a programmer can do such thing:

Hmm… Sounds good? … A person can code 100% profitability strategy in backtesting !

HOWEVER, THAT IS CALLED FUTURE-LOOKING MODE (a.k.a. Act in the past depending the current data principle ) which is just fundamentally misleading and has no use. IN NO WAY THAT METHOD SHOULD BE IMPLEMENTED BY PROGRAMMER (EVEN THOUGH SUCH FUNCTIONALITY IS CAN BE EASILY CODED). That’s why where exist many strategies in internet (called “elephant bubbles”) which show to be profitable, but in reality, they are just liar implementation and they were only profitable in back-testing, because they “knew” the future movements in back-testing and made decisions depending on that. However, in real-time, they are ABSOLUTELY fake and useless. Why you might need artificially boosted/optimized scripts? They are of no-use, and will make you to loose money if you use them, and you will regret.

That is why a trader should not implement anything (even in back-testing) that says “on this bar, do this or that, if it would … on next bars” . There should not be any such thing “if it would on next bar”. On any bar, the script should not know what happens on next bars. Instead, it should use the currently available (past) data.
So, even thought it is possible to code “FUTURE-KNOWING” scripts, I totally dis-recommend using any method that will involve “future-looking” style. Indicator or strategy should not take any decisions, depending “if that will … “.

Does my script uses FL mode?

FL mode can be used on any Desktop-based platforms (like NinjaTrader, MetaTrader, TradeStation dll, MultiCharts dll , ThinkOrSwim…), and only web-based platforms (in TradingView) it is not possible to use that approach.

To find out if you script uses FL mode or not, you might need a programmer to look into script. However, one OBVIOUS sign of that too, is whether in script you see a variable with negative index, like Close[-3] or like that.

How to avoid such codes?

Let’s say you have code:

if (High > High[-1]) then SHOW_ARROW on this bar

Which tells platform: if current bar’s HIGH  (lets say, it’s  August 5) is above the next bar’s  (August 6) HIGH, then show arrow on this  bar (which is August 5) !   That’s surely bad way.

Instead, it’s better to check criteria on AUGUST 6:

if (High < High[1]) then SHOW_ARROW on this bar

Which tells platform: if previous bar’s High (August 5) is above current (August 6)  HIGH, then SHOW_ARROW on this bar (which is August 6).   So, the only difference is that you will see the signal on August-6, instead of showing it on August 5. THAT IS THE CORRECT WAY.

( We also strongly recommend to read about: past-displaced & repainting indicators)

Leave a Reply

Your email address will not be published. Required fields are marked *