Page 1 of 1

Close Two Ticks Back

Posted: Jun 24 2015
by tony
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.

Re: Close Two Ticks Back  [SOLVED]

Posted: Jun 24 2015
by TJ
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;

Re: Close Two Ticks Back

Posted: Jun 24 2015
by tony
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.

Re: Close Two Ticks Back

Posted: Jun 24 2015
by TJ
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.