Support Board
Date/Time: Wed, 25 Jun 2025 12:49:21 +0000
[Programming Help] - Decrementing for loop
View Count: 550
[2021-12-27 06:11:14] |
User769783 - Posts: 195 |
Hello, In my for loop, I am trying to decrement instead of incrementing the integer. Is it possible? Am I doing something wrong? Thanks ... for (int Ticks = sc.Bid; Ticks >= sc.Low[sc.Index]; Ticks--) |
[2021-12-27 18:31:46] |
ForgivingComputers.com - Posts: 1071 |
Yes, you can decrement Ticks with "Ticks--" However, sc.Bid is not an integer so Ticks will get truncated. Depending on the prices you are looking at that could make a big difference. It could also cause the loop to never execute if sc.Low is greater than the truncated Ticks value. |
To post a message in this thread, you need to log in with your Sierra Chart account: