| Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 6/25/2010 Posts: 44
|
This should be simple (for anyone else). I am looking for an indicator that will reflect the (10 Day SMA of the Close)*(Variable), where I set the variable. The only complication is that the calculation should use 9 previous closing prices plus the live last price. Thanks!Richard
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
'# Variable = UserInput.Single = 1
'# SMAperiod = UserInput.Integer = 10
Plot = Variable * Price.AVGC(SMAperiod)
RealCode for Real People: Indicators
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 6/25/2010 Posts: 44
|
Thanks Bruce. But where should I set the variable? When I change the line'# Variable = UserInput.Single = 1 to read '# Variable = UserInput.Single = 1.02, I do not get a change in the indicator.Richard
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
We used a UserInput so you don't have to Edit the RealCode.
Once it is created, you can left-click on the Indicator to Edit the UserInput value for the Variable.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 6/25/2010 Posts: 44
|
I didn't even realize....thanks so much!
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 6/25/2010 Posts: 44
|
Here is an even simpler one...how would I code an indicator that was merely Constant/LastPrice. I am trying to create an indicator that will generate my order size, where Constant is the Dollar size of my orders. Thanks
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
'# Constant = UserInput.Single = 1000
Plot = Constant / Price.Last
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
|
Guest-1 |