TC2000.com• Download software • Tutorial videos • Subscription & data-feed pricing • Class schedule
TC2000Brokerage.com• New account application • Trading resources • Margin rates • Stock & option commissions
Worden Discussion Forum
RealCode for StockFinder 5.0
Storing a value in a variable for future bars to reference
I have another issue I'm trying to fix and searching hasn't turned up a solution. I am telling a variable to be defined as price.Close(X) where X is user defined. But really what I want is for that variable to store the value of price.Close(X) for future bars to compare against until the variable is redefined as a new value. Is there a way to do this?
Thresh and Hold are the variables that are not sticking to the value for the bar in which they are defined. Clearly I'm doing it wrong and need the proper coding to do what I'm after. As an aside the code might have some redundant elements like Exit Function and Plots as I've been troubleshooting but this is where it's at right now. Also Starting Trend as "Down" is sort of a workaround at the moment.
Thank you in advance,
Here is the code:
Use Static instead of Dim.