| Posted by: Salil V Gangal on January 10, 2005 at 22:53:00
In Reply to: FastTrack / Trade script for BreadthThrust posted by Salil V Gangal on January 10, 2005 at 15:13:24 |
Subscribers of Breadth.BIZ PC Based Service,Following script will consolidate the Breadth analysis (Breadth Thrust / McClellan Oscillator) and give output. The analysis available via Breadth.BIZ Web Based Service goes beyond the simple consolidation given below ... however ... I assume that most subscribers of Breadth.BIZ PC Based Service are savvy to code/run their own further analysis in FastTrack/Trade/... (Stay tuned for additional scripts ...)
Regards,
Salil V Gangal
; --- Script Begins ---
; Copyright © 2005 Salil V Gangal, All Rights Reserved.
; Permission is given to all Breadth.BIZ PC Based subscribers to copy/change
; this script as long as all the first 4 lines of this script are left unchanged.
; --------------------------------------------------------------------------------
; BTMC.INI
; Sctipt to calculate/print the Breadth Thrust and McClellan Oscillator
; Original Breadth Thrust was developed by Dr Martin Zweig.
; Original McClellan Oscillator was developed by Sherman and Marian McClellan.
; --------------------------------------------------------------------------------
[Expression]
;
; This script will error if the denominator (Advancing Issues + Declining Issues )
; is zero for the division. However the chances of this happening are negligible.
; Per Dr Zweig, EMA over 10 periods is useful. I find EMA over 9 periods suitable.
;
; McClellan Oscillator for the sectors/indices need not be calculated again, as
; it is included in Breadth.BIZ PC Based Service.
;
btBIO = 100 * Ema ( BIOAD / ( BIOAD + BIODC ),9)
btBMT = 100 * Ema ( BMTAD / ( BMTAD + BMTDC ),9)
btBNK = 100 * Ema ( BNKAD / ( BNKAD + BNKDC ),9)
btCYC = 100 * Ema ( CYCAD / ( CYCAD + CYCDC ),9)
btDJI = 100 * Ema ( DJIAD / ( DJIAD + DJIDC ),9)
btESV = 100 * Ema ( ESVAD / ( ESVAD + ESVDC ),9)
btFIN = 100 * Ema ( FINAD / ( FINAD + FINDC ),9)
btGLD = 100 * Ema ( GLDAD / ( GLDAD + GLDDC ),9)
btHTL = 100 * Ema ( HTLAD / ( HTLAD + HTLDC ),9)
btINT = 100 * Ema ( INTAD / ( INTAD + INTDC ),9)
btLEI = 100 * Ema ( LEIAD / ( LEIAD + LEIDC ),9)
btMID = 100 * Ema ( MIDAD / ( MIDAD + MIDDC ),9)
btNCY = 100 * Ema ( NCYAD / ( NCYAD + NCYDC ),9)
btNDX = 100 * Ema ( NDXAD / ( NDXAD + NDXDC ),9)
btOIL = 100 * Ema ( OILAD / ( OILAD + OILDC ),9)
btPAP = 100 * Ema ( PAPAD / ( PAPAD + PAPDC ),9)
btPHA = 100 * Ema ( PHAAD / ( PHAAD + PHADC ),9)
btRIT = 100 * Ema ( RITAD / ( RITAD + RITDC ),9)
btRTL = 100 * Ema ( RTLAD / ( RTLAD + RTLDC ),9)
btRU2 = 100 * Ema ( RU2AD / ( RU2AD + RU2DC ),9)
btSEM = 100 * Ema ( SEmaD / ( SEmaD + SEMDC ),9)
btSML = 100 * Ema ( SMLAD / ( SMLAD + SMLDC ),9)
btSPX = 100 * Ema ( SPXAD / ( SPXAD + SPXDC ),9)
btTEL = 100 * Ema ( TELAD / ( TELAD + TELDC ),9)
btTRN = 100 * Ema ( TRNAD / ( TRNAD + TRNDC ),9)
btUTL = 100 * Ema ( UTLAD / ( UTLAD + UTLDC ),9)
btWIR = 100 * Ema ( WIRAD / ( WIRAD + WIRDC ),9)
; BreadthThrust Group of securities
btFam = Family (
btBIO, btBMT, btBNK, btCYC, btDJI, btESV, btFIN, btGLD
, btHTL, btINT, btLEI, btMID, btNCY, btNDX, btOIL, btPAP
, btPHA, btRIT, btRTL, btRU2, btSEM, btSML, btSPX, btTEL
, btTRN, btUTL, btWIR
)
; McClellan Oscillator Group of securities
mcFam = Family (
BIOmc, BMTmc, BNKmc, CYCmc, DJImc, ESVmc, FINmc, GLDmc
, HTLmc, INTmc, LEImc, MIDmc, NCYmc, NDXmc, OILmc, PAPmc
, PHAmc, RITmc, RTLmc, RU2mc, SEMmc, SMLmc, SPXmc, TELmc
, TRNmc, UTLmc, WIRmc
)
btOverSold = Select ( btFam < 30 )
mcOverSold = Select ( mcFam <= 0 )
btOverBought = Select ( btFam > 70 )
mcOverBought = Select ( mcFam > 0 )
btOverSoldTotal = FamSum( btOverSold /btOverSold )
mcOverSoldTotal = FamSum( mcOverSold /mcOverSold )
btOverBoughtTotal = FamSum( btOverBought /btOverBought )
mcOverBoughtTotal = FamSum( mcOverBought /mcOverBought )
If ( btOverSoldTotal - .01 )
Print("--- Breadth Thrust: OverSold Sectors/Indices ---")
FamPrint ( -Sort(-btOverSold), "Breadth Thrust " )
Else
Print("\nThere are no OverSold Sectors/Indices per BreadthThrust")
EndIf
Print ("\n\n")
If ( mcOverSoldTotal - .01 )
Print("--- McClellan Oscillator: OverSold Sectors/Indices ---")
FamPrint ( -Sort(-mcOverSold), "McClellan Oscillator " )
Else
Print("\nThere are no OverSold Sectors/Indices per McClellan Oscillator")
EndIf
Print ("\n\n")
If ( btOverBoughtTotal - .01 )
Print("--- Breadth Thrust: OverBought Sectors/Indices ---")
FamPrint ( Sort(btOverBought), "Breadth Thrust " )
Else
Print("\nThere are no OverBought Sectors/Indices per BreadthThrust")
EndIf
Print ("\n\n")
If ( mcOverBoughtTotal - .01 )
Print("--- McClellan Oscillator: OverBought Sectors/Indices ---")
FamPrint ( Sort(mcOverBought), "McClellan Oscillator " )
Else
Print("\nThere are no OverBought Sectors/Indices per McClellan Oscillator")
EndIf
Print ("\n\n")
Print("--- Breadth Thrust Summary Sorted: OverSold to OverBought ---")
FamPrint ( -Sort(-btFam), "Breadth Thrust " )
Print("--- McClellan Oscillator Summary Sorted: OverSold to OverBought ---")
FamPrint ( -Sort(-mcFam), "McClellan Oscillator " )
Print("--- Breadth Thrust Detailed ---")
Print(
btBIO , " ($Sym) BioTech "
, btBMT , " ($Sym) Basic Materials "
, btBNK , " ($Sym) Banking "
, btCYC , " ($Sym) Consumer Services "
, btDJI , " ($Sym) Dow Jones Industrial "
, btESV , " ($Sym) Energy Services "
, btFIN , " ($Sym) Financial Services "
, btGLD , " ($Sym) Precious Metals "
, btHTL , " ($Sym) Health Care "
, btINT , " ($Sym) Internet "
, btLEI , " ($Sym) Leisure "
, btMID , " ($Sym) S&P 400 "
, btNCY , " ($Sym) Consumer Goods "
, btNDX , " ($Sym) Nasdaq 100 "
, btOIL , " ($Sym) Energy "
, btPAP , " ($Sym) Paper and Forrest "
, btPHA , " ($Sym) Pharmacutical "
, btRIT , " ($Sym) Real Estate "
, btRTL , " ($Sym) Rydex Retailing "
, btRU2 , " ($Sym) Russell 2000 "
, btSEM , " ($Sym) Semiconductor "
, btSML , " ($Sym) S&P 600 "
, btSPX , " ($Sym) S&P 500 "
, btTEL , " ($Sym) Telecommunications "
, btTRN , " ($Sym) Transportation "
, btUTL , " ($Sym) Utilities "
, btWIR , " ($Sym) Wireless "
)
Print("--- McClellan Oscillator Detailed ---")
Print(
BIOmc , " ($Sym) BioTech "
, BMTmc , " ($Sym) Basic Materials "
, BNKmc , " ($Sym) Banking "
, CYCmc , " ($Sym) Consumer Services "
, DJImc , " ($Sym) Dow Jones Industrial "
, ESVmc , " ($Sym) Energy Services "
, FINmc , " ($Sym) Financial Services "
, GLDmc , " ($Sym) Precious Metals "
, HTLmc , " ($Sym) Health Care "
, INTmc , " ($Sym) Internet "
, LEImc , " ($Sym) Leisure "
, MIDmc , " ($Sym) S&P 400 "
, NCYmc , " ($Sym) Consumer Goods "
, NDXmc , " ($Sym) Nasdaq 100 "
, OILmc , " ($Sym) Energy "
, PAPmc , " ($Sym) Paper and Forrest "
, PHAmc , " ($Sym) Pharmacutical "
, RITmc , " ($Sym) Real Estate "
, RTLmc , " ($Sym) Rydex Retailing "
, RU2mc , " ($Sym) Russell 2000 "
, SEMmc , " ($Sym) Semiconductor "
, SMLmc , " ($Sym) S&P 600 "
, SPXmc , " ($Sym) S&P 500 "
, TELmc , " ($Sym) Telecommunications "
, TRNmc , " ($Sym) Transportation "
, UTLmc , " ($Sym) Utilities "
, WIRmc , " ($Sym) Wireless "
)
Print(
"\nNotes:"
, "\nBreadth Thrust was developed by Dr. Martin Zweig."
, "Above output is my interpretation of this Breadth Thrust alongwith my changes."
, "\n OverSold: Any Index/Sector that has Breadth Thrust under 30 is OverSold."
, " OverBought: Any Index/Sector that has Breadth Thrust above 70 is OverBought."
, "\nHowever, these values 30/70 are quite artificial and there is no logical"
, "reason as to why these should not be 29.99 or 70.01 or any other value !"
, "With everchanging market conditions, these values need your judgement/adjustment."
, "\nMcClellan Oscillator was developed by Sherman and Marian McClellan."
, "\nAlso read text at URL below for some thoughts about breadth."
, "http://fundvision.com/mfv/breadth_info.shtml"
, "\nRegards,\nSalil V Gangal"
)
; --- Script Ends ---
|
Read the Follow Ups: |
Copyright © 1998-2000 Salil V Gangal, All Rights Reserved.