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 |

Momentum of Comparative Strength Formula Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
odgarcia
Posted : Friday, July 13, 2012 4:01:27 PM
Registered User
Joined: 4/25/2012
Posts: 15

 I would like to implement the following indicator formula on my tc2000 platform:

Momentum of Comparative Strength (MoCS)

 MoCScombines relative strength (RS) and the MACD indicator.
 MoCS replaces the closing prices used in the traditional MACD formula with a RS calculation.

The formula for MoCS is:


MoCS = (12-period EMA of (Stock/S&P 500)) - (26-period EMA (Stock/S&P 500))

Where:

-- EMA represents an exponential moving average

-- Stock represents the closing price of the stock or ETF being studied

-- S&P 500 represents the closing price of the S&P 500 index

Thanks

Bruce_L
Posted : Friday, July 13, 2012 4:19:01 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I cannot think of a practical automated method of doing so in either verison of TC2000 as the Personal Criteria Formula Language does not have syntax for referencing other symbols.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
odgarcia
Posted : Friday, July 13, 2012 5:10:41 PM
Registered User
Joined: 4/25/2012
Posts: 15

Bruce,

Thanks for your quick response.

OG

BobMc
Posted : Friday, July 13, 2012 8:51:45 PM
Registered User
Joined: 10/7/2004
Posts: 816

Bruce,

How about a Stockfinder implementation with user defined periods?

 

Thanks

Regards

BobMc

Bruce_L
Posted : Monday, July 16, 2012 12:17:15 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Please try the following RealCode Indicator:

'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.0 www.worden.com 
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:Momentum of Comparative Strength
'|******************************************************************
'# Cumulative
'# ShortPeriod = UserInput.Single = 12
'# LongPeriod = UserInput.Single = 26
Static Comparison As PriceScripting
Static EMA(1) As Double
Static termRatio(1) As Double
Static sumWeight(1) As Double
If isFirstBar Then
	Comparison = PriceData("SP-500")
	EMA(0) = 0
	EMA(1) = 0
	termRatio(0) = (ShortPeriod - 1) / (ShortPeriod + 1)
	termRatio(1) = (LongPeriod - 1) / (LongPeriod + 1)
	sumWeight(0) = 1
	sumWeight(1) = 1
End If
Dim ratio As Double = Price.Last / Comparison.Last
For i As Integer = 0 To 1
	Dim weight As Double = 1 / sumWeight(i)
	EMA(i) = EMA(i) * (1 - weight) + weight * ratio
	sumWeight(i) = sumWeight(i) * termRatio(i) + 1
Next
Plot = EMA(0) - EMA(1)


-Bruce
Personal Criteria Formulas
TC2000 Support Articles
odgarcia
Posted : Monday, July 16, 2012 12:49:01 PM
Registered User
Joined: 4/25/2012
Posts: 15

I am relatively new to tc2000, could you please show me where I need to paste this code. Thanks BobMc, thanks again Bruce.

BobMc
Posted : Monday, July 16, 2012 12:49:55 PM
Registered User
Joined: 10/7/2004
Posts: 816

Thanks Bruce

Regards

Bob Mc

Bruce_L
Posted : Monday, July 16, 2012 1:03:36 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

odgarcia,
The RealCode was a response to BobMc's question about implementing the indicator in StockFinder. The RealCode will not work in TC2000.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
odgarcia
Posted : Monday, July 16, 2012 1:35:12 PM
Registered User
Joined: 4/25/2012
Posts: 15

Thanks Bruce, one last questions: If I upgraded my Gold account to Platinum, would I then have access to Stockfinder?

Bruce_L
Posted : Monday, July 16, 2012 1:40:28 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

No, you would need to get a separate StockFinder subscription.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
odgarcia
Posted : Monday, July 16, 2012 2:04:29 PM
Registered User
Joined: 4/25/2012
Posts: 15

Thanks

OG

Bruce_L
Posted : Monday, July 16, 2012 2:04:50 PM


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.