Login Page - Create Account

Support Board


Date/Time: Sat, 18 May 2024 22:45:25 +0000



[User Discussion] - Pers Vars in if statement

View Count: 1120

[2015-04-04 05:14:40]
CustomIndicators - Posts: 126
So, I have a persistent variable called peakTwo. It was made with:
float& peakTwo = sc.PersistVars->f2;
SCSubgraphRef IndicatorLine = sc.Subgraph[0];

Now, comparing a pers var to another pers var like so, works perfectly:

if (peakTwo >= peakOne){ //Do something. }


But when I try to do something more like this, it won't work at all. Whats wrong?:

if (peakTwo >= IndicatorLine[sc.Index-2]){ //Do something. }

Is there a way to convert peakTwo into something that will work with the element it is being compared to? The indicator line is based off a SMA line, using the Last price from the price chart.

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

Login

Login Page - Create Account