| Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 6/25/2010 Posts: 44
|
Bruce, I have the following code, mostly from you, with one modification:'# Variable = UserInput.Single = 1'# SMAperiod = UserInput.Integer = 10Plot = (( Price(0) - Price.AVGC(SMAperiod,1)) / Price (0)) *100All I want to do is to change the 1 day offset in SMA into a user defined variable on the dialog page. Also, will price(0) return the current price during the trading day prior to the close? If not, what is the correct price term? Thanks much,Richard
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Price.Value(0) will return the most recent available Price while calculating the most current Bar. You probably want something like the following (although I'm not sure what the '# Variable line is for):
'# Variable = UserInput.Single = 1
'# SMAperiod = UserInput.Integer = 10
'# Offset = UserInput.Integer = 1
Plot = ((Price.Value(0) - Price.AVGC(SMAperiod, Offset)) / Price.Value(0)) * 100
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 6/25/2010 Posts: 44
|
Thanks, Bruce...the variable was part of this indicator at one point (you actually provided the code), but is not longer part of it. What you gave me works...thanks. richard
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
|
Guest-1 |