Login Page - Create Account

Support Board


Date/Time: Sun, 05 May 2024 22:33:14 +0000



Post From: GetStudyLineUntilFutureIntersection example

[2023-07-01 09:05:48]
User431178 - Posts: 413
Is your study using manual looping? If so, lineEndIndex is not going to be populated until the subsequent call into your study function.

Seems this is also true for auto looping, lineEndIndex is not going to be populated until the after the study is calculated.
In both cases this means the the line would not be deleted until the close of the next bar after the study is first calculated.

Also should have used a while loop as we are deleting elements, my bad.

Attached modified code that has the option to delete or re-color the lines after intersection.
Also sets a flag to indicate that the lines should be updated immediately on the next call to the functions after the initial calculation.

Test this on replay (or with live data) and you will see that the lines are updated correctly.
attachmentlines_example.cpp - Attached On 2023-07-01 09:05:45 UTC - Size: 11.55 KB - 95 views