[BEWARE] Displaced “Plot In The Past” & Repainting indicators

[Chapter 1] Displaced Indicators

We are getting many queries asking to create strategies which rely on ZigZag, Swing, Pivot or similar indicators.
Unfortunately (in most cases), it is not possible in reality, because such indicators are frequently built with “Plot In the past” principle, which is STRONGLY UNRECOMMENDED to be used for any trading purposes.

For example, do you see this Short signal? You could make a lot-of-money if you traded on that signal:

It was a perfect peak(swing) signal. Am I right?
Well, this IS NOT RIGHT. IT IS FALSE, and remember this forever when using any indicator.

 If anyone have been watching that chart in realtime when it was live and you have been on that bar (look at exampled bar numbered with `17`), you wouldn’t have any clue if the price kept going upward, or kept the level horizontally, or reversed suddenly and went down:


So, NO ONE KNEW THAT IT WAS A SWING, until  several bars (let’s say 5 or 10 bars) was passed after that bar. So, only then we mention that bar as “SWING” bar, when we have a completed sequence after that bar. Such indicators JUST PLACE AN ARROW/LABEL in the past only after the needed amount of bars are passed!  For example:

if (Close > Open) then SHOW_ARROW on 4 bars ago

So, they PLACE SIGNALS IN THE PAST DEPENDING ON CURRENT SITUATION!  That is called “Manipulate the past” behavior, which is not a recommended approach (if any script uses that approach, it should EXPLICITLY SAY that its plots/signals are displaced and can’t be used as real-time signals). So, no-one is able to trade on the such bars, because they are labeled only after 5-10 (or how much displacement) bars are passed (btw, if you want to trade after that, then ok, you can).

[Chapter 2] Repainting Indicators

Now, let’s discuss another type of misleading scripts – Repainting indicators. Look at another this live-example.

You see how the ZigZag peak re-paints in live datafeed. That’s because the script is working with “Act in the past” mode. So, you think that you want to have a strategy to execute trade when those “PEAK” (Top or Bottom) happens, then in live, it might trade, but the indicator then repaint it’s peaks, and you will see that you have “trade” executed in the past chart, where there is not shown any peak . That is because, actually, in that bar, there actually was a peak, and caused to execute the trade, but then the indicator changed decision and re-drew it’s ZigZag peak lines.
So, never rely on such indicators (you have either should be sufficient in programming to see if that code behave like that or not. Refer to the mentioned link above for more info).

The only case when the swing Top/Bottom signal can be safely obtained, is only when several bars (predefined, i.e. 5) are passed to confirm the give & confirm the swing signal (which will not repaint, depending the nature of NinjaTrader’s Swing indicator):

So, as you see, it only marks peak when several confirmation bars are passed. But remember, when swing signal is triggered, it’s already gone i.e. 5 bars now, so be wise to decide, if you wanted to take that signal for a trade decision.

( We also strongly recommend to read about: Future-Looking indicators )

Leave a Reply

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