Login Page - Create Account

Support Board


Date/Time: Mon, 10 Mar 2025 17:10:48 +0000



[Programming Help] - Reference previous study values when a condition was true

View Count: 534

[2022-04-05 20:32:53]
User411641 - Posts: 3
In my ACSIL code, I am able to refer the study values using the current index. I am trying to get the values when a certain condition is true. What is the best way to do this?
I do this in tradingview pinescript using "valuewhen(condition, source, index)". Is there something similar to valuewhen util function in ACSIL?
[2022-04-06 14:13:59]
Tony - Posts: 553
you have access to all indexes not just the current one (sc.Index)
i.e.:


int TargetIndex;

for (int IndexCount = sc.Index; IndexCount>=0; IndexCount--) {
if (condition_source)
TargetIndex = IndexCount;
}

Date Time Of Last Edit: 2022-04-06 14:18:16

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account