I’m working with tick-based charts (e.g., 100-tick and 300-tick) in the ProRealTime code editor and encountering an issue with my logic. Here’s a simplified version of my code:
The issue arises when:
- Within a tick candle (e.g., the 100-tick candle), my condition is met at some intermediate tick (e.g., the 24th tick), causing the loop to
BREAK
.
- However, by the time the 100-tick candle fully forms, the overall condition of the candle (e.g., whether it’s red or green) changes. Since the loop has already exited, I miss this updated result.
This problem doesn’t occur with time-based charts, as conditions are evaluated only at the close of a candle.
Question:
How can I modify my logic to ensure that:
- The condition is evaluated only after the full 100-tick or 300-tick candle is formed?
- The loop doesn’t exit prematurely, but I can still track intermediate conditions if needed?
Any help or suggestions for handling this issue would be greatly appreciated. Thank you!