Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

some technical editing Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
rcooper1
Posted : Tuesday, March 15, 2011 1:25:07 PM
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
Bruce_L
Posted : Tuesday, March 15, 2011 1:40:05 PM


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
rcooper1
Posted : Tuesday, March 15, 2011 11:37:05 PM
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
Bruce_L
Posted : Wednesday, March 16, 2011 8:00:08 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
You're welcome.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.