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?
|
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
|
Platinum Customer
Joined: 1/30/2005 Posts: 135
|
I added price scripting for stock symbol. The code works great. Thank for your help.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|