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 |

MACD cross in RealCode Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
maljester
Posted : Friday, January 23, 2015 12:56:54 PM
Platinum Customer Platinum Customer

Joined: 1/30/2005
Posts: 135

Is it possible to do price scripting for a stock symbol for MACD(3,55) crossiing down through a 9 period signal line?

Bruce_L
Posted : Friday, January 23, 2015 1:21:19 PM


Worden Trainer

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

I would just create the condition by dragging and dropping the MACD onto its moving average and select Create Condition. If you really need a RealCode Condition, you could do something like the following.

'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com 
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:MACD xDn Signal
'|******************************************************************
'# MACDshort = UserInput.Integer = 3
'# MACDlong = UserInput.Integer = 55
'# MACDsignal = UserInput.Integer = 9
If Price.XAVGC(MACDshort) - Price.XAVGC(MACDlong) < _
	Price.ExponentialAverage(MACDsignal).XAVGC(MACDshort) - _
	Price.ExponentialAverage(MACDsignal).XAVGC(MACDlong) AndAlso _
	Price.XAVGC(MACDshort, 1) - Price.XAVGC(MACDlong, 1) >= _
	Price.ExponentialAverage(MACDsignal).XAVGC(MACDshort, 1) - _
	Price.ExponentialAverage(MACDsignal).XAVGC(MACDlong, 1) Then
	Pass
End If


-Bruce
Personal Criteria Formulas
TC2000 Support Articles
maljester
Posted : Friday, January 23, 2015 1:37:49 PM
Platinum Customer Platinum Customer

Joined: 1/30/2005
Posts: 135

I added price scripting for stock symbol.  The code works great.  Thank for your help.

Bruce_L
Posted : Friday, January 23, 2015 1:44:33 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.