Login Page - Create Account

Support Board


Date/Time: Sun, 22 Dec 2024 09:12:03 +0000



Post From: Pers Vars in if statement

[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.