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.
Close Two Ticks Back [SOLVED]
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
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;
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.
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
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.