Easy way to use indicator in "reversed" time direction?
Author: Carova
Creation Date: 2/8/2016 2:57 PM
profile picture

Carova

#1
Is there and easy way to use canned indicator (e.g. SMA.Series) so that it processes a series from bars= "Bars.Count-1" to "0" rather than the normal (and obvious) process of "0" to "Bars.Count-1"?

Yes, I do want to reverse time! ;)

Vince
profile picture

Eugene

#2
What for?
profile picture

Carova

#3
For some exploratory concepts that I have regarding predictability.

Vince
profile picture

Eugene

#4
Obviously, reversing the main loop's order and using SMA.Value wouldn't work. How about reversing the Bars object itself?
profile picture

Carova

#5
How could I reverse the Bars object?

Vince
profile picture

Eugene

#6
Create a new one in reverse order. Here you go (requires extension methods in Community Components):

CODE:
Please log in to see this code.
profile picture

Carova

#7
Thanks Eugene! Much appreciated!!

Vince
profile picture

Eugene

#8
One more thing: check "System.Core" in Editor > References... > .NET Framework tab (or you get a compiler error).
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).