Close Two Ticks Back  [SOLVED]

Questions about MultiCharts and user contributed studies.
tony
Posts: 420
Joined: Jun 14 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Jun 24 2015

I understand how to determine the close on the previous tick but am curious about the close two ticks back. Can anyone shed any insight on how to approach this.

Right now I have a variable = close which is placed at the end of my script AFTER the final end; and that value is held as "previous close" for the next script calculation on the next tick. But I was trying to do the same but for two ticks prior.

User avatar
TJ
Posts: 7775
Joined: Aug 29 2006
Location: Global Citizen
Has thanked: 1036 times
Been thanked: 2233 times

Jun 24 2015

I understand how to determine the close on the previous tick but am curious about the close two ticks back. Can anyone shed any insight on how to approach this.

Right now I have a variable = close which is placed at the end of my script AFTER the final end; and that value is held as "previous close" for the next script calculation on the next tick. But I was trying to do the same but for two ticks prior.

Code: Select all


T2 = T1;
T1 = T0;
T0 = C;

tony
Posts: 420
Joined: Jun 14 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Jun 24 2015

Thanks TJ. I had been approaching this a different way. Took me a few to wrap my head around your solution and then felt like half an ass for not realizing immediately. Much appreciated and very simple solution.

User avatar
TJ
Posts: 7775
Joined: Aug 29 2006
Location: Global Citizen
Has thanked: 1036 times
Been thanked: 2233 times

Jun 24 2015

Thanks TJ. I had been approaching this a different way. Took me a few to wrap my head around your solution and then felt like half an ass for not realizing immediately. Much appreciated and very simple solution.

Simple solutions are the best solutions. :-)
Most of us overthink the problem.