Metastock Formulas1-2-3 High or Low LOW Mx:=Mov(L,4,S); L > Ref(L,-1) AND L>Mx AND Ref(L,-1) < Ref(Mx,-1) AND LLV(L,4 ) > LLV(L,10 ) AND RSI(14)<50 HIGH Mx:=Mov(H,4,S); H < Ref(H,-1) AND H < Mx AND Ref(H,-1) > Ref(Mx,-1) AND HHV(H,4 ) < HHV(H,10) AND RSI(14)>50 1 2 3 Ross Hook Col A: Peak(1,H,10)<=1.1*Peak(2,H,10) AND Peak(1,H,10)>=0.9*Peak(2,H,10) AND Trough(1,L,10)>=1.1*Trough(2,H,10) AND Trough(1,L,10)<=0.9*Trough(2,H,10) AND LLV(L,25) Col B: Peak(1,H,5)<=1.1*Peak(2,H,5) AND Peak(1,H,5)>=0.9*Peak(2,H,5) AND Trough(1,L,5)>=1.1*Trough(2,H,5) AND Trough(1,L,5)<=0.9*Trough(2,H,5) AND LLV(L,25) Col C: Peak(1,H,1)<=1.1*Peak(2,H,1) AND Peak(1,H,1)>=0.9*Peak(2,H,1) AND Trough(1,L,1)>=1.1*Trough(2,H,1) AND Trough(1,L,1)<=0.9*Trough(2,H,1) AND LLV(L,25) Filter colA=1 OR colB=1 OR colC=1 1234's Sell A:Close B:ADX(14){The higher the better} C: PDI(14)<MDI(14) D:If(H>Ref(H,-1) and Ref(H,-1)>Ref(H,-2) and Ref(H,-2)>Ref(H,-3),1,0) E:{Entry}LLV(L,3)-.125 F:{stop}HHV(H,3) Filter:ColB>30 and ColC and ColD=1 2 Day Hammer Exploration Here is an exploration that pattern traders may find useful. It tends to pick up two patterns: a two day hammer, that is if you combined the open for day 1 and close for day 2, the resulting bar would be a hammer, and a pattern similar to a Ross Hook, as I understand a Ross Hook. Ref((C-L)/(H-L),-1)<=.30 AND ((C-L)/(H-L)) >= .70 AND Ref(ATR(1),-1) >ATR(10) AND ATR(1) >= ATR(10) 21 Day Trigger Look at these two oscillators in MSWIN, and compare them to Dahl. Put a 21 day EMA on each, think of the 21 day ema as a trigger. See what they tell you -- Dahl is long term, Ian is shortest term. Raschke Oscillator = Mov(Fml( "Raschke 3-10" ),16,E) where "Raschke 3-10" = Mov(C,3,S) - Mov(C,10,S) Ian Oscillator = (Mov(C,4,S)-Mov(C,9,S)) + (Mov(C,9,S)-Mov(C,17,S)) 3 Minute Bar Breakout {Functions used in Middle Screen} MiddleScreenBlue := Mov( Close, 34, E ) MiddleScreenYell := Mov( Open, 13, E ) {Functions used in Lower Screen} StochRed := Stoch( 9, 7 ) StochLagging : = Mov( StochRed, 7, S ) { Main analysis section } {BULLISH} Cross( StochRed, StochLagging ) AND ( MiddleScreenYell > MiddleScreenBlue ) {BEARISH} Cross( StochLagging, StochRed ) AND ( MiddleScreenYell < MiddleScreenBlue ) { Breakout Notifier } UpperSupportNow := Mov( OPEN, 10, E ) LowerSupportNow := Mov( CLOSE, 8, E ) PrevUpperSupport := Ref( Mov( OPEN, 10, E ), -1 ) PrevLowerSupportNow := ref( Mov( CLOSE, 8, E ), - 1 ) TRUE := 1 FALSE := 0 SignalledHigh := FALSE SignalledLow :=FALSE { BULLISH } IF ( ( L > UpperSupportNow ) AND ( Ref( L, -1 ) > PrevUpperSupport ) AND SignalledHigh = FALSE ) THEN SignalledHigh := TRUE IF ( SignalledHigh = TRUE ) THEN SignalledLow :=FALSE {BEARISH} IF ( ( H < LowerSupportNow ) AND ( Ref( H, -1 ) > PrevLowerSupport ) AND SignalledLow = FALSE ) THEN SignalledLow := TRUE IF ( SignalledLow = TRUE ) THEN SignalledHigh := FALSE 5 Day High {"Today must make a five-day high and today the close must be below the open."} {Place the following in the MetaStock Explorer filter section.} HIGH > Ref(HHV(HIGH,4),-1) AND CLOSE < OPEN {or you can write it this way too ...} HIGH > Ref(HIGH,-4) AND HIGH > Ref(HIGH,-3) AND HIGH > Ref(HIGH,-2) AND HIGH > Ref(HIGH,-1) AND CLOSE < OPEN 52 Week Hi-Lo Exploration ColA: {Close}C; ColB: {52-week High} HighestSince(1, (DayOfMonth()=08 AND Month()=05 AND Year()=1998), H); ColC: {52-week Low} LowestSince(1, (DayOfMonth()=08 AND Month()=05 AND Year()=1998), L); {Choose one of these filters} {Filter 1:} ColA >= (0.9*(ColB)) {Filter 2:} ColB >= 2*ColC {If you want both the conditions to be satisfied in the same query, just join the two filters by the AND operator:} Filter: (ColA >= (0.9*(ColB)) AND ColB >= ColC) {One problem with the 52-wk High and 52-wk Low formula--every day you've got to change the values for dayofmonth(), Month() and Year() functions. The formula given above assumes that you would be running the query on May 07, 1998. Change the values of the above functions accordingly.} 7 Day Rate Of Change Ported From Super Charts ((C-Ref(CLOSE,-7))/Ref(CLOSE,-7)*100) Adaptive Moving Average by Perry Kauffman This is a Metastock for Windows version 6.5 formula. Periods := Input("Time Periods",1,1000, 10); Direction := CLOSE - Ref(Close,-periods); Volatility := Sum(Abs(ROC(CLOSE,1,$)),periods); ER := Abs(Direction/Volatility); FastSC := 2/(2 + 1); SlowSC := 2/(30 + 1); SSC := ER * (FastSC - SlowSC) + SlowSC; Constant := Pwr(SSC,2); AMA := If(Cum(1) = periods +1, ref(Close,-1) + constant * (CLOSE ref(Close,-1)), Prev + constant * (CLOSE - PREV)); ADX And Trendlines if you want to identify directional movement by expressing that the ADX "is rising" the most basic way to do it would be: ADX(14) > Ref(ADX(14),-1) -- Today's ADX is greater than yesterday's ADX. There is another aspect to the ADX that bears investigation, though; namely the level of the ADX. There seems to be a general consensus that an ADX over, say, 30 indicates a stronger trend than lower ADX readings. So you could either write ADX(14) > 30 -- or not, depending on your objectives. You can stipulate that both conditions are true by joining them with the word "and." Also, I have found the following helpful: try using the custom ADX formula posted on the MetaStock website. Wilder wrote the original ADX in such a fashion that it rounds the readings out to the nearest whole number. The "regular" canned MetaStock ADX does this, while the custom ADX does not. The non-rounded readings are just a shade more sensitive, which can be helpful. ADX Raw {MetaStock code written by Equis and published in the Oct99 TASC} Periods:= Input("Enter time periods",1,100,14); PlusDM:= If(HIGH>Ref(HIGH,-1) AND LOW>=Ref(LOW,-1), HIGH-Ref(HIGH,-1), If(HIGH>Ref(HIGH,-1) AND LOW<Ref(LOW,-1) AND HIGH-Ref(HIGH,-1)>Ref(LOW,-1)-LOW, HIGH-Ref(HIGH,-1), 0)); DIPlus:= 100 * Wilders(PlusDM,Periods) / ATR(Periods); MinusDM:= If(LOW<Ref(LOW,-1) AND HIGH<=Ref(HIGH,-1), Ref(LOW,-1)-LOW, If(HIGH>Ref(HIGH,-1) AND LOW<Ref(LOW,-1) AND HIGH-Ref(HIGH,-1)<Ref(LOW,-1)-LOW, Ref(LOW,-1)-LOW, 0)); DIMinus:= 100 * Wilders(MinusDM,Periods) / ATR(Periods); DIDif:= Abs(DIPlus - DIMinus); DISum:= DIPlus + DIMinus; ADXRaw:= 100 * Wilders(DIDif/DISum, Periods); ADXRaw ADX with Stochastic Signals Metastock users can reproduce the trend bars and entry signals shown on the CWO chart using the Expert Advisor. Create a new expert and under Symbols add a new entry with the following condition : Brunswick. Hope you find them useful.30.S)) AND ( Mov(C. U. ---------------------------------------------Chaos Blue BL {Alligator Blue Balance Line .S) < Mov(C.5.S) > Mov(C.-5).5.30.ADX(14) > 20 AND ( Mov(C.-1)> =30 Under Trends add the Bullish formula : ADX(14) > 20 AND ( Mov(C.3) < 30 AND Ref(Stoch(5.Jaw } {13 bar smoothed average offset 8 bars } Ref(Wilders(MP().S) < Mov(C.30. originally from Gary Randall -.S) > Mov(C.S)) and the Bearish formula : ADX(14) > 20 AND ( Mov(C.30.S)) AND ( Mov(C.30.-3). ---------------------------------------------Chaos Green BL {Alligator Green Balance Line .15.8).30. Maine.S. red := Fml("Chaos Red").15. .5.S) > Mov(C.A.S)) AND Stoch(5.5). Please read his book "Trading Chaos" and pick up a demo of his "Investor's Dream" software from his web site to see how they are used.Teeth } {8 bar smoothed average offset 5 bars } Ref(Wilders(MP().Lip } {5 bar smoothed average offset 3 bars } Ref(Wilders(MP().3) . ---------------------------------------------Chaos Gator { Chaos Alligator } { Plot as histogram } green := Fml("Chaos Green").-8). ---------------------------------------------Chaos Red BL {Alligator Red Balance Line .S)) Alligator Indicators Following are the Bill William's Alligator indicators I put together. blue := Fml("Chaos Blue").S)) AND ( Mov(C.15.13).S) > Mov(C. S) . Low4 := Ref(LOW.Mov(Fml("Chaos AO").5. If(blue > red AND red > green.Mov(MP().S).2). High2 := Ref(HIGH. High3 := Ref(HIGH.-1). Low3 := Ref(LOW.-2). 0)). ---------------------------------------------Chaos AO Signal Line { Chaos Awsome Oscillator Signal Line } { Plot as line over AO histogram } Mov(Mov(MP().blue. green . Low5 := Ref(LOW. ---------------------------------------------Chaos AO { Chaos Awsome Oscillator .5.1). Low2 := Ref(LOW.34. Fractal := If((High3 > High1) AND (High3 > High2) AND (High3 > High4) AND (High3 > High5). ---------------------------------------------Chaos Fractal { Chaos Fractal (simple version +1=Up. Fractal := If((Low3 < Low1) AND (Low3 < Low2) AND (Low3 < Low4) AND (Low3 < Low5). +1. High4 := Ref(HIGH.5. .34.measures momentum } ( A very close approximation of MFI } { Plot as histogram } Mov(MP().Mov(MP().S).S) . green .5.-2). Low1 := Ref(LOW.0).blue.S).0).S) ---------------------------------------------Chaos AC { Chaos Accelerator/Decelerator Oscillator } { Measures acceleration } { Plot as histogram } Fml("Chaos AO") . -1=Dn) } High1 := Ref(HIGH. High5 := Ref(HIGH.1).2).If(green > red AND red > blue.0).-1). LB Raschke (For Metastock v6. 34.MP(VAR)} .SS=SLOWLINE. S). S). Drag this to the chart and change it to a histogram and plot green AO oscillator Green If( Mov(( H+L)/2. ENTRYADD=+1. -1).Mov( ( H+L)/2. Fractal.B. S)Mov(Mov(( H+L)/2.SXSTOP(99999). Re-written by Ton Maas. S) . S). 5. 34.Mov(( H+L)/2. Alligator System Modifications from Murray Richards . 34.0) Acc Mov(( H+L)/2.Mov(( H+L)/2. 34.SS(VAR).Fml( "Acc" ).Mov(( H+L)/2. S). 5.0 ) Put in the same window and plot green AC green If( Fml( "Acc" )<Ref( Fml( "Acc" ). 34.Fml( "Acc" ).-1).If(Fractal > 0.-1) . .EXITADD=+1} {FUNCTIONS-VAR-REFERENCE-INDEX: BBUY=(VAR). 0. 34. S)Mov(( H+L)/2. 34. S) Put in its on window as a histogram and plot red AC Red If( Fml( "Acc" )<Ref( Fml( "Acc" ). S )). S). Mov( ( H+L)/2. 5.-1). >.5) Original formula based on L. 5. S). S).CBUY(VAR). S).Ref(Mov( ( H+L)/2. 5.Mov(( H+L)/2. Fractal). LXSTOP(VAR). S). {FUNCTIONS-IND-REFERENCE-INDEX: FF=FASTLINE.Mov( ( H+L)/2.Ref(Mov( ( H+L)/2.CSELL(VAR).0 ) Start a new expert and chose highlights color red Fml( "AC RED" )AND Fml( "A Oscillator red" ) Color green Fml( "AC Green" ) AND Fml( "A Oscillator Green " ) Save as a template Anti Trigger.SSELL(VAR).SETBARS=3DAYMOVAVE. 5. S). Raschke's "Street Smarts" book's Quick Indicator Articles.( Mov(( H+L)/2. S).-1) . S).Mov( ( H+L)/2.FF(VAR). 34. 5.0) Put in the same window and plot it red as a histogram A Oscillator red If( Mov( ( H+L)/2. . <. 5. 5. {FUNCTIONS-MISC-REFERENCE-INDEX: AT0BBUY =BULLLONG AT0SSELL =BEARSHORT AT0CSELL =CLOSEBEARSHORT AT0CBUY =CLOSEBULLLONG AT0MP =MARKETPOSITION (-1=LONG,+1 SHORT) AT0LXSTOP=CLOSELONGEXITLEVEL(STOPLOSS) AT0SXSTOP=CLOSESHORTEXITLEVEL(STOPLOSS)} {INDICATOR NAME : ANTI TRIGGER} {THE FORMULA (+REQUIRED FUNCTIONS) FOR THE ANTI TRIGGER INDICATOR} AT0SETBARS:=3; AT0FF:=Stoch(7,AT0SETBARS); AT0SS:=Mov(Stoch(7,AT0SETBARS),10,E); AT0ENTRYADD:=+1; AT0EXITADD:=+1; AT0CSELL:={use in expadv or systest}{for RT del the REF-function} If(AT0FF>Ref(AT0FF,-1) AND AT0SS<Ref(AT0SS,-1),C+1,0); AT0CBUY:={use in expadv or systest}{for RT del the REF-function} If(AT0FF<Ref(AT0FF,-1) AND AT0SS>Ref(AT0SS,-1),C+1,0); AT0BBUY:={use in expadv or systest}{for RT del the REF-function} If(AT0CBUY>AT0SETBARS,H+AT0ENTRYADD,99999); AT0SSELL:={use in expadv or systest}{for RT del the REF-function} If(AT0CSELL>AT0SETBARS,L-AT0ENTRYADD,0); AT0MP:={use in expadv or systest}If(AT0BBUY<99999, -1,If(AT0SSELL>0,1,0)); {AT0LXSTOP:=}{use in expadv or systest}{for RT del the REF-function} {IF(REF(AT0MP,-1)<1 OR (REF(AT0BBUY,-1)<99999 AND H>REF(AT0BBUY,-1)), L-AT0EXITADD,0);} {AT0SXSTOP:=}{use in expadv or systest}{for RT del the REF-function} {IF(REF(AT0MP,-1)>-1 OR (REF(AT0SSELL,-1)>0 AND L<REF(AT0SSELL,-1)), H+AT0EXITADD,0);} AT0MP Are There Weekly Patterns in the Stock Market? Do price pressures build up over the weekend that cause predictable distortions in the stock market on Monday? If the market is up or down a certain number of days in a row, what are the chances it will follow the trend the next day? Is the trend on Monday reversed on Tuesday? To find out, we loaded our S&P 500 data back to 1980, and ran a test. The results were this - the trend on Monday (either up or down) was reversed 55% of the time, a fairly significant result. This might tell us that the weekend causes an emotional buildup that moves the market an excessive amount on Monday, which is then corrected by Tuesday. Larger stocks, as represented by the Dow Jones Industrial Average, reversed slightly less 54% of the time. Small stocks, as represented by the Russell 2000 (data back to 1990) showed the opposite pattern, going with the trend 60% of the time. In the futures markets, the US dollar (data back to 1990) reversed 54% of the time, and the 30 year treasury bond (data back to 1987) reversed 53% of the time. In recent years, the pattern has been less pronounced. In fact, if you study just the last two years, you get reversals of 53% in the Dow, 52% in the S&P 100, a continuation in the trend 50.5% of the time in the S&P 500 and a continuation 54% of the time in the Russell 2000 . The US dollar has reversed 58% of the time in the last two years, the CRB index 54% of the time, while other futures have shown continuation trends - 55% for gold, 54% for treasury bonds, and 55% for crude oil. Next, we studied every possible price trend for the five day period. A nice Thursday trend emerged - if Monday and Tuesday went one direction, and then Wednesday reversed this trend, there was a 62% chance that Thursday would continue this reversal (we’ll represent this as XXOO, where X just means one direction, not necessarily up or down, and O means the other direction). If the first four days of the week all moved in the same direction (XXXX), Friday had a 61% chance of doing the same (XXXXX). And if Tuesday reversed Monday, but was then reversed by Wednesday, and the trend continued Thursday, there was a 63% chance that Friday would continue the trend set Wednesday (XOXXX). The MetaStock formulas for the Tuesday calculation are included below. Formulas for the remaining days of the week build on these formulas, and are too extensive to include here (you need 2 formulas for Tuesday, 4 for Wednesday, 8 for Thursday, and 16 for Friday). To build an exploration that looks for stocks with a high incidence of Tuesday reversal, simply put the formula "Tuesday % occurrence. of XX vs. XO" in a column in the Explorer, run an exploration on all of your securities, then sort by the aforementioned formula. ====================== Formula "Tuesday XX Pattern" { Looks for XX pattern, returns +1 if it finds it } If(Ref(DayOfWeek(),-2) = 5 {2 days ago was Fri} AND Ref(DayOfWeek(),-1) = 1 {Yesterday was Mon} AND DayOfWeek() = 2 {Today is Tuesday} AND { Either both days were up or down } ((Ref(CLOSE,-2) > Ref(CLOSE,-1) AND Ref(CLOSE,-1) > CLOSE ) OR (Ref(CLOSE,-2) < Ref(CLOSE,-1) AND Ref(CLOSE,-1) < CLOSE )) , +1, { +1 if XX pattern } 0) { Otherwise 0 } ====================== Formula "Tuesday XO Pattern" { Looks for XO pattern, returns +1 if it finds it } If(Ref(DayOfWeek(),-2) = 5 {2 days ago was Fri} AND Ref(DayOfWeek(),-1) = 1 {Yesterday was Mon} AND DayOfWeek() = 2 {Today is Tuesday} AND { Tuesday is opposite direction of Monday } ((Ref(CLOSE,-2) > Ref(CLOSE,-1) AND Ref(CLOSE,-1) < CLOSE ) OR (Ref(CLOSE,-2) < Ref(CLOSE,-1) AND Ref(CLOSE,-1) > CLOSE )) , +1, { +1 if XO pattern } 0) { Otherwise 0 } ====================== Formula "Tuesday % occurrence. of XX vs. XO" { Gives the % occurrence of XX (that Tuesday goes the same direction as Monday) } Cum(Fml("Tuesday XX pattern"))/ (Cum(Fml("Tuesday XX pattern")) + Cum(Fml("Tuesday XO pattern")) ) * 100 ====================== Note that unchanged days, either Monday or Tuesday, are ignored in the calculations. by John DeBry ATR Custom Indicator periods:=Input("ATR Periods?",1,100,10); TH:=If(Ref(C,-1) > H,Ref(C,-1),H); TL:=If(Ref(C,-1) < L,Ref(C,-1),L); TR:=TH-TL; Mov(TR,periods,S) ATR Modified prd1:=input("enter ATR period",1,9999,7); prd2:=(prd1*2)-1; {max (absolute) of yesterday's close to today's high or today's low} myatr1:=Max(Abs(Ref(C,-1)-H),Abs(Ref(C,-1)-L)); {max of yesterday's close to today's high or today's low or today's range} myatr2:=Max(myatr1,H-L); ATR Trailing Stop Loss For Long: HHV(H - 2.5*ATR(5),10) For Short: LLV(L + 2.5*ATR(5),10) Furthermore, it may be beneficial to dynamically adjust the number of lookback periods in the HHV() or the LLV() function. Automatic Support and Resistance Copied from Technical Analysis of Stocks and Commodities Magazine. This is in regards to an article on page 51 of the May 1998 issue. In my article "Automatic support and resistance" in this issue, I present a computerized approach to finding support and resistance levels on a chart. To recreate the indicators and system described in my article using MetaStock for Windows, enter the following formulas: Indicators: S1: IF(Ref(LOW,-4)=LLV(LOW,9),Ref(LOW,-4),PREVIOUS) S2: IF(Fml("S1")=Ref(Fml("S1"),-1),PREVIOUS,Ref(Fml("S1"),-1)) S3: IF(Fml("S1")=Ref(Fml("S1"),-1),PREVIOUS,Ref(Fml("S2"),-1)) S4: IF(Fml("S1")=Ref(Fml("S1"),-1),PREVIOUS,Ref(Fml("S3"),-1)) S5: IF(Fml("S1")=Ref(Fml("S1"),-1),PREVIOUS,Ref(Fml("S4"),-1)) S6: IF(Fml("S1")=Ref(Fml("S1"),-1),PREVIOUS,Ref(Fml("S5"),-1)) WSO: 100*(1¬(Int(Fml("S1")/CLOSE)+Int(Fml("S2")/CLOSE) +Int(Fml("S3")/CLOSE)+Int(Fml("S4")/CLOSE) +Int(Fml("S5")/CLOSE) +Int(Fml("S6")/CLOSE))/6) R1: IF(Ref(HIGH,-4)=HHV(HIGH,9),Ref(HIGH,-4),PREVIOUS) R2: IF(Fml("R1")=Ref(Fml("R1"),-1),PREVIOUS,Ref(Fml("R1"),-1)) R3: IF(Fml("R1")=Ref(Fml("R1"),-1),PREVIOUS,Ref(Fml("R2"),-1)) R4: IF(Fml("R1")=Ref(Fml("R1"),-1),PREVIOUS,Ref(Fml("R3"),-1)) R5: IF(Fml("R1")=Ref(Fml("R1"),-1),PREVIOUS,Ref(Fml("R4"),-1)) R6: IF(Fml("R1")=Ref(Fml("R1"),-1),PREVIOUS,Ref(Fml("R5"),-1)) WRO: 100*(1¬(Int(Fml("R1")/CLOSE)+Int(Fml("R2")/CLOSE) +Int(Fml("R3")/CLOSE)+Int(Fml("R4")/CLOSE) +Int(Fml("R5")/CLOSE) +Int(Fml("R6")/CLOSE))/6) The indicators S1 through S6 and R1 through R6 should be plotted as points and not as a continuous line. Trading System Formulas and Parameters: Enter long positions on either building support or sustained uptrend and exit position using stops. No short positions. Enter Long: Fml("WSO") > Mov( Fml("WSO") , 4 , S ) OR Mov( Fml("WRO") , 30 , S ) > 95 Stop Out: Breakeven stop: Floor level at 2% Trailing stop: Profit risk of 10 Percent, ignoring 10 periods Maximum loss stop: Maximum loss of 7% Other Conditions: Initial equity = 1000, Long positions only, Trade price = close, Trade delay = 0, Entry commission = 0%, Exit commission = 0%, , Interest rate = 5%, Margin req. 100% Average Dollar Price Volatility Exploration-Deel This exploration is designed to provide the average dollar price volatility figure in column F. This will find this figure for all stocks scanned. It is most useful to apply this just to an exploration of a small group of stocks. It matches the steps in Deels book The Strategic Electronic Day Trader. Col A: day 1 HIGH - LOW Col B: day 2 Ref((HIGH-LOW),-1) Col C: Ref((HIGH-LOW),-2) Col D: Ref((HIGH-LOW),-3) Col E: Ref((HIGH-LOW),-4) Col F: (H - L + (Ref(H,-1) - Ref(L,-1)) + (Ref(H,-2) - Ref(L,-2))+(Ref(H,-3) Ref(L,-3)) + (Ref(H,-4) - Ref(L,-4))) / 5 Average Dollar Price Volatility Indicator-Deel 9 MACD and was made popular by Chris Manning. 5. high values typically lead to higher prices three to twelve months later. and change is taking place on the New York Stock Exchange while ignoring the direction prices are headed. E)). 2.-4) . The MetaStock™ formula for the Absolute Breadth Index is: ABS ( Advancing Issues .Declining Issues ) To plot it: • Create a composite security of the Advancing Issues . Double click the indicator to open the properties dialogue box. Stock Market Logic. 60.5).LastValue(Z). After applying the 5 35 5 MACD indicator to your chart.-1)) + (Ref(H. the 5. 5. Day:=Cum(1)+1.-2))+(Ref(H.L + (Ref(H. In Mr. .Mov(C.26. 35. Fosback.35.Ref(L. volatility. Fosback's book.Mov( CLOSE. The ABI shows how much activity.3)) + (Ref(H. E))-(Mov((Mov( CLOSE. Click OK Absolute Breadth Index The Absolute Breadth Index (ABI) is a market momentum indicator that was developed by Norman G.35. This is a modified simple moving average.5 of MetaStock for Windows 95& NT only and cannot be written in previous version. The formula will prompt you for input for the number of time periods to use in the moving average.5 MACD is a variation of the standard 12.-1) . 3. while low readings indicate lack of change.C.Ref(L. he indicates that historically.S). (H .PREV+(MV*(CPREV)))) 5 35 5 MACD The 5. You can think of the ABI as an "activity index". E) . Kaufman Chapter 4 . select the histogram setting (second from the bottom).Ref(L. 4.5. Select the Color\Style tab and using the Style drop-down list. 1.If(day=(Z+2). use the following steps to create a histogram with vertical line at zero.Ref(L.Declining Issues.5 MACD will appear as a solid line with no horizontal line at the value of zero. Select the Horizontal Lines tab and enter a value of zero (0) for the horizontal line value. 35. This formula is for version 6. by Perry J.1000. MV:=(1/Z).-3) .-2) . Z:=Input("Periods". In Windows versions use The DownLoader™ to create the composite or in the DOS versions use MetaStock's File Maintenance to create the composite.This indicator plots the value on the chart display. pg.2. Click Add. It is useful only as a quick method of attaching the volatility value to the stock. High readings indicate market activity and change. who uses it to identify major market divergence points: ((Mov( CLOSE. Apply this with caution and make sure that the new scale display is also included.E))) When first plotted on a chart. If(Day<(Z+2).Moving Averages.-4))) / 5 Average-Modified Method From The New Commodity Trading Systems and Methods. E) Mov( CLOSE. -1)-L.-1)<Ref(L. MinusDM:=If(L<Ref(L. • Create a NEW INNER WINDOW on the declining issues chart.-1)-L. Follow these steps once and save as a CHART.If(H>Ref(H. The requirement is: Each security must have both the number of issues and the volume in the file. Advance Decline Line with Negative Volume There is a way to get the negative volume on an advance-decline line chart in MetaStock™ for Windows™. DIDif:=Abs(PlusDI-MinusDI). PlusDI:=100*Wilders(PlusDM. • Copy the volume from the advancing issues chart and paste it into the new inner window on the declining issues chart. Ref(L.Periods)/ATR(Periods).14).-1)-L.Periods)/ATR(Periods) . • Create a NEW chart of the advancing issues. which is the advances .• In MetaStock open the composite and plot the custom formula ABS( C ) on it.1. ADXFinal ADXR Custom Periods:=Input("Time Periods". These custom indicators calculate the same way except they do not round as Wilder does.If(H >Ref(H. • Copy that plot to the empty inner window (where the volume was) of the advance-decline composite. Ref(L.Periods).-1). ADX / ADXR Custom (without Rounding) Here are custom ADX and ADXR formulas that will plot the decimals after the calculation. P-V on the advancing volume plot in the declining issues chart.-1) AND H<=Ref(H.0)). .-1).-1) AND H-Ref(H. When you want to use it simply load the chart and the program will calculate the new volume plot using the new data.mwc).1. ADX Custom Periods:=Input("Time Periods".-1) AND L<Ref(L. • Delete the volume plot on the advance-decline composite chart.-1).-1) AND L>=Ref(L. PlusDM:=If(H>Ref(H. The following steps will get you an advance-decline line with negative volume where applicable. • Drop the custom formula. Advancing issues with advancing volume in one security and declining issues with declining volume in one security file.-1)> Ref(L.declines. You will also need to create a composite security of the Advance-Decline line. MinusDI:=100*Wilders(MinusDM.100. ADXFinal:=100*Wilders(DIDif/DISum.14). DISum:=PlusDI+MinusDI.100.-1) AND L<Ref(L. New Concepts in Technical Trading Systems. • Create a NEW chart of the advance-decline composite. These files may be obtained from Reuters Trend Data by way of The DownLoader for Windows. H-Ref(H. • Save that chart as the adv-decl chart (perhaps advdecl. This will be the chart you load to do your study of the advance-decline line with negative volume. creating a new scale.-1).-1) AND H-Ref(H. The built-in indicators plot exactly as Welles Wilder plots them in his book. • Create a NEW chart of the declining issues.-1)-L. H-Ref(H.0)). Ref(L.-1)>Ref(L.If(H>Ref(H. H-Ref(H. is a market indicator that shows the relationship between the number of stocks that increase or decrease in price (advancing/declining issues) and the volume associated with stocks that increase or decrease in price (advancing/declining volume). if more volume is associated with declining stocks. MinusDM:=If(L<Ref(L. number and volume and Declines. The tickers are NYSEI (Advances)use the cusip 00000157 rather than the symbol.NYSE-D (Declines. The tickers are @*NAZ_K and @*NDZ_K. Advances. H-Ref(H. DISum:=PlusDI+MinusDI.NYSE-A (Advances. DIDif:=Abs(PlusDI-MinusDI). Ref(L.LastValue(1-periods)))/2. .-1).Periods)/ATR(Periods) .-1)-L.PlusDM:=If(H>Ref(H. in 1967.Periods). ADXRCustom Arms Index (TRIN) The Arms Index. The tickers are X.-1).-1) AND H-Ref(H. NYUP (Advance volume) and NYDN (decline volume).0)). number and volume).-1) AND L<Ref(L. ADXFinal:=100*Wilders(DIDif/DISum.-1)-L. number and volume) and X.0. The Arms Index was developed by Richard W. o Advancing Issues / Declining Issues o Advancing Volume / Declining Volume • In MetaStock open both composites.-1)<Ref(L.0. the Index will be greater than 1. • CompuServe supplies this data in 4 files. • Reuters Trend Data (RTD) supplies this data in two files. Jr. The formula for the Arms Index is: (Advancing Issues / Declining Issues) / (Advancing Volume / Declining Volume) To calculate the Arms Index in MetaStock™ for Windows you will need to first collect the four pieces of data. • Create and plot the custom formula: C/V • This gives you the Arms Index (TRIN). PlusDI:=100*Wilders(PlusDM. • Tile the charts so they can both be viewed. NYSEJ (declines).-1) AND H<=Ref(H.-1) AND H-Ref(H. • In MetaStock open the composite. The Arms Index is primarily a short term trading tool. ADXRCustom:= (ADXFinal+Ref(ADXFinal. For data from CompuServe • In the DownLoader create the two composites.-1) AND L<Ref(L.Periods)/ATR(Periods). If more volume is associated with advancing stocks than declining stocks. • Dial/Data also supplies this data in two files.-1) AND L<=Ref(L.-1)-L. number and volume.0)).-1). MinusDI:=100*Wilders(MinusDM.-1). After the data has been collected follow these steps: For data from RTD or Dial Data • In the DownLoader™ create a composite security of the Advances / Declines. The Index shows whether volume is flowing into advancing or declining stocks. the Arms Index will be less than 1. also known as TRIN.If(H>Ref(H.-1)-L. Arms. -8 ) = LLV ( L .13 .5). in MetaStock 6. 14 ) . Aroon Indicators.-1) = LLV( L . If ( Ref (L .10) AND HIGH> = Peak(1.If (Ref (L .3 ) = HHV(H .0 for Windows.-10 ) = HHV(H .14 ) .2) = 2. If ( Ref (L .• Drag the plot of the Adv. Volume/Dec.If (Ref (H .-10) = LLV (L.8 .11 . Volume plot will turn a purplish color to signify the formula will be plotted on it).If (Ref (H .14 ) .-8 ) = HHV(H .14) .7 .-7 ) = HHV(H .14) .1) + .13 .14 ) .5 .-13) = HHV(H .-11) = LLV( L.6 .2) = 2.2).-6 ) = LLV( L.10 .-2 ) = LLV ( L...1 .14 ) .6 . • Create the custom formula: C/P • Plot this formula on top of the Adv. If (Ref (H .If (Ref ( L .-1) = HHV(H . Volume plot (the Adv. The Arms Index.If (Ref (H . You will know have the Arms Index (TRIN) plotted.14 ) .If (Ref (H.20.If (Ref (H .7 .14 ) .14 ) . you can alter this by replacing every entry of 14 with the desired time period. Issues/Dec.1 .12 .-5 ) = LLV ( L .14) .2 . choose System Tester from the Tools menu.E).14 ) . You can drag it to its own inner window if you prefer. 2/20 Day EMA Breakout System To create the 2/20-Day EMA Breakout System by David Landry in MetaStock for Windows.If (Ref (H .14) .-9 ) = LLV( L.5) * HHV(H.14 ) .14 ) ..4 .-9 ) = HHV(H .-2 ) = HHV (H .( ( If (Ref (H .Cross(Sum(L > Mov(C.If (Ref ( L .-11 ) = HHV(H .0 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) / 14 The Aroon Oscillator = Aroon up .9 .If ( Ref (L.12. Volume/Dec.-6 ) = HHV(H .20. If (Ref (H .2 .14 ) .14) .8 . For interpretation refer to Mr.-5 ) = HHV(H .If (Ref (H .5 .If ( Ref (L .If (Ref(H .14 ) .Aroon down.If (Ref (H . Arms book.If ( Ref ( L.14 ) . The Aroon down: 100* (14 .14 ) .-14) = LLV( L.-4 ) = LLV ( L .14 ) . 11 . ** These are constructed using 14 time periods.14 ) . Note: The Aroon indicators are built in indicators.If (Ref(L.-4 ) = HHV(H .If ( Ref (L .20.14 .0) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) / 14 The Aroon up: 100 * ( 14 .3 . 95 Technical Analysis of Stocks & Commodities magazine.10 .If (Ref (L .E). Now choose new and enter the following system test rules and options: Signal Formulas Enter Long Alert(Cross(Sum(L > Mov(C.5)) < BarsSince(LOW <= Mov(C.-14 ) = HHV(H .If (Ref( L . Issues chart.If (Ref (H .20.-12 ) = HHV(H . ** The UP and DOWN Aroon indicators are to be plotted in the same innerwindow.-12 ) = LLV(L .-7 ) = LLV ( L.14 ) .If ( Ref (L.-13) = LLV (L .14 ) .001{10 ticks} AND BarsSince(Cross(Sum(L > Mov(C.3.14 .(( If (Ref (L.9 .14 ) ..3 ) = LLV( L.If (Ref (H .4 . Volume/Dec..14 ) . Volume composite into an inner window in the Adv.2) = 2.E)) . by Tushar Chande For interpretation of the Aroon indicators refer to Tushar Chande's article "Time Price Oscillator" in the September.14 ) .E).14 ) . 854*LinearReg(C.13) > CFlow .618*LinearReg(LinearReg(LinearReg(C.5).11).20.236*LinearReg(LinearReg(C.(2.13).11).If(Round( (6.13).E).854*LinearReg(C.5*ATR(13)) .11).7) +1.13).LinearReg(C.E) • Initial equity Points Only • Positions Long and short • Trade price Close • Trade delay 0 Please note the {10 ticks} comment in the system rules.7) +1.2) = 2.001{10 ticks} AND BarsSince(Cross(Sum(H < Mov(C.7) +1.. You should change this value based upon the commodity your testing.3)) /16.E)) Close Short HIGH >= Mov(C.20.Cross(Sum(H < Mov(C. translated from TradeStation code MetaStock -> Tools -> Indicator Builder -> New Copy and paste all formulae below.13) +4.7).11).618*LinearReg(LinearReg(LinearReg(LinearReg(C.13) +4..1) . The value used in these rules is for most currencies.Round( (6.13).326*100)/100 > PREV .618*LinearReg(LinearReg(LinearReg(C.7)..13).5)) < BarsSince(HIGH >= Mov(C.20.7).20.11) +2.13).20.20.13).11) +2.854*LinearReg(C..11).13) +4. RorPlot1 If(Round( (6.(2.236*LinearReg(LinearReg(C.11).11).5).Close Long LOW <= Mov(C.3)) /16.11) +2.5).2) = 2.5) +LinearReg(LinearReg(LinearReg(LinearReg(LinearReg(C.13).13)) RorPlot2 Tperiod:=13.E) Enter Short Alert(Cross(Sum(H < Mov(C.13).326*100)/100 .10) AND LOW< = Peak(1.13).618*LinearReg(LinearReg(LinearReg(LinearReg(C. Plot only last formula.3)) /16.7).618*LinearReg(LinearReg(LinearReg(C.11).618*LinearReg(LinearReg(LinearReg(LinearReg(C.PREV) .13).E).5) * LLV(L. Alan Hull's Rate of Return Indicator.236*LinearReg(LinearReg(C.E).11). If( Sum(WC()*V.5).13).326*100)/100 .5*ATR(13)) > PREV .5) +LinearReg(LinearReg(LinearReg(LinearReg(LinearReg(C.2).5) +LinearReg(LinearReg(LinearReg(LinearReg(LinearReg(C. CFlow:=100000.7).7).2) = 2. True & Reverse { True.13)-LinearReg(Ref(WC().} { user input } plot:=Input("[1]True ATR.0).1).13.1). pdsN:=Input("normalizing periods (1=none)".-1).3).8).8). [3]Both.3).-1) > 24} {Invalid circular reference!} AND Fml("RorPlot1") >= Ref(Fml("RorPlot1").0.21.21.13) +LinearReg(LinearReg(LinearReg(LinearReg(LinearReg(WC().13) {-Ref(WC().5).13. 100*((LinearReg(WC().13) +LinearReg(LinearReg(LinearReg(LinearReg(LinearReg(Ref(WC(). [0]No".1.-1) > Fml("RorPlot1") {OR Ref(Fml("RorPlot3").Tperiod) = Tperiod-1 AND PREV = 0 AND Mov(WC(). [4]MS-ATR".13) +LinearReg(LinearReg(WC().13) )/5 > (LinearReg(Ref(WC().If(PREV > Tperiod-2 AND Mov(WC().Tperiod-1 .13) +LinearReg(LinearReg(LinearReg(LinearReg(Ref(WC().13))/LinearReg(WC().S) >= Mov(WC().5).13) > CFlow OR Ref(Fml("RorPlot1"). pds:=Input("Average True Range periods".3).AND (LinearReg(WC().13.-1) < 25} {Invalid circular reference!} . Reverse & MetaStock ATR v3.13) +LinearReg(LinearReg(LinearReg(WC().-1).13) +LinearReg(LinearReg(LinearReg(Ref(WC().-1).13) +LinearReg(LinearReg(LinearReg(LinearReg(WC(). smooth:=Input("Sine-weighted smoothing? [1]Yes. .0 }{ ©Copyright 2004 Jose Silva } {
[email protected])) ATR .S) OR Sum(WC()*V.S) > Mov(WC().1).com } { Reverse True Range is the the *smallest* of the following for each period: * The distance from today's High to today's Low.-Fml("RorPlot2")) <--MS cannot handle variables in Ref function!} -Ref(WC().1.S) > Mov(WC().8).2).3).0.21.10).1.PREV+1 .252.1.8).51).13)).8).If(Mov(WC(). [2]Reverse ATR. * The distance from yesterday's Close to today's Low.2520.5).-1) .13))).PREV))) RorPlot3 Round( If(Fml("RorPlot2")>0.8).-1).5). If(Fml("RorPlot2")<52.8).8).13))/5 AND LLVBars(WC().2).S) {AND Ref(Fml("RorPlot3").-20)) {<-.13) +LinearReg(LinearReg(Ref(WC(). * The distance from yesterday's Close to today's High.5).5).S) .4.replaced with 20 period Ref function!} /LinearReg(WC(). (5200/(Fml("RorPlot2")+1))*((LinearReg(WC(). -1) +Sin(90)*Ref(ATRplot.ATRrev. ATRmeta:=Mov(TrueRange.pds.000001).-4)) /(Sin(30)*2+Sin(60)*2+Sin(90)).1.pdsN)LLV(ATRrev.pds*2-1.E).-4)) /(Sin(30)*2+Sin(60)*2+Sin(90)).ATRplot).If(plot=4. event points [2]".-2) +Sin(60)*Ref(ATRplot.-1) +Sin(90)*Ref(rATRplot.2.pdsN)+.pdsN)LLV(ATRraw. time2:=C=LLV(C. time2:=time2 AND time2<>time1. ATRrev:=Mov(RevTrueRange. dateA:=If(LastValue(Cum(dateA))=0.1.ATRmeta. {alternative events} dateA:=Year()=2004 AND Month()=1.(Sin(30)*ATRplot +Sin(60)*Ref(ATRplot.Min(Abs(x1-H).-3) +Sin(30)*Ref(rATRplot.E). ATRplot 2-point plot { 2-point plot.pds.C).pdsN)+. RevTrueRange:=Min(H-L.ATRtrue))).(Sin(30)*rATRplot +Sin(60)*Ref(rATRplot. { normalize ATR } ATRraw:=If(plot=1.Abs(x1-L))).E). Year()=LastValue(Year())-1 .1).000001).rATRplot). TrueRange:=Max(H-L. ATRplot:=If(pdsN<2. { plot ATR } If(plot=3.ATRnorm).2.ATRraw.ATRtrue.-2) +Sin(60)*Ref(rATRplot. { average True Range } ATRtrue:=Mov(TrueRange. rATRplot:=If(pdsN<2.1. choose:=Input("plot: trendline [1].pdsN))/(HHV(ATRrev. {define events} time1:=C=HHV(C.1).com } plot:=Input("choose event trend [1~2]".RevTrueRange.ATRplot).pdsN))/(HHV(ATRraw.If(plot=2.rATRnorm). rATRplot:=If(smooth=1. { optional sine-weighted smoothing } ATRplot:=If(smooth=1.-3) +Sin(30)*Ref(ATRplot.Max(Abs(x1-H).5 }{ Trendline choice 1: last High/Low in month }{ Trendline choice 2: lows at Jan/June 2004 }{ ©Copyright 20032004 Jose Silva }{ josesilva22@yahoo. rATRnorm:=100*(ATRrev-LLV(ATRrev.rATRplot.Abs(x1-L))).{ define True Range } x1:=ValueWhen(2. coding example v2.21).21). ATRnorm:=100*(ATRraw-LLV(ATRraw. time1. {choose events} time1:=If(plot=1.time2.time1.price2). y2:=LastValue(ValueWhen(1.time1+time2) Backdating Metastock Explorations Perhaps the above is enough for many traders.price1). b1:=LastValue(BarsSince(x1)). time2:=If(plot=1. time2:=time2 AND Cum(time2)=LastValue(Cum(time2)). but a few further MetaStock nuances can add to the value of the information you've uncovered. x2:=If(t1pds>=t2pds. b2:=LastValue(BarsSince(x2)). You can now make alterations to your Exploration. timeB:=dateB AND L=LastValue(LoValB).time2). LoValB:=Lowest(ValueWhen(1.plot.L).dateA).y1). x1:=If(t1pds>=t2pds. 1.L)).timeA).time1). timeB:=timeB AND timeB<>timeA.timeB). price2:=If(plot=1.C. y2:=If(t1pds>=t2pds. highlight your "Moving Average Crossover" Exploration.price2.b2). For example. dateB:=Year()=2004 AND Month()=6.L). {sort events} t1pds:=LastValue(BarsSince(time1)).dateB. say. t2pds:=LastValue(BarsSince(time2)). and hit the "edit" key this time. timeA:=dateA AND L=LastValue(LoValA).x2.dateB). five days? And wouldn't it be handy to be able to sort your newly discovered stocks in order of price or volume? If so.time2. Go back to the main Explorer tool section. dateB:=If(LastValue(Cum(dateB))=0.dateA. LoValA:=Lowest(ValueWhen(1. Year()=LastValue(Year()) AND Month()=LastValue(Month()).000001). {fix coordinates} y1:=ValueWhen(1. y1:=If(t1pds>=t2pds. {trendline definition} plot:=y1+BarsSince(x1)*(y2-y1)/(b1-b2+.{rem to extend plot} If(choose=1.C.L)). {restrict to last events} time1:=time1 AND Cum(time1)=LastValue(Cum(time1)). read on for a few more simple tips.-b2). Ignore the upper "Notes" .price1.x1.y2)). wouldn't you like to know which stocks have met the chosen crossover criteria in the past.AND Month()=LastValue(Month()). plot:=Ref(Ref(plot. price1:=If(plot=1. 2) .e) Barnes' Adaptive Forecast Based on the premise that closing price may be predictable based on previous . From the 1981 Technical Commodity Yearbook. Number ) where "A" is any formula you care to choose.20. 2.e)<-0. This may indicate an upcoming stall or turnaround. you can easily sort by price (c) or volume (v). Finally. which is written "Alert( A .2).0)) formula 2: mov((c-ref(c. if(mov(fml("Barnes' acceleration".-1).E) ) . The number of days needed may be different depending on the type of issue. The result is: "Alert( Cross( Mov(C. Follow the examples given by all the kind and clever MetaStock users who have gone before you. entitled "Col Name. Examine the chart for prolonged values at -1.2).0001. The way you have it set up initially tells MetaStock to find all stocks which meet the criteria today. change "s" to "e" in the formulas. click on the "Filter" tab again to slightly modify your Exploration formula." Simply put a "c" in the large formula section and "Close" in the column name section. investigate how they're written. A utility stock may need to sustain the -1 level for 10 days whereas a highly volatile technology stock may need to sustain the -1 trend for as little as 5 days. Repeat these actions for Column B. Save your new Exploration with the "OK" button and you're ready to find all stocks whose 3 day moving average passed above the 10 day moving average in the past five trading days! The above information should allow you to write further Explorations by simply changing the numbers.-1. with "v" and "Volume" respectively. You can also open up the ready made Equis Explorations.5)" without the quotation marks. Mov(C. Barnes formula 1: if(mov(fml("Barnes' acceleration". and change them with the "Edit" command (then saving with a new name).-1). Robert M. tweak. A further step is to investigate the hundreds of formulas available here on this web site and modify them in the same way.2) ref(fml("Barnes' acceleration".10.3. and tweak. Barnes' Accelleration The Barnes' Acceleration measures rate of price change as opposed to price levels If the Barnes' Acceleration sustains the value of -1 for many days then the security may be ready to show strong trend or it may already be trending. Now when your Exploration presents you with your data. So now you put your original formula in the place of A.20.daysm.0001. The answer is the MetaStock Alert function. and "Number" is the number of days. If you prefer to use Exponential Moving Averages instead of Simple Moving Averages.e)>0.-1). You will see a large white field for entry of formulas and a small field in the lower left.ref(fml("Barnes' acceleration".section and click on Column A first.E) . This is the quick and easy way to learn how to program with MetaStock. You now want it to find all stocks that have met these criteria over the past five days.-1))/ref(c.1. tweak. 1.-1)) (fml(" BPDL Trend Filter") .-1).Mov(Mid(C.opt4.opt1).(ref((fml(" BPDL Trend Filter")).E).E).ref(mov(c.opt2.21)) .if(fml("Barnes' adaptive forecast". e) > pf.opt1. opt1).2)).-1).%)<15)<=5 ANDBarsSince(Stoch(9. >= .opt1.0)) formula 2: mov(c.opt2. Barnes Van Nostrand Reinhold 1981) for theory and applications.-1) Barnes' Moving Average See (1981 Technical Commodity Yearbook Robert M.E).closes See (1981 Technical Commodity Yearbook Robert M.. e) .21.1.Ref(Mov(Abs((Mo(opt3))). Barnes Van Nostrand Reinhold 1981) for theory and applications.1.1)).-1).<. (Ref(Mov((Mid(C.>.2))+1). { Then } -1.-1)))AND When(Mov(Abs((Mo(opt3))). <= .opt2.e) .E).opt1.-1) * pwr(((mov((pwr(C-ref(C.2)>0. { Else Action } if ( mov( c.opt4. formula 1: if(fml("Barnes' adaptive forecast".dayf.-1.21))) BUY -1 SELL 1 Bearish Engulfing Pattern Col A: CLOSE Filter BarsSince(EngulfingBull())<=5 AND BarsSince(ROC(C. opt1). { Then Action } 1.>.05.-1)) enter short When(Mov( Mid(C.mov( c.5))) * if ((C>ref(C.-21))) / ((hhv(fml(" BPDL Trend Filter").E). if (c .Mov(Mid(C. opt1) . dayf. dayf.1)<10)<=5 Filter enabled Yes Periodicity Daily Records required 1300 Bianchi Approach enter long When(Mov( Mid(C.5)) + ((pwr(((pwr(C-ref(C.s))+1).2)<-0.05.opt1.E))AND When(Ref(Mov(Mid(C.s))>0. opt1) .E))AND When(Ref(Mov(Mid(C..21.e). { Else } 0)) { Notice that comments may be placed within braces } BDPL Trend Filter cum ((if ((mov((C-ref(C.(llv(fml("BPDL Trend Filter").1).opt1).E).E).dayf.c > pf. .-1)).60.opt1)). E).233.34)/C.opt2.21. Therefore my binary wave formulas are: BW2 Demand Index If(Tema(DI().-1.21.55. positive is bullish and negative is bearish.0)) BW6 Money Flow If(Tema(MFI(21).If(Tema(CMO(C.21) > 5.-1.%) Filter: (ROC(C.If(Mov(C.opt4.5) = LLV(Mov(C.+1. If(Tema(CCI(21).21).VAR) > Mov(C.+1.0)) BW7 CMO If(Tema(CMO(C.VAR).0)) The next formula just adds up the binary wave. Then you add them all up for your binary wave indicator.-1)))AND When(Mov(Abs((Mo(opt3))).0)) BW3 Linear Regression Slope If(Tema(10000*LinRegSlope(C.21) < -13.VAR) < Mov(C.+1.-1. minus one for a bearish indication.21)-50 < -5.+1.21) > 5.233.If(Tema(MFI(21). I decided to format all my indicators so they could be plotted as a histogram.E).VAR).%)<-10) AND C>5 Filter enabled: Yes Binary Wave System Test for Metastock {created by Jim Greening} The basic idea behind a MetaStock binary wave is to use "if" statements on several MetaStock indicators and have them return plus one for a bullish indication.VAR).21) > 5. For these indicators plotting as histograms.opt1)). To cut down on whipsaws.233.+1.-1.%)>10 OR ROC(C.34) > 5. under -13 would be bearish and anything in between would be neutral.21.1.34) < -13. I decided that over +5 would be bullish.21) > 2.%).0)) BW5 ROC If(Tema(ROC(C.21.5.13).VAR) AND HHV(Mov(C.21)-50 > 5.5.(Ref(Mov((Mid(C.VAR) AND LLV(Mov(C.5) = HHV(Mov(C.21)< -2.If(Tema(DI().55.E).opt4.-1.VAR).21) < -13.If(Tema(ROC(C.Ref(Mov(Abs((Mo(opt3))).-1.+1.+1.0)) BW4 CCI If(Tema(CCI(21).%). If(Tema(10000*LinRegSlope(C.>.34)/C. and zero for a neutral condition.21).13).-1)) OPT 1: 5 to 20 step 1 OPT 2:10 to 16 step1 OPT3:5 to 15 step 1 OPT4:20 to 29 step 1 but you are free to change any value of OPT! Biggest Losers Col A: CLOSE Col B: ROC(C.5.0)) BW8 VAR ma If(Mov(C.21) < -5. .233. The formula I finally came up with after a lot of tinkering follows.21) AND HHV(Tema(Qstick(34).13) AND Mov(H.6.21) > 0. you could also use a rise from a negative peak (or trough) as a buy signal and a fall from a positive peak as a sell signal. Of course. The formula is: Periods := Input("Enter Periods".VAR) > Mov(H.21)>0. Therefore my buy signal became: Enter Long Alert(Cross(Fml("Tema Binary Wave Comp"). QStick was developed by Chande as a way to quantify candlesticks. If you had a good algorithm.S)).8.34).8. QStick is simply a moving average of that difference. For confirmation I use the QStick function and a variable moving average function. Tema(Qstick(Periods). Tema Binary Wave Composite Periods := Input("Enter Tema Smoothing Periods". I decided to add an amplifier that would get larger as the trend got stronger. Since in general black candles are bearish and white candles are bullish.0.34).3. I decided to use Rsquared as a measure of trend strength and base my amplifier on Fibonacci numbers. Then they are summed and smoothed.21) > 0.4. and -1 when bearish.VAR) . I decided to use a 8 day moving average of the BW with a crossover of the BW for my algorithm in an attempt to get an early signal on a rise from a negative peak. Mov(Fml("Tema Binary Wave Comp"). Remember.Periods) The final step is to come up with a system test for the Tema Binary Wave Composite.5)))) The last step in constructing the binary wave was to decide on the smoothing and put it all together. It does have the disadvantage of finding way too many peaks so I only use it as an Alert. this indicator can also be plotted as a histogram and interpreted the same was as the Binary Wave.2.233.21) > 0.If(RSquared(C.If(RSquared(C.2. Negative values of QStick correlate to black candlesticks.233.1.21.55.1. Since I like Fibonacci numbers.8. BW Amplifier If(RSquared(C. 0 when neutral. Since the whole purpose of this test is to catch a trending stock. Also a rising number is bullish and a falling number is bearish. positive values to white candlesticks. So in general a positive value is bullish and a negative value is bearish. I used tema smoothing. Therefore you could use a zero crossover to the upside as a buy signal and a crossover to the downside as a sell signal. If(RSquared(C. the binary wave is just made up of a bunch of technical indicators that I give a +1 value when bullish. I have to have both the QStick rising and the 21 day vma greater then the 55 day vma.Periods) Now to get my open long signal I use the ALERT signal with an 8 day vma BW crossover of the BW. Then to actually get the signal.21). I decided to do something a little different.34). Tema(Fml("BW Add")*Fml("BW Amplifier").5.5) = HHV(Tema(Qstick(34). Since the difference between the open and close prices lies at the heart of candlestick charting.BW Add Fml("BW2") + Fml("BW3") + Fml("BW4") + Fml("BW5") + Fml("BW6") + Fml("BW7") + Fml("BW8") Next. Since the market has an upward bias.VAR). I decided that the BW being less than a negative number would be my primary close long signal.1 AND C < Ref(L.34) < 0 AND LLV(Mov(L.} {Here is the code:} Lb:=Input("Look-Back Period?". my sell signal became: Enter Short Alert(Cross(-opt2. This simply calculates the momentum of the closes above the opens versus the closes below the opens.34) < -0.VAR). but I also wanted confirmation from other indicators. Mov(Bm.-1) AND Mov(L.VAR) Then I wanted exit conditions that were less then full signal reversals.34) > 0.S) Bollinger Band Confirmation . I still used QStick and vma to confirm and also added that the close should be lower than yesterdays low. Bup:= Sum(B > 0.8) AND Tema(Qstick(34). If this oscillator is above 70 then the whites (Candle-sticks) dominate and below 30 the blacks are dominant.3.55.OPEN. Max 13.Fml("Tema Binary Wave Comp")). Bdn:= Sum(B < 0. BM:=(Bup/(Bup+Bdn))*100.VAR) < Mov(L. I wanted a crossover of an optimized negative number. closing prices will be higher than opening prices and vice-versa for down.} {I also added a 3 day moving average to the calculation (for smoothing).60. Therefore. Therefore instead of trying to catch a fall from a positive peak as my sell alert.13) Close Short Fml("Tema Binary Wave Comp") > 0 AND Tema(Qstick(34).3.21.5) = LLV(Mov(L. Lb). Step 5 Opt 2: Min 3.21. Lb). After a lot of trial and error I used the following: Close Long Fml("Tema Binary Wave Comp") < -opt1 AND Tema(Qstick(34).08 Finally I also used Fibonacci numbers for my optimization: Opt 1: Min 3. I wanted my sell signal to be more restrictive. Step 5 Body Momentum {I was reading in Perry Kaufman's latest book and he described a little oscillator he called "Body Momentum".21.14). Max 13. B:=CLOSE . The theory is that as prices move up. Mov(C.2 Under "properties". C > LowerBB AND Ref(C. I think this is a much better view of the bands. The following is the picture I draw: ((C+2*Std(C. I then drop in +2 and -2 (because I'm not bright enough to program them in permanently)..20))).20)) . Chaikin Oscillator basics are that a healthy trend will be confirmed by a healthy. a diverse accumulation/distribution line.3. for traders trying to understand Bollinger's "envelopes". is a very good alternative to the OBV (On Balance Volume) indicator. Bollinger Bands 2 I am sure Steve has done something better.From: Ton Maas According to most analysts. As the price moves up and down as a % of the band width. positive volume development in the trend direction. The MFI (Money Flow Index) can also substitute for the Chaikin Oscillator. all the classic applications of other "oscillator type" indicators work well (divergence.S)+2*Stdev(C. C < UpperBB AND Ref(C. I find this the most useful application of Bollinger's formula.20))/(4*Stdev(C.E)-Mov(cum(((C-L)-(H-C)/(H-L))*V). and overbought/oversold conditions when the price exceeds the Standard Dev.20)))*4 .20.10.20.S)) / (4*Std(C. of +/-2).-1). but. This is just one of ten indicators that I use ..20) .-1) > Ref(UpperBB. Chaikin Oscillator formula: Mov(cum(((C-L)-(H-C)/(H-L))*V).20. the Chaikin Oscillator.S) -(2*(Std(C.-1).-1) < Ref(LowerBB. cleaner view which allows the technician to analyse the underlying issue without the "squiggles".S) +(2*(Std(C. I think this reconfiguration gives a simpler.E) Bollinger Band Histogram Karnish Recently.20. Bollinger Bank Hook Up and Hook Down I use the following indicators to show the price reversal of Bollinger Band penetration: Name: Upper BB Hookdown Formula: UpperBB:= Mov(C.20))). support/resistance. Name: Lower BB Hookup Formula: LowerBB:= Mov(C. but here is a simple (MetaStock) formula allowing you to draw Bollinger Bands as an oscillator: 100*(C-Mov(C. the "group" was able to supply me with the formula for making a Histogram out of the "bands". -7)>ref((mov(Close.20. Although I think BWI extreme lows are an interesting way to find low risk / low volatility stocks.062*(mov(c.2)) and ref(close.14.s)))) Bollinger Band Width John Bollinger describes BWI (Band Width Indicator) as the width of the bands divided by the average of the price: 4*(std(C. or rather in an horizontal trend where the Bollinger Bands normally represent support and resistance levels.E)*100). E .Bollinger Bands Formula 7 Day enter long high>(mov(Close. 70. it is often retesting a previous support or resistance level.14))). A further remark is that when the stock enters a low-BWI period. 2) .S)-std(Close. so I have concocted a simple one to suit my own needs: "Band Width" = BBandTop(C.S)+std(Close.14. 70.S)+std(Close.20.14))).14)) /(HHV(RSI(14).E)*100<70 and ref((Mov((RSI(14).14)) /(HHV(RSI(14).20. E . there are cases where the stock is just pausing before resuming a trend.14)-(LLV(RSI(14).S) I don't know if adding the moving average changes the usefulness of the prospecting.2))>(mov(c.20))/mov(C.20.89.LLV(RSI(14).20))/mov(C.20.S)-std(Close.89.-7) and Mov((RSI(14).20. this is what Bollinger is suggesting.2)).2)) and ref(low. I have written a MetaStock exploration to spot stocks whose BWI has reached extreme low readings. anyway.20.20.20.-7) exit long close<(mov(Close.20. they don't give any clue as of the direction of the following move. Bollinger Band Width 2 From: Philip Schmitz MetaStock v6 does not appear to provide an indicator which shows the width of Bollinger Bands. In this second case the BWI doesn't remain under the trigger level for a long time.-3)>70 and (mov(Close.250)/3 The stocks that pass this screening are usually in a non-trending mood. Otherwise.-7)<ref((mov(Close.BBandBot(C.LLV(RSI(14).S). This shows when the BWI is at lower than its highest level for the last 250 days.20. divided by 3: hhv(4*(std(C.20.s)+(.S)+std(Close. 2) .2)).14)-(LLV(RSI(14). Where.Synergy with Bollinger by John Lowe (March 1998 issue of TAM.10. Bollinger strives for synergy.As a next step. does it fall? Bollinger Optimised Synergy System BOSS -. For example.-1.1. are the other part of the BOSS.E)-Mov(cum(((C-L)-(H-C)/(H-L))*V).-2)>=Ref(H.3. since my interest is commodities. positive volume-development in the trend-direction.-1) and Ref(H.If(ADX(14)>30 and PDI(14)<MDI(14).Sell=1} If(ADX(14)>30 and PDI(14)>MDI(14).-1)<=L D:{Entry}If(ADX(14)>30 and PDI(14)>MDI(14) and . which has to be confirmed by two of three indicators based on: Closing-price. the Bollinger Optimised Synergy System (BOSS): 1st criteria -.in other words all data loaded. combined in the Chaikin Oscillator. a diverse accumulation/distribution line. 2nd criteria -. price and volume.-1)>=H and Ref(L. Chaikin Oscillator formula: Mov(cum(((C-L)-(H-C)/(H-L))*V). The Chaikin Oscillator can be substituted for with the Money Flow Index (MFI). the Chaikin Oscillator.Bollinger Bands are best used in conjunction with Wilders' RSI(9 or 14).E) Boomers Buy and Sell A:Close B:{Signal Buy=-1. is a very good alternative to the OBV indicator. or. the life of the contract -.-1) and Ref(L. I would like to devise an indicator which tells me how the current value of "Band Width" relates to the overall range of Band Widths for a specified period.-2)<=Ref(L. the Typical Price(High+Low+Close/3) or one of the other on this theme of existing varieties. According to most analysts. Price as a moving or exponential average. on a percentage basis.Price and volume. an indicator based on closing price. a Dutch TA mag) In this article John Bollinger gets mentioned as insisting on using a Price/Close indicator in conjunction with a combined Price/Volume indicator. Chaikin Oscillators' basics are that a healthy trend will be confirmed by a healthy.0)) C:{setup}Ref(H. 125.0)) F:ADX(14){Higher the better} Filter:ColB and ColC Boomers Trading Signals Boomers buysig enter long ((adx(14)+adx(27))/2)>30 and pdi(27)>mdi(27) exit long c<=prev(llv(c. The search returns 1 for Ok and 0 for not ok.1)<=prev(h.10) Boomers watchsig** enter long prev(h.-1)<=L.-2) and ref(l.1)>=prev(l.-1)>=H and Ref(L.-1) or c<=.Ref(H.-1) and Ref(H.-1) and Ref(L.IF(ADX(14)>30 and PDI(14)<MDI(14) and Ref(H.5.15)-.-1)<=L.15)-.-1)<=ref(h.-1)>=ref(l.-1) and Ref(H.LLV(L.0)) E:{Stop}If(ADX(14)>30 and PDI(14)>MDI(14) and Ref(H.-2)<=Ref(L.-2)<=Ref(L.IF(ADX(14)>30 and PDI(14)<MDI(14) and Ref(H. Plot 1: BradCCI Line 1: (((H+L+C)/3)-Mov(C.15)-.-1)>=H and Ref(L.-1) and Ref(H.2) and prev(l.125.125.015*Std(C.75*hhv(c.-2)<=Ref(L. 1) or c<=.3)+.-1)>=H and Ref(L. • CLOSE • EngulfingBull() • MorningDojiStar() • MorningStar() • WhiteSoldiers() BradCCI BradCCI: From Bill S.-2)<=Ref(L.-2)>=Ref(H.28)) .2) and BullHarami() exit long c<=prev(llv(c.75*hhv(c.-1)>=H and Ref(L.10) Bottom Reversal These are a collection of bottom signals.-2) and BullHarami() exit long c<=ref(llv(c.-1) and Ref(H. 1) or c<=.28.-1) and Ref(L.125.HHV(H.-1) and Ref(L.-1) and Ref(L.-1)<=L.3)-.-2)>=Ref(H.3)-.S))/(.5.-1)<=L.LLV(L.5.-2)>=Ref(H.75*hhv(c.10) Boomers watchsig 2** (Ref not prev) enter long ref(h.3)+.HHV(H.-2)>=Ref(H. Brown {EasyLanguage} Formula: Base:=Mov(RSI(14). I phantom traded this system in the Yahoo Investment Challenge. Buy n :=opt2{Time periods}.-1).Plot 2: BradCCI Line 2: Std(((h+l+c)/3).14).S). and there is a relatively high percentage of losing trades (usually around 50%). for instance.S))/(. For awhile. . ATRcustom:=HHV( ValueWhen(1. the system seems to take you out with relatively little pain. until I got bored with it. I do admit that the system is not perfect. if you wish: Plot 1: 1. Part2:= {down coefficient is factor 2. If the trend breaks down for any reason. However.C. 3.6. The trick is to find those issues.S))).ATR(1))OR ValueWhen(3.RSI(14)>Ref(RSI(14). BradCCI Line 1: (((H+L+C)/3)-Mov(C.ATR(1))OR ValueWhen(2. at least able to hold my own and maintain my capital until the October break-always started to occur.3*(Mov(ATRcustom.100) trend(-100. if RSI closes down. Even in the April-September period when everything seemed to stall and move sideways. {RSI up=TRUE.-100) trend(0.-1). 15. 15. you can also add trend lines.S))).{else} {RSI up=FALSE. then} Base+Part1. I've been unable to develop an alternative exit that improves the system return.28) To Line 1.28.0) Brown's Indicator Name: RSI derivative index (EL) .-1). I've been trading this system myself for about a year and have had good results.RSI(14)>Ref(RSI(14). I was.RSI(14)>Ref(RSI(14). than part1. 4. {Part3=if RSI closes up or equal to. I typically made about 20% a month using the system in that venue. it is my belief that the exit could be improved on winners to preserve more profit. Part1:= {up coefficient is a factor 2.-1). else. 2.3 and added} (2. part2} If( Base>=Ref(Base. the system seems to perform best on issues that are prone to make prolonged moves.ATR(1)).015*Std(C.1 and subtracted} (2.1*(Mov(ATRcustom.28)) trend(100. Therefore.then} Base-Part2) Bull Fear/ Bear Fear The system is a trend follower that appears to get you in at the early in a trend. n))/2 + LLV(LOW.n) . After a lot of trial an error I decide -1.n))/2 + LLV(HIGH.n))/2 + LLV(LOW. this number did not have to be zero and did not have to be the same for entering long and entering short. BearFear := (HHV(LOW. . ADX (Vol Required).n) .n) . Also down moves . Wilder used 14 day periods to calculate his PDI and MDI functions. Also I like to smooth my indicators so I used Tema smoothing.MDI(13). Cross(CLOSE. Since I like Fibonacci numbers. Cross(CLOSE. Bull Fear/ Bear Fear with DX System enter long: n :=opt2{Time periods}.55.n).LLV(LOW.bullfear) AND DX(10) > opt1 close long: n :=opt2{Time periods}. or -21 would be my enter short number. -3.bullfear) AND DX(10) > opt1 Sell n :=opt2{Time periods}. CLOSE < bearfear Optimize the time periods from 10 to 50 in increments of 1 while testing the DX from 5 to 30 in increments of 5 (you can do it in increments of 1 but it takes longer). My custom PDI .13).MDI moves above zero and a sell signal occurs when PDI-MDI falls below zero.LLV(HIGH. This test is based on Wilder's directional movement indicators. This week I'm going to discuss my third MetaStock Profit System Test 03_Tema PDI . showing how MetaStock system tests can be built up . Wilder says a buy signal occurs when PDI .n). Note that this system is intended to be a stop and reverse system and you can use it to go short as well if you'd like to.n))/2 + LLV(HIGH. Tema(PDI(13) . CLOSE < bearfear Building Metastock System Tests Here's an excellent short article from Jim Greening. BearFear := (HHV(LOW. This makes sense since the market is biased to the up side. so entering a little under zero would get us in a little earlier. then retest with the determined optimal time period and the DX in increments of 1.LLV(LOW. Once the Optimal time period is determined in this manner.MDI. As the MetaStock manual indicates.LLV(HIGH.8.BullFear := (HHV(HIGH. I started with that thought and experimented a little.Periods) I started with the idea that I would take the PDI-MDI crossover of an optimized number as my basic buy and sell trigger. However.n) . BullFear := (HHV(HIGH.MDI formula then became: Tema PDI . I used 13 days instead.n).n). -13. or -5 would be my enter long number and -5. .MDI Periods := Input("Enter Tema Smoothing Periods". faster down moves which is what I wanted. With the bias being up.tend to be fast an extreme and this would only let us in short for larger.8) AND ADX(13) > 34 To close the short position. the close long became: Close Long: Fml("Tema PDI . I also wanted the 55 day variable moving average to be dropping before I closed the position.VAR).Fml("Tema PDI . After some experimenting. Therefore.ADX(13) >= -2 AND ADX(13) >= 8 AND ADX(13) <= 21 To close my open long position I wanted the PDI-MDI to be less than opt1. I set the min at 8 and the max at 21. I notice that most up moves started when adx was low and that adx climbed during the move to a max and then started to fall at the end of the move. Any comments or questions? Bullish Engulfing Pattern .MDI") > 13 Optimization: Opt1: Min = -1 Max = -5 Step = 2 Opt2: Min = -21 Max = -5 Step = 8 That's it.MDI")). After more experimenting. My close Short and optimization became: Close Short: Fml("Tema PDI . so I wanted the MDI to be greater than a certain number to close a position. I decided on the following for my open long signal: Open Long: Alert(Cross(Fml("Tema PDI .13) AND MDI(13) .MDI"). I thought an adx max and min for a buy signal would help reduce false signals.MDI") < opt1 AND MDI(13) > 21 AND LLV(Mov(L. Therefore. The answer was: Open Short: Alert(Cross(opt2. I also noticed that most good buy points occurred when MDI and ADX were close together so I decided that the difference between the two should be small. the MDI starts to rise. you need to close shorts fast. I only wanted PDI-MDI to be greater than a certain positive number.13) To open a short position. I wanted confirmation in that the adx was still fairly high when that happened. I don't like a lot of confirmations for closing shorts.opt1). I wanted the PDI-MDI to cross below a fairly high negative number.ADX(13) <= 4 AND MDI(13) . When a stock starts to drop. Finally I wanted some way to reduce the number of false signals and I wanted to do that with directional movement indicators only so this test would be completely uncorrelated with my other tests. since markets are biased upwards. Finally. For long positions.VAR).55.5) = LLV(Mov(L.55. alpha:=2/(pds+1). • You can then right-click on the Breadth Thrust.10.20). Here is the formula for MetaStock 6. The average gain following these 14 Thrusts was 24. If you get a flat line then it was not plotted directly on top of the composite's plot.5 percent.5 or higher.1)>90)<=5 Filter enabled Yes Periodicity Daily Records required 1300 Breadth Thrust The Breadth Thrust indicator is a market momentum indicator developed by Dr. select Breadth Thrust Properties. ut:=alpha*mt+(1-alpha)*(If(Cum(1)<pds. pds:=Input("Periods". • In MetaStock open a chart of the composite and a chart of the Advancing Issues. Dr.200. the Breadth Thrust indicator rises from below 40 percent to above 61. but has not yet become overbought. 10. October 1998. sd:=Input("Standard Deviations". To plot the Market Breadth in MetaStock™ for Windows you will need to: • Create a composite security of the Advancing Issues + Declining Issues in The DownLoader™. According to Dr. during a 10-day period.2.PREV)). E ). • Tile the charts so you can see both of them on the screen. A "Thrust" indicates that the stock market has rapidly changed from an oversold condition to one of strength. then plot it on top of the plot of the composite (the composite's plot will turn a purplish color ). • Drag the plot of the composite into the chart of the Advancing Issues. ________________________________________ Better Bollinger Bands In an article in Futures Magazine. The Breadth Thrust is calculated by taking a 10-day exponential moving average of the advancing issues divided by the advancing plus declining issues.6 percent in an average time frame of 11 months. • Create the custom indicator: mov( C / P.2). Dr.C. Dennis McNicholl describes the use of Bollinger Bands and provides a means of making them tighter when markets are trending.01. mt:=alpha*C+(1-alpha)*(If(Cum(1)<pds. .PREV)).60. go to the Horizontal Lines page and add horizontal lines at 40 and 60..C. Martin Zweig.ColA: CLOSE Filter BarsSince(EngulfingBear())<=5 AND BarsSince(ROC(C. He calls them Better Bollinger Bands. Zweig also points out that there have only been 14 Breadth Thrusts since 1945.%)>15)<=5 AND BarsSince(Stoch(9. Zweig a Breadth Thrust occurs when. Zweig also points out that most bull markets begin with a Breadth Thrust. The indicator is more responsive to market price movements than a conventional simple or exponential moving average.(SC*AbsCMO*CLOSE)+(1(SC*AbsCMO))*PREV).21). create a new Expert and select Highlights from the tab dialog.Length)))/100. but. To do this.1. AbsCMO:=(Abs(CMO(C. AbsCMO:=(Abs(CMO(C.dt:=((2-alpha)*mt-ut)/(1-alpha).C. "Here's a technique based upon Tushar Chande's variable-length moving average.5). Paste the Bull trend formula into the condition box within the editor and set the colour to green. Do this for the Bear and the Pause conditions as well. page 93. dt.(SC*AbsCMO*CLOSE)+(1(SC*AbsCMO))*PREV).200.5 Indicator Length:=Input("Length". selecting the matching colours.) Breaking out of Price Channels Breaking out of Price Channels. Smooth:=Input("Smoothing". VIDYA The following Expert highlights will show you when the price has undergone trend changes as discussed in the article.C. "Technical Analysis of Stocks & Commodities". blt:=dt-sd*dt2. VIDYA:=If(Cum(1)<=(Length+1). but:=dt+sd*dt2.1.Length)))/100. AbsCMO:=(Abs(CMO(C. Enter each section as a separate highlight in an Expert Advisor. dt2:=((2-alpha)*mt2-ut2)/(1-alpha). C>(Vidya*1. Green Bars (Bull trend) Length:=21. ut2:=alpha*mt2+(1-alpha)*PREV.. SC:=2/(Smooth+1). Smooth:=5. VIDYA:=If(Cum(1)<=(Length+1).Length)))/100. SC:=2/(Smooth+1). Smooth:=5.01) Red Bars (Bear trend) Length:=21. Then select New and name it Bull. Attach this Expert to your chart and if the conditions are met. . by Gerald Marisch. and can be used for position trading.. blt (Go Top. January 1998. mt2:=alpha*Abs(C-dt)+(1-alpha)*PREV." The following formula will match the authors slight modification to the variable moving average: VIDYA 21. the price bars will be displayed in the proper colours. SC:=2/(Smooth+1).200. ((10000/C)* (Mov(ATR(1).P.Length)))/100. SC:=2/(Smooth+1).2)).Ref((InInit AND Alert(InInit=0.. In:=x>Ref(HHV(x.) Bang For The Buck This indicator shows the possible dollar return (on a $10.pds1).com With thanks to Roy Larsen for Init idea } pds1:=Input("HHV (long) breakout periods".21).C.-delay).-1). display:=Input("display: signals=1. pds2:=Input("LLV (short) breakout periods".Flag) Breakout signals Signals a Buy Long on price breakout Exploration filter ..-delay).C.252.O.VIDYA:=If(Cum(1)<=(Length+1).252.-delay).000 account) for a security on any given period.If(x=6. If(display=1.(SC*AbsCMO*CLOSE)+(1(SC*AbsCMO))*PREV). the higher the profit potential.4). Smooth:=5. If(display=1.C))))).2) OR Flag AND Alert(Flag=0.Ref(Cum(Cum(In))=1..If(x=5.200.2.. C<(VIDYA*.2))-(Flag=0 AND Alert(Flag.) Breakout signals { Plots breakout long/short signals
[email protected]))/100) (Go Top.1). InInit:=Cum(In)=1. Out1:=Cum(Cum(Out))=1. in-trade binary=2". Out:=x<Ref(LLV(x.If(x=2.01) (Go Top.0.0). In1:=Cum(Cum(In))=1. Init:=Cum(In+Out>-1)=1. x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5 P=6".1. This number is then multiplied by the average range of the security for the last 200 periods.1.If(x=3.1.-Ref(Out1 AND BarsSince(In1)>=BarsSince(Out1).99) AND C<(VIDYA*1.1. AbsCMO:=(Abs(CMO(C. VIDYA:=If(Cum(1)<=(Length+1).H.0).99) Yellow Bars (Pause or pending reversal of the trend) Length:=21.000 account by the closing price. The interpretation is such that the higher the value.V. If(display=1. delay:=Input("Entry and Exit delay". x:=If(x=1.L. This is calculated by dividing a $10.10). C>(VIDYA*.pds2).6.-1). Flag:=BarsSince(Init OR In) < BarsSince(Init OR Out)+InInit.(SC*AbsCMO*CLOSE)+(1(SC*AbsCMO))*PREV).3.0). 55.If(x=2.If(x=5.C-L).If(x=3.H-O). {use Open=1 High=2 Low=3 Close=4 Vol=5} x:=If(x=1.O.-1).pds2). ThTopU:=BBandTop(Ushd.64. CandleCode Bdy:=Abs(O-C).0.5).H-C. SellLong:=Flag=0 AND Alert(Flag.V.0)*If(Ushd>=Lshd.pds1).E.L.E. SellLong Candle Code From "Lyn Maine" Here is the formula from this months TASC called Candle code this is only using 1 formula not like the one in TASC which is broken up into several smaller ones. InInit:=Cum(In)=1.H.C)))). ThTopB:=BBandTop(Bdy. Flag:=BarsSince(Init OR In) < BarsSince(Init OR Out)+InInit.55.0.H. Out:=x<Ref(LLV(x. ThTopL:=BBandTop(Lshd. Init:=Cum(In+Out>-1)=1.E. BuyLong Breakin signals Signals a Sell Long on price collapse Exploration filter pds1:=21.5).0) +If(Bdy>ThBotB AND Bdy<=ThTopB.E. InInit:=Cum(In)=1.5). {use Open=1 High=2 Low=3 Close=4 Vol=5} x:=If(x=1. {LLV (short) breakout periods} x:=4.1.2). {HHV (long) breakout periods} pds2:=10. {LLV (short) breakout periods} x:=4.55. ThBotL:=BBandBot(Lshd.0.V.0. ThBotB:=BBandBot(Bdy. Lshd:=If(C>=O.1.5).C)))). {HHV (long) breakout periods} pds2:=10.0.2).0.0))+ .112.48)+If(C=O.-1). Ushd:=If(C>=O.If(x=2.-1).0.E. In:=x>Ref(HHV(x.55.L. Flag:=BarsSince(Init OR In) < BarsSince(Init OR Out)+InInit.5).1)*(If(C>O. CCode:=If(C=O.-1).If(x=3.pds2).55.0)*(If(B dy<=ThBotB.E.55.80.If(x=5. Init:=Cum(In+Out>-1)=1. In:=x>Ref(HHV(x.pds1). ThBotU:=BBandBot(Ushd. BuyLong:=InInit AND Alert(InInit=0. Out:=x<Ref(LLV(x.5).0)+ If(Bdy>ThTopB.96.2) OR Flag AND Alert(Flag=0.pds1:=21.O.O-L. 0)+ If(Bdy>ThBotB AND Bdy<=ThTopB.13. Consequently. The obvious problem that an analyst faces is that such subtle changes are difficult to discern and evaluate by naked eye only.Hanging Man/Hammer and CCI Trading System enter long: (Fml("Candle .-1)) enter short: (Fml("Candle .(HIGH-CLOSE).3. After Opening the "Indicator Builder".0)*(If(Bdy<=ThBotB.(HIGH-OPEN)). 1991 "Beyond Candlesticks" S. enter the following : ShadowResistance:=If(OPEN<CLOSE.RESISTANCE (by John D.Periods.0)+ If(Lshd>ThBotL AND Lshd<=ThTopL AND Lshd>0.12.E.-1)<-80)) OR ((CCI(11)<80) AND Ref(CCI(11)>80. Mov(Mov(Mov(Fml("Candlecode").Periods.Periods.0)).1.Hanging Man'")=-1) AND (CCI(11)>50) close short: ((CCI(11)>-80) AND (Ref(CCI(11). METAPUBLICATIONS (in greek language only) As we all know.g.S) (Go Top) Candle . Kontessis) Based on extensive study of the following books "Japanese Candlestick Charting Techniques".1.2).16.Hammer")=1) AND (CCI(11)<-50) close long: ((CCI(11)<80) AND (Ref(CCI(11).8.made Formula based on Candlesticks called CANDLE SHADOW SUPPORT .Nison. one of the most important components of a candlestick is its shadow. S.32. A candle's shadow tends to get longer as prices get closer to support-resistance levels.2.-1)) (Go Top) Candle Shadow Support This is a custom .If(C<O.0)+ If(Ushd>ThTopU.0))) +(If(Lshd=0.Nison.0))+(If(Ushd>0 AND Ushd<=ThBotU. Kourouklis.S). This problem can be easily solved by using the following two Formulas in Metastock's Indicator Builder. as well as when they reach points of change in Trend (e.2. choose "New" and name the Formula : "CandleShadow Resistance ".-1)>80)) OR ((CCI(11)<-80) AND Ref(CCI(11)>-80. as prices reach a Resistance Level (or when building a resistance) the candles' upper shadows get longer. . CSI{Candle strength index} Periods:=Input("Enter Periods".S).4. pullbacks or entry in ranging periods).0)+ If(Lshd<ThBotL AND Lshd>0. As prices reach a Support level (or when building a support) the candles' lower shadows get longer.0)+ If(Ushd>ThbotU AND Ushd<=ThTopU. CCode. 1994 "Tehcical Analysis" X. Lower Tops in "CandleShadow Resistance " and simultaneously higher tops in "CandleShadow Support" . This system should be used in place of longer-term momentum systems in strong bullish choppy type markets.Average).Average of the size of the shadows (or alternatively a 10day weighted Mov.w)} and press "ok". state a weakness of the downtrend.S). weighted. It is best used in choppy bullish markets similar to the 1995 bull market. exponential etc) and the periods used so as to achieve the best "optical" results. The code for this system can be reversed to trade short positions. The first Formula "CandleShadow Resistance" measures the upper shadow and the second Formula "CandleShadow Support" measures the lower shadow. (bearish signal).(OPEN-LOW). In an UPTREND : Higher Tops in "CandleShadow Resistance " and simultaneously lower tops in "CandleShadow Support" . The CCI indicator is extremely volatile and is generally difficult to use when trading the S&P 500 Index. We. however. use: Mov(ShadowResistance.} {Trading Tactics: This short-term bullish trading system exploits over extended markets. Futures. You can always experiment with the type of Mov.10. This system rarely exits at the market intermediate peak.} . options. Now let's see these Formulas at work.S). exiting the trade as the indicators cross to the downside. Now let's build the second Formula: After Opening the "Indicator Builder". Lower Tops in "CandleShadow Resistance " and simultaneously higher tops in "CandleShadow Support" . The system remains in the market for a short period of time. use: Mov(ShadowSupport. (bullish signal).3. state a weakness of the uptrend. who. At your disposal for any questions or comments. As designed.10.(CLOSE-LOW)). have turned this volatility into a trading advantage by using the spread or gap between the CCI index and its moving average as a reversal signal.w)} and press "ok". (Go Top) CCI Spike Trading System {This system uses the momentum Commodity Channel Index (CCI) indicator to find short-term bottoms in the market. state a strength of the uptrend.3. In a DOWNTREND : Higher Tops in "CandleShadow Resistance " and simultaneously lower tops in "CandleShadow Support" . {for not so short-term results.Averages (simple. and mutual fund traders should take full advantage of this high probability trading system. {for not so short-term results. either by taking outright positions or avoiding declining markets. so other exiting signals may be used in place of our indicator crossover technique. state a strength of the downtrend.Mov(ShadowResistance. Specifically if the gap is larger then a certain percentage and CCI indicator crosses above its moving average we buy the market. choose "New" and name the Formula : "CandleShadow Support". Mov(ShadowSupport. enter the following : ShadowSupport:=If(CLOSE>OPEN. after measuring the shadows of the candles in our chart.(bearish signal). (bullish signal). John D. this system only trades long the market. it can however be altered to short the market. they "draw" a 3-Day Mov. So far we have built two Formulas. 0).300. 01/06/97 In their book "The New Technical Trader.0).1. 01/06/97 In their book "The New Technical Trader.(Mov(CCI(13). .C. They state that "the primary use of r2 is as a confirming indicator" and that "it is a lagging indicator that shows the strength of the trend. They state that "the primary use of r2 is as a confirming indicator" and that "it is a lagging indicator that shows the strength of the trend.-1)>200 (Go Top) Chande and Kroll's R2 Indicator rev.0)." In MetaStock the r2 formula is: Pwr(Corr(Cum( 1 ).3.5 AND Cross(CCI(13). ATRDays:=Input("ATR Days".2) They also present a smoothed r2 which would be: Mov(Pwr(Corr(Cum( 1 )." Chande& Kroll introduce the r2 indicator.S)).C.1.2)*100.14.2)*100.{Enter long:} Ref(CCI(13)/(Mov(CCI(13).3.CCI(13)) AND Ref(CCI(13).S)). It is part of an exit strategy which you can adjust to your own trading style and comfort levels.S) (Go Top) Chandelier Exit 2 Here is the Fast Chandelier Exit in full as supplied to me.14.14.-1)>1.C.S))) AND Ref(CCI(13).3." Chande& Kroll introduce the r2 indicator.S) (Go Top) Chande and Kroll's R2 Indicator rev.30.14.2) They also present a smoothed r2 which would be: Mov(Pwr(Corr(Cum( 1 ).C." In MetaStock the r2 formula is: Pwr(Corr(Cum( 1 ).0).14. from Ian Burgoyne HHVDays:=Input("Days Since Trade Opened".1).14.10).-1)<-25 {Exit long:} Cross((Mov(CCI(13). version II Below is the MetaStock code I posted for the Chandelier exit back in October. HighStop. the more I admire its strength as an exit and its simplicity. I would urge everyone to spend some time with it. PREV.3.0). CloseStop:= C .10). HighStop. CloseStop:= C . eg.HHVStop))).MoneyMgmtStop.HHVStop))). If(HHVStop > C. 0).1. HHVStop:= HHV(H. TodaysStop (Go Top) Chandeleir Exit.1.ATRCloseMult*ATR(ATRDays). CloseStop). And Chuck LeBeau gets credit for the MetaStock code. HHVDays:=Input("Days Since Trade Opened".20. The trick is to define the entry date/price as the point at which your system triggered the entry. Because exits tend to be the weakest part of a system. not by using the date functions. HighStop:= H . {LONG EXIT} LongEntry:= {this your entry system. TodaysCalc.5.5. {Trade entered today?} If(LongEntry.1. TodaysCalc:= If(HighStop > CloseStop.ATRHighMult*ATR(ATRDays). not me.ATRHighMult*ATR(ATRDays). If(HHVStop < PREV.E))}. -PREV.0). Cross(CLOSE.ENTRY PRICE AND NO TRADE BEING 0} EntryPrice:= If(PREV <= 0.PREV. CLOSE.HHVDays) .30.1).5).2.5.1. .PREV. {Trade entered before today. TodaysCalc.5). TodaysStop:= If(L <= PREV. The more time I spend with the Chandelier exit. HighStop:= H . in points}.ATRHighMult*ATR(ATRDays). MoneyMgmtStop:= {this is your maximum loss.1. ATRHighMult:=Input("ATR Multiplier From High". ATRCloseMult:=Input("ATR Multiplier From Close". CloseStop). TodaysCalc:= If(HighStop > CloseStop. A side benefit is that you can also use it to implement a fixed dollar. stop. TodaysStop:= If(L <= PREV.HHVDays) . I just took his framework and applied it to his exit.300.ATRHighMult*ATR(ATRDays). ATRDays:=Input("ATR Days". PREV. Stopped today?} If(LOW <= PREV . 1999.2. WITH EXIT BEING -. HHVStop:= HHV(H. {DEFINE ENTRY PRICE. If(HHVStop < PREV. ATRCloseMult:=Input("ATR Multiplier From Close". Mov(C.1.5.ATRHighMult:=Input("ATR Multiplier From High".3.ATRCloseMult*ATR(ATRDays). If(HHVStop >C. or money management. -PREV. PREV)))). LOW) + 3 * ATR(10). 0). CLOSE) . {DEFINE ENTRY PRICE. it can show what impact a day of high turnover had on the share price for the coming periods.PREV=0.If(LOW <= HighestSince(1. Simple Interpretation: Changing Ways Accumulation/Distribution can show divergences against the instrument. otherwise.5 * ATR(10). -PREV. If(HIGH >= LowestSince(1. Then add up all the days values and keep a cumulative running total for each new trading day.3 * ATR(10). -PREV.yesterdays close This is the main formula.PREV=0. When compared against volume activity. PREV)))).20. CLOSE) + 2.5 * ATR(10). Stopped today?} If(HIGH >= PREV + MoneyMgmtStop. then you can suggest that all the volume for that day was absorbed into the price and there is less likelihood of buying/selling pressure in that day taking hold in the market in future trading days.E).2. -PREV. otherwise write down 0. CLOSE)}. {Trade entered today?} If(ShortEntry. WITH EXIT BEING -ENTRY PRICE AND NO TRADE BEING 0} EntryPrice:= If(PREV <= 0. write down the negative value of todays close + todays volume. write down todays close + todays volume. incorporating the first calculation: If todays change (1st formula) is greater than a 7 day exponential moving average of todays change and todays close is greater than yesterdays close. eg. Cross(Mov(C. If(LOW <= HighestSince(1. CLOSE. If(HIGH >= LowestSince(1. {EXIT IF ENTRY PRICE < 0 (MEANING EXIT)} EntryPrice < 0 {SHORT EXIT} ShortEntry:= {this your entry system. Metastock code for Changing Ways Accumulation/Distribution: .PREV=0. HIGH) . {EXIT IF ENTRY PRICE < 0 (MEANING EXIT)} EntryPrice < 0 (Go Top) Changing Ways Accumulation/Distribution This is the calculation for the first formula (Todays Change): Todays close . MoneyMgmtStop:= {this is your maximum loss. This is to say that if a day had high volume and there was little movement in the indicator alongside this. {Trade entered before today. -PREV. If todays change is less than a 7 day exponential moving average of todays change and todays close is less than yesterdays close.PREV=0. in points}. Cross(Mov(C. {Trade entered today?} If(LongEntry. WITH EXIT BEING -ENTRY PRICE AND NO TRADE BEING 0} . PREV)). eg.MoneyMgmtStop. WITH EXIT BEING -ENTRY PRICE AND NO TRADE BEING 0} EntryPrice:= If(PREV <= 0. MoneyMgmtStop:= {this is your maximum loss. MoneyMgmtStop:= {this is your maximum loss. Glen Wallace {LONG EXIT} LongEntry:= {this your entry system. in points}.20. the channel exit is quite a straight forward trailing stop. Below is the code for a channel exit. 0). It also includes a money management stop to limit losses to an acceptable level until the channel exit exceeds it. say. {Trade entered before today.E). Neg(C + V) . {DEFINE ENTRY PRICE. {EXIT IF ENTRY PRICE < 0 (MEANING EXIT)} EntryPrice < 0 {SHORT EXIT} ShortEntry:= {this your entry system. long).ref(c. 10 or 20 days is just too far away to adequately protect profits. Stopped today?} If(LOW <= Max(PREV .opt1).0))) Where Fml( "Todays Change" ) = c . One exit system that requires your trade entry price is the channel exit.-1). Ref(LLV(LOW. eg. you maintain your stops at the lowest low of the past number of days (optimized. but takes you out when price makes a significant reversal and you risk giving back profits on a retracement or the end of the trend. -PREV. in the code below) until you are taken out of the market.Cum(If(Fml( "Todays Change" ) > Mov(Fml( "Todays Change" ). Mov(C.7.E) AND C > Ref(C. Once you're in a trade (let's say.-1) (Go Top) Channel Exit with Stop Loss As people have mentioned before.20. For those not familiar with it. it is difficult to design exits in MetaStock because of the awkwardness of defining your trade entry price.-1). such as moving the stop up faster where the market makes rapid gains and your lowest low in. If(Fml( "Todays Change" ) < Mov(Fml( "Todays Change" ). This method attempts to let profits run in the direction of the trend.-1)). Cross(CLOSE. CLOSE.E) AND C < Ref(C. {DEFINE ENTRY PRICE. C + V. in points}. CLOSE)}. Work on variations of this basic theme.E))}.7. col a = CLOSE . If not.( This is also a good tip when printing out Metastock reports that do not fit on the width of an A4 page.do not use the scroll bar but place the cursor in the Name box at its RH end almost in the Symbol box and when your cursor turns into a cross hold down the LH button on the mouse and drag it left thereby narrowing the Name column till the Last Date column is visible.Stopped today?} If(HIGH >= Min(PREV + MoneyMgmtStop. Browse to the folder you wish to make deletions from. (Go Top) .opt1).-3)) col e = (Ref(CLOSE.B01. If you want to ever see the old securities just alter the lead folders names in explorer.-2))-(Ref( MP() . CLOSE. tick the "Delete Source Security" box and press OK. In the "Copy Securities" window make sure you can read the Last Date column with the Name column showing.-1)). I go on the Last Date column to find useless stocks.EntryPrice:= If(PREV <= 0. (Be sure no more than 450 stocks go in each folder when you do copy/deletions) Open METASTOCK/Tools/DOWNLOADER and once in DOWNLOADER open Tools/Copy . Ranking the first colum will then allow you to estaboish the overall score for each stock. In my case OLD_META_DATA/ALL01/A01. create a series of folders and sub folders like your present Metastock data system.-1)) Col c = (Ref(CLOSE. From Basil Holloway (Go Top) Close Above Median Price This exploration is designed to find those stocks where the close is above the median price over the past five days. {Trade entered today?} If(ShortEntry. It matches the steps in Dels bvook The Strategic Electronic Day Trader.-4))-(Ref( MP() . PREV)).-4)) filter = colA>=0 AND colB>=0 AND colC>=0 AND colD>=0 AND colE>=0 The filter in the exploration only shows those stiocks that have the strongest bullish bias over all 5 days.C01 etc to Z01. You can do hundreds in a matter of minutes. just reduce the width of a column or eliminate it completely if it is not wanted on the print out.MP() col b = (Ref(CLOSE. 0). By removing the filter all stocks will be shown.-1))-(Ref( MP() .-2)) col d = (Ref(CLOSE. {Trade entered before today. Ref(HHV(HIGH. {EXIT IF ENTRY PRICE < 0 (MEANING EXIT)} EntryPrice < 0 (Go Top) Cleaning out unwanted stocks from Metastock A fast method to clean out unwanted stocks from Metastock and also save them for future viewing. If you use the scroll bar to go down the list be sure not to let go of the control key as you will lose all your previous selections. -PREV. Browse to the new folder you created. When finished highlighting let go of control key and press copy.) Hold down the Control key and highlight each Name you wish to delete. On your hard drive.-3))-(Ref( MP() . Old securities gone out of current data base and saved for future reference. 66 .15. "2) Buy or cover when the indicator goes from above 100 to below 100 or from above 0 to below 0 X-number of days after that occurs.S. Muchos dicen que el Santo Grial no existe. "a) how many days after the signal does one act. reverse when it triggers (Go Top) Coding Example If yesterdays high is greater than the high of 2 days ago// and the low 5 days ago is less than or equal to the high 4 days ago// and it is Wednesday Try this: Ref(H." Buy. (Is this on a close-to-close basis?)" Specifically. In this way.-5)<=Ref(H. debe valorar." We have included all 80 of them.1.0) 3 VOLUME OSCILLATOR WAVE if(oscv(1.1.50. otherwise.Ñ —Y si es mentira? 1 DAILY CLOSE VS HIGH AND LOW WAVE if((C-L)/(H-L)..38..%).-1. who points out that there is as yet 'no Holy Grail' in technical analysis! For the past few days I have been using them by substituting the for 'number' given to each formula.net para su publicaciуn en esta pбgina. sell the opening the day after the BB Histo closes above 100.0) . each becomes independent.0..%).-4) AND Dayofweek() = 3 (Go Top) Collection from a Spanish Source They are contributed by Patrick who notes "my limited Spanish suggests that they are simply a random collection made by the web owner. the complete formula that particular number represents.-1)>Ref(H.<. " b) Is this close-to-close or intra-day?" close to close "c) Is this to initiate or to go short or add to a position?" Add to positions if the indicator "repenetrates" these levels .1.50. complete with the orginal Spanish cover note.CMA "1) Sell the opening (long or short) X-number of days(?) after the indicator above moves from below 100 to above 100. when the BB Histo dips below zero (the following morning).. Se ruega encarecidamente a todos aquellos que tengan fуrmulas que puedan resultar ÑŠtiles las envнen a jomaba@interbook. if((C-L)/(HL). A continuaciуn se ofrecen una serie de fуrmulas que puede utilizar con el programa Metastock recogidas de la red y cuya utilidad Vd.-1).>." The following morning.0)) 2 PRICE OSCILLATOR WAVE if(ref(oscp(3.>.-2) AND Ref(L.S.<. 1.S) 23 MOVE WAVE 20-unit m. >. >.<.-1)).65.1.26.3).00.9.<.S).20.ref(hhv(H.1. 3) ) * 100 37 Median price (hhv(H.3).S.a.0).12.9.<.607*(mov(C.%).>.>.>.SHORT if(ref(stoch(14.3).S.10.>.15. if(stoch(14.ref(V. {then bullish} +1.1.ref(H.E))))) 39 Fraction (32nd's) int(C)+((frac(C)/0.E). if(stoch(14.<.llv(stoch(14. if( C.1.1.-1). {else bearish} -1) 24 STOCHASTIC VALUE WAVE if(ref(stoch(14.3).DAILY if(H.10.O.5) .0) 33 SHORT VOLUME WAVE if(oscv(1.llv(stoch(14. >.<.10)*sqr(365)) /(std(log(C / ref(C. if(fml(#17).0)) 9 VOLATILITY DIFFERENCE WAVE if(fml(#11).86.3).-1). 0) )) 35 SINE WAVE 5-unit standing sine wave sin( cum(5) ) 36 STOCHASTIC Example of hhv() function ( sum( C .S) 18 HISTORICAL VOLATILITY (std(log(C / ref(C.1.40). +V. if(H.-1.-1)).-1).%).0)) 8 STOCHASTIC WAVE .%).14) .1). {else bearish} -1) 26 STOCH WAVE 5.-1).S) 16 MACD WAVE MACD/trigger Binary Wave if(macd().14)sum(abs(mov(C.>.B.E).03125)/100) 40 Summation Noise Indicator (Adam White) (sum(abs(C-ref(C.2.>.S. 0.3).>=. Trieber (C-(( 11. {bullish} +1.0.S.<.%).0) 10 LONG BINARY II fml(#1) + fml(#3) + fml(#9) + fml(#24) 11 VOLATILITY DIFFERENCE mov(H-L.0.1.if(L.-1).-1)).3). {then bullish} +1.=.100).-1).-1).0)) 5 VOLATILITY WAVE if(ref(fml(#27).E.3).50.20.10)-C)-(C-llv(L.ref(llv(L.-1).65.-1.hhv(stoch(14.-1).607*(mov(C.12.38. ref(C.-1).0)) 22 AVG VOLUME mov(V. if(stoch(14.1).=.2.ref(hhv(H.Stochastic Binary Wave if(stoch(5.5).-1).if(C.1.=.-1)).0)) 25 ROC WAVE 12-ROC price Binary Wave if(roc(C. mov(macd().<.%).ref(llv(L.50)*sqr(365)) 19 RELATIVE STRENGTH C/P 20 CLOSE REL TO HIGH LOW (C-L)/(H-L) 21 GAP IDENTIFICATION if(L.-1).5).llv(L. Good example of if() func cum( if( C. >. 50.O.10)) 38 Future MACD---Dr.<. >. Binary Wave if(C.1. 3 ) / sum( hhv(H.43.50.3).4 WEEKLY PRICE OSCILLATOR WAVE if(fml(#17).=.-1).30.S)/mov(H-L. -1.>.40). {bearish} -1) 17 WEEKLY OSC SEGMENT mov(oscp(43.S) 12 HI LOW WAVE .E))) -(12.20.1.LONG if(ref(stoch(14.0) 32 SHORT PRICE OSCILLATOR WAVE if(ref(oscp(3.hhv(stoch(14.V.>.S)-ref(mov(C.-1)).0)) 13 WEEKLY HIGH LOW WAVE if(H.3).1.3).0)) 14 PERCENT ABOVE\BELOW MOVING AVG (oscp(1.3).-1). -V.10.0)) 30 SHORT BINARY WAVE fml(#31) + fml(#32) + fml(#33) 31 SHORT OPEN CLOSE WAVE if((C-L)/(H-L).<.14))/ sum(abs(C-ref(C.90.1.ref(fml(#17).. {else bearish} -1) 27 ATR RATIO atr(10)/atr(50)/100 28 BINARY WAVE Composite Wave of above fml("MACD Wave") + fml("MOVE Wave") + fml("ROC Wave")+ fml("STOCH Wave") 29 WEEKLY OPEN CLOSE WAVE if(C.llv(L. mov(C.3).%)) 15 WEEKLY PRICE OSCILLATOR mov(oscp(10. ref(C.536*(mov(macd(). if(L.100).10))/(hhv(H.-1.1. <.E)))(10.3).1. if(V.1.ref(fml(#17).3).0) 6 LONG BINARY WAVE fml(#1) + fml(#2) + fml(#3) + fml(#9) 7 STOCHASTIC WAVE .10)-llv(L.ref(L.0) 34 O.-1. {then bullish} +1. .>=.+1.S) 53 R Squared pwr(corr(cum(1).<.-1)+if(C.{buy long}+2.E).ref(C. {stop longs}-1)) 60 Oscillating OBV mov(obv().<.15.E).-16)-L)/(mov((H-L).E) 47 RSI Binary Wave (using 30/70 xover) if(rsi(10).C.ref(C.20.20.-15).ref(C.20.+1.20)))))/(mov(C.ref(C.10).-19).1).10.1.>. C.10.10).{stop shorts}+1).>.ref(C.4.>=.Tushar Chande (TASC) if(C.{sell short}-2.$).ref(C.0).S)*sqr(16)) 56 RWI for today's low (ref(H.S)) +(2*(mov(roc(C.<.-1.E).-20).20.>.>.1)+if(C.-16).-1)+ if(C.S)-(2*(std(C.10).<.>.20.1).20.41 Chaikin Money Flow sum(((((C-L)-(H-C))/(H-L))*V).<.2).14.0)+if(C.ref(C.10))-pwr(sum(cum(1).S) +(2*(std(C.1.10))(sum(cum(1).-11).5.21) 42 Linear Regression ((15*(sum(cum(1)*C.>=.-1).E) 44 Bull Power (for Elderray) H-mov(C.015.if(V.-13).5.5.>=.2).if(ref(rsi(10).S)-mov(C.%).1.-1)+if(C.if((fml("dual osc 1")).10.0))).-1)+ if(C.20)))mov(C.9.-1).1.%) 58 Volume Binary Wave if(V.ref(mov(C.if(rsi(10).-1).ref(mov(V.13.1.%).15.0).0) 51 Dual Osc 1 mov(C.20.02..2)) 43 Smoothed Tick Momemtum Line-TASC mov(roc(cum(if(C.1.3).>.1..std(C.>=.>.1).30.ref(C.0)) 59 MACD w/SAR if(macd().std(C.>=.E).26) 63 RVI w/simple moving average (TASC) 100*mov(if(C.>.0).1.10.-1)+if(C.-17).10)))) /((10*sum(pwr(cum(1).2) 54 Slope of Linear Regression Line ((5*(sum(cum(1)*C.S)+(2*(std(C.-12).E).S)))+(4*(mov(roc(C.10)) -pwr(sum(cum(1).S)))+ (3*(mov(roc(C.+1) 62 Modified MACD tsf(C.S)/(mov(if(C.E) 46 13-Period Moving Average (for Elderray) mov(C.0)).E)-obv() 61 Overreaction Index if(ref(std(C.ref(C. -1 sell if(fml("dual osc 1").30.5.5))-pwr(sum(cum(1).S)) 64 Upper Bollinger Band mov(C.2 ).C.S)*sqr(16)) 57 Momemtum roc(mov(C.S) 52 Dual Osc 2 mov((H+L+C)/3.-1)+if(C.13. if(ref(fml("dual osc 1")..S) 67 %B (TASC) (C-(mov(C.0)).20))) 66 Middle Band mov(C.21)/sum(V.20.0).20.10.-18).{macd < trigger}if(sar(.12)-tsf(C.ref(C. ref(fml("dual osc 2").14.20)))) .10)*(sum(C.1.>.>.S)+mov(if(C.E).S)-(2*(std(C.-1.2).0) 48 Trendscore. if(C..16.<.0).>=.10.+1.13.30.70.if(ref(fml("dual osc 1").ref(mov(V.ref(mov(C.if(ref(rsi(10).mov(macd().1).-1).-1).5). <.5)*(sum(C.5)))(sum(cum(1).>. std(C.10.1.fml("dual osc 2").-1.E) 45 Bear Power (for Elderray) L-mov(C.-3).15)).S)-mov((H+L+C)/3.16.{macd is above trigger}if(sar(.2.-1)+if(C..0).ref(fml("dual osc 2").+1.%).>=.1.2)) 55 RWI for today's high (H-ref(L.-1).-1.ref(C.20))) 65 Lower Bollinger Band mov(C.(sar(.S)))/10 50 Dual Oscillator B-Wave +1 buy.10).%).20.-1).-1) 49 KST-Martin Pring (One formula) (mov(roc(C.ref(C.2).10.14.1.>=.-1)+ if(C.1).ref(C.-1).<.10.5))))/ ((5*sum(pwr(cum(1).>=.02.-16))/(mov((H-L).70.fml("dual osc 2").-14).S)-(2*(std(C.10.<. -1)<Ref(L.20) 71 Morris' RSI w/volume (TASC) 100-(100/(1+ (mov(if(roc(C.14.20.-4) AND Ref(L.$).L.14)/(hhv(if(H.-2)>Ref(H.-1).1.-1) AND (H-L) >= Ref(HHV((H-L).=.ref(O.-1).$)*V.14)-llv(if(L.-1) AND Ref(L.0) 76 Bearish engulfing lines if(fml(#28).-1)<Ref(L.-2) AND Ref(H.-1).S)))) 72 Custom A/D Oscillator cum(if(C.0) 78 Engulfing Line Binary wave fml(#30)+fml(#31) 79 Largest negative change in close llv(roc(C.0) AND If(LOW < Ref(LOW.42).+1.-1).-2) AND Ref(L.S)/ mov(if(roc(C. -1).0) AND If(HIGH > Ref(HIGH.H.0)) BAR .1.=.=.0). ref(C.if(C.0) BAR .-4) BAR .1.1.-1)<Ref(L.+1.-1.1.1.0))) 73 Empty Candlestick if(C.if(C. ref(C.3 Lower Lows & Reversal H L>Ref(L. +1.if(ref(fml(#28).-3) BAR .-3) AND Ref(L.10.-1) AND Ref(H.-1.ref(C.-2)<Ref(L.68 Band Width (TASC) (mov(C.5 Lower Lows L<Ref(L. -2).0).1.1 .0)AND If(HIGH > Ref(HIGH.9).14.+1.20))))-(mov(C.-1)>Ref(H.ref(C.ref(O.-1).1.Expansion Buy If(C > Ref(HHV(C.-roc(C.-3) AND Ref(L.-1) AND Ref(L.Fractal-down If(LOW < Ref(LOW.-1) AND Ref(L.0) BAR .42).-3)<Ref(L.=.3 Lower Lows L<Ref(L. -2).20))))/mov(C.+2).+1. +1.1.if(C.Fractal-up (If(HIGH > Ref(HIGH. ref(C.3 Higher Highs H>Ref(H.-1).-1).Gap Down GapDown() .-2).-3) BAR .ref(C.9).o{then doji}.20.if(ref(fml(#27).o{then filled}.14)))/log(10))/(log(14)/log(10)))*100 (Go Top) Common Metastock Bar Patterns BAR .if(O.>=.S) 69 Volume % above/below 10 day MA (V-mov(V.0).-1).0).0). +1).if(O.-3)<Ref(L.-1) AND H-L >= Ref(HHV((H-L).o{then empty}.-2).>.0.$)*V.1.0) AND If(LOW < Ref(LOW.0).Expansion Sell If(C < Ref(LLV(C.-1)).+1).>=.-2)<Ref(L.<.1).20.<.1.S) 70 # of STD's of volume (V-mov(V.<=.>.S))/mov(V.>.-4)<Ref(L.1.$).0) 74 Filled Candlestick if(C.0).40) 80 Choppiness Index (TASC) ((log(sum(atr(1).+1.S)(2*(std(C.1.-1).-5) BAR .S))/std(V.+2). <. -1).<=.>=.$).0) BAR .=.<=.0.10.1.roc(C.ref(C.0) 75 Doji if(C.0) 77 Bullish engulfing lines if(fml(#27).0) AND If(HIGH > Ref(HIGH.-2) AND Ref(L.-2)<Ref(L.1.+1.-1)).0).-2) AND Ref(L.0) AND If(LOW < Ref(LOW.20.S)+(2*(std(C.ref(C. 0) BAR .50) BAR .75) AND C >= L + ((H-L) * .Lizard Sell If(O <= L + ((H-L) * .-1) <= Ref(Mov(C.Inside Day + Day 3 Ref(Fml("BAR .-1) AND LOW < Ref(LOW.0) BAR .Narrow Range 4 HIGH .-1).-1) BAR .-1) BAR .9).25) AND C <= L + ((H-L) * .Highest High Value Bars Ago HHVBars(CLOSE.50.9).LOW < Ref(LLV(H-L.1.1.-1).Outside Day & > C Outside() AND C>Ref(C.S)) OR Ref(L.50.-1) BAR .50.-1) BAR .O > Yesterday's C O>Ref(C.-1) AND ((H >= Mov(C.-1) BAR .-1) AND LOW > Ref(LOW.-1)) AND C > Mov(C.1.-1) BAR .-1)) AND C < Mov(C.S)) OR Ref(H.Highest Bars Ago HighestBars(CLOSE) BAR .S).S).Inside Day HIGH < Ref(HIGH.75) AND L < Ref(LLV(L.Narrow Range 7 HIGH .50.6).Pivot Buy If(H-L > Ref(HHV((H-L).-3) BAR .0) BAR .Reaction Day with Volume ReactionWithVol() .Pivot Sell If(H-L > Ref(HHV((H-L).9).1.S).Outside Day HIGH > Ref(HIGH.BAR .Lizard Buy If(O >= L + ((H-L) * .0) BAR .S).50.-1) AND ((L <= Mov(C.3).-1) >= Ref(Mov(C.-1) BAR .Inside Day").H > Yesterday's H H>Ref(H.50.LOW < Ref(LLV(H-L.9).25) AND H > Ref(HHV(H.Gap Up GapUp() BAR . .Surprise Day Up O>Ref(C.CLOSE. +1.1. Downside If(Ref(Fml("congestion index").{and} If(Fml("congestion index").0.10.S).80)-LLV(C.=.0).S).Typical Price Typical() (Go Top) Congestion Index ((HHV(C.<.80))/LLV(C.>=.-1).10.-5).1)) (Go Top) Consolidation Breakout.-1) BAR . {and} If(CLOSE.>. COLUMN FORMULAS Column A : Vol ratio std(log(C/ref(C.80).-1) AND C<O AND C>Ref(C.-5)).>=.0).BAR .0) (Go Top) Connors & Raschke's Historical Volatility System Here is the Connors and Raschke's historical volatility system exploration in August 1996 TASC Trader's Tips translated for MetaStock.5) AND (when(colB.10.0).<.<.-1).>=.1.ref(LOW.80))*100 Consolidation breakout (upside) If(Ref(Fml("congestion index").Trough Value .0) Column C : Inside if(HIGH.<.-5).0) Consolidation breakout (downside) If(Ref(Fml("congestion index").5.0) Column D : High HIGH Column E : Low LOW FILTER FORMULA Formula: when(colA.5)/std(log(C/ref(C.1.ref(llv(H-L.=.<.-5).5*(Ref(Mov(V.-5).{and} If(Mov(V.<.-1) BAR .+1.0).10{%}.-1)).Surprise Day Down O<Ref(C.10{%}.-1).-5).-1) AND C>O AND C<Ref(C.0).Ref(LLV(C.S).1.if(LOW.3). {and} If(Mov(V.-5)).0).5) BAR .60.Reaction Day Reaction() BAR .5*(Ref(Mov(V.Ref(HHV(C.1) OR when(colC.>.ref(HIGH.80).<.5.5 Trough(1. {and} If(Fml("congestion index").-1)). {and} If(CLOSE.99) Column B : NR4 day if(HIGH-LOW.60.0).>=.S). Ref(LLV(C.{and} If(Fml("congestion index"). The calculation point for the CBL line might be 5.<.-5)). {and} If(CLOSE.0) (Go Top) Consolidation Breakout. {and} If(CLOSE.10.>=.Also watch for the way 'gap' days are treated.-5).1. Daryl Guppy) Copied from StockCentral .0). {and} If(Fml("congestion index").-5). This is very good.S).S).Ref(HHV(C.80).-5).0).10{%}.<. Upside Col A: CLOSE Filter: Fml("Consolidation breakout (upside)") = 1 Filter enabled: Yes (Go Top) Consolidation Over 16 Weeks Col A: CLOSE Filter Fml("congestion index") <= 10 AND BarsSince(Fml("congestion index")>10) > 0 Filter enabled Yes Here is the "congestion index" formula: ((HHV(C.1.>=. +1.Thanks Ken D .-5)).>=. 10.0).60.5.80)-LLV(C. {and} If(Mov(V.0).S). +1. but the limitation is the lookback period.80))/LLV(C.>=.0).60.80))*100 (Go Top) Countback line for Metastock (Note.>. 30 days away from todays date.10{%}.0).5*(Ref(Mov(V.5.0) Stocks breaking out of consolidation (downside) Col A: CLOSE Filter: Fml("Consolidation breakout (downside)") = 1 Filter enabled: Yes Here is the "consolidation breakout(downside)" formula: If(Ref(Fml("congestion index").80). 15.S).5*(Ref(Mov(V. {and} If(Mov(V. . else. Not unexpectedly. {4th day back low..-1) < L)..-2).-2) AND Ref(L. there seems to be a need for two different formulas to handle the issue: . If(HIGH < HHV(HIGH. ACKNOWLEDGEMENTS . though a bit of thought should overcome this limitation .-4). Alternatives of presentation style are many.} Ref(L.-1) AND Ref(L.52.-3) AND Ref(L. which may cycle more or less frequently and require different timeframes.but if it came to this perhaps the trade should be left alone anyway! Owing to price vagaries it is not unusual for a CBLhi to be less than a CBLlo calculation.-4) < Ref(L.one for the CBL from a LOW (CBLlo)..-1) < L)..Well ... particular credit is warranted by the significant contributions from Bryan Stanton and Siobhan Channon. LIMITATIONS .} If((Ref(L. This helped forge a somewhat more robust solution. about 30 requests for the formulas I use were received.-4)< Ref(L. Because of the use of PREV they won't work in some earlier MetaStock versions it seems.-3) < L) AND (Ref(L. which is here given to the wider audience of this Forum..} If((Ref(L. {then . -5) to a greater number of comparison days by appropriate copying and adjustments to the basically simple pattern in these formulas .. . {then ..-3) < Ref(L..-4) < Ref(L.the other for the CBL from a HIGH (CBLhi).-2) AND Ref(L.-4) < L) AND (Ref(L.-3)< L OR Ref(L..} PREV. } Ref(L. {2nd day back low.-5)< Ref(L. {3rd day back low. With MetaStock. {then.-5) < Ref(L.please provide solutions where possible... according to taste. but we are here requesting improvements in substance. The formulas given below were generated using v. HighDays). a few defects were found with the original offerings.-3) AND . With thanks to the several people who have commented. Also. {previous CBLhi. 55. else. 3.-1) AND Ref(L. needed to gauge the probability of a CBL-indicated counter-trend holding. or the converse.this is one of the potential weaknesses which commands individual interpretation for a particular equity or contract..-1)< L..anyone able to comment? As written they are based upon relative prices over a DEFAULT cover of 13 days (but adjustable from 3 to 55 days) . so that further improvements may be forthcoming.} If((Ref(L.-4) AND Ref(L. especially with low-gradient trends or sideways price movements.-3). else.. 13). identification of possible flaws.-2) < L OR Ref(L.-2) < Ref(L.. {then . copy exactly from "HighDays" or "LowDays" down to "PREV )))))" into the Indicator Builder. NOTE: With each formula below.} If(Ref(L..-2) < L AND Ref(L..-1) AND Ref(L. last weekend I replied to a post requesting a MetaStock solution for calculating the Countback Line discussed in Daryl Guppy's book "Share Trading: An Approach to Buying and Selling".-3)< Ref(L. Other indicators and assessments are.. else.. or have real simplification benefits ...6. } Ref(L. Subequently. all constructively it is pleasing to say. of course..-2)< L OR Ref(L. CBLhi: HighDays := Input("Enter # days to cover last HIGH for CBL calc'n:". for particularly choppy or indecisive circumstances there may be a need to extend the Ref(H or L. S). and this for bearish: dt:=FmlVar("GANN-Trend".-2) > H OR Ref(H.5) > H) AND (Ref(H. dplot:=If(BarsSince(dt=1)> BarsSince(dt=-1). Under highlights tab create a new and call it "HiLo Change". } Ref(H. Regards. (Go Top) Create a Gann Swing Expert Instructions 1.-4) AND Ref(H.-1) > H).. 2b. and enter this code: HLd:=If(CLOSE>Ref(Mov(H.-5) > Ref(H.-3) < L OR Ref(L.-4)> H OR Ref(H.-4)< L OR Ref(L. I also turn off the corner option.-1) > H).-3) > H) AND (Ref(H.-4)> Ref(H. 13).-1) < L). uplot:=If(BarsSince(Ut=1)< BarsSince(Ut=-1).-5) < Ref(L.} If((Ref(H..-2) > H OR Ref(H.3) > Ref(H.} PREV ))))) Please advise of any problems or suggested improvements in calculating the CBL.. It is again emphasized that this is by no means proposed as the best solution.else... uplot=1. {4th day back high. {2nd day back high.} If((Ref(H.-4) > Ref(H.-2) > H AND Ref(H...} If((Ref(H.-5) < L) AND (Ref(L. {then .. 3.-3)> Ref(H.-2). {previous CBLlo.-5) > Ref(H.-2) AND Ref(H. {5th day back high..-5) > Ref(H.. 2a.else. dplot=1.-5). {then .} PREV ))))) and for the CBL from a LOW CBLlo: LowDays := Input("Enter # days to cover last LOW for CBL calc'n:".-3)> H OR Ref(H..-5)..else..else.. else.-1).-2) AND Ref(L.} Ref(L."TDV").-4) > Ref(H. 3a.} PREV...-3) > H OR Ref(H.-1) > H). but as ONE solution which seems to work. under "trends" tab put this code for bullish: ut:=FmlVar("GANN-Trend".. {5th day back low.-1) AND Ref(H.3.1.Ref(L..-5)> Ref(H. } Ref(H.-5) < Ref(L..."TDV").-2) > Ref(H.} Ref(H.-4) > H) AND (Ref(H.-2) AND Ref(H.0).-2) AND Ref(H. choose color.0)..-3) AND Ref(H.4). {then. else.1.-1)> H.-1) AND Ref(H.-1) AND Ref(L.-2)> H OR Ref(H. Then click on the "ribbon" option and turn off "Display Vertical Lines".-1) AND Ref(H. First create a new expert and name it whatever you want.. {then . {then .} If(Ref(H.-3) AND Ref(H.-2) < L OR Ref(L.-3). {then}1. LowDays). {then . If(LOW > LLV(LOW.} Ref(H. . 55...-1) AND Ref(H. {3rd day back high. (Go Top) Creating Dynamic Vertical Lines from Ken These are dynamic moving vertical lines.HLd<>0. LastLoadedBarNum:=LastValue(Cum(1))."TDV"). then pick "Above Price Plot". and enter this code: ut:=FmlVar("GANN-Trend".1.0) . choose color (Dark Red).HLd). choose color (Dark Green). and enter this code: dt:=FmlVar("GANN-Trend". dplot=1. 0. {then}-1....89). choose color.1.. How to Create a Vertical Line in MetaStock {Plot in Stoch window} {.1000..3. choose color. 4b. then pick "Below Price Plot".0)."SD2")=-1.. 3c. Each new bar causes the line to move orward one bar.you can change the 100 and 0 to 80/20 or ?} n:=Input("Bars Before LastLoadedBar". Create new and call it "Down-Trend".{else}If(CLOSE<Ref(Mov(L. then under graphic choose "Buy Arrow". and small size. Create new and call it "DownSwing".-1). -1). If(Cum(1)=(LastLoadedBarNum-n)+1. and small size. As for the HiLo . enter this code: FmlVar("GANN-Swing". Under "Symbols" tab create new and call it " UpSwing". then under graphic choose "sell arrow".100.. {else}0)).just plot it as a regular indicator and choose the last "style" option under "color/style" tab.. ."TDV"). HLv<>Ref(HLv. HLv:=ValueWhen(1. uplot:=If(BarsSince(Ut=1)< BarsSince(Ut=-1). Create new and call it "Up-Trend"."SD2")=1. dplot:=If(BarsSince(dt=1)> BarsSince(dt=-1). uplot=1. enter this code: FmlVar("GANN-Swing". 4a.S).0). 3b.or Create a new Expert. S). then drag Expert to Stochastic inner window (Go Top) Cross Above 200 MA on Twice Average Volume Filter (C>Mov(C.S) AND Ref(C. I just leave the Slowing Periods (mp3) to 1.377. Chande. attach Expert.mp2)-( LLV(RSI(mp1). Chande's result was therefore sort of choppy.5).1).200. I'm trying to further find consensus among users of StochRSI on what really appears to work for them.mp2)). didn't use a moving average on the whole thing. Delete or rename the "Neutral" label.377.mp2)))).S)*2 (Go Top) Crossing Below 200 Day MA on Double Average Volume Filter (C<Mov(C. from various posts.200.E)*100 Now. However.mp4.mp3).200. so it really plays no part in things.377.S)..-5)>Ref(Mov(C. check Display Ribbon.. if somebody presents a good argument for using other than 1 .377.1. In "Ribbon". mp2 and mp4) *seem* to be the one's recommended. Plot Stochastic on chart.0000001+ (HHV(RSI(mp1). mp4:=Input("EMA Periods". mp3:=Input("Slowing Periods". Mov(Sum((RSI(mp1)-LLV(RSI(mp1). mp2:=Input("Stoch Periods". the original inventor..200.1.mp3)/Sum((. Choose Bullish color. Display Vertical Line. Cum(1)=(LastLoadedBarNum-n)+1 In "Corner".-5)) AND C>5 AND V>Mov(V. Basically. the following parameters (mp1. LastLoadedBarNum:=LastValue(Cum(1)).-5)<Ref(Mov(C.1.S)*2 (Go Top) Customisable StochRSI from Nicholas Kormanik The formula I've adopted was put on the Silicon Investor web site thread by 'bdog'.-5)) AND C>5 AND V>Mov(V. etc. I'm amenable.S) AND Ref(C.13).200. and "Ribbon's inner window".200. hey. Here's the MSWin formula: mp1:=Input("RSI Periods". I guess along the way people decided to add the EMA Periods to smooth things out.1. UNcheck "Display symbol in Expert corner". n:=89.13).Place the following in "Trends"/"Bullish". StochRSI Set . m+k. relative comparison ratio} Mov(C.21 -.+10. JKcycl --------------------------MetaStock 6. tv1:= thresh*Value1.-hld).nl "Trading Stocks With A Cyclical System" by Jeffrey Owen Katz (TASCFeb1999).m.June1999).21 233 -.5 13 -.S)-Mov(C.89 -.0)).m.21 89 -. Value1:= {volatility} Stdev(Mov(C. JKcycl:=If((EL>0)=1.5 by Ton Maas -The Netherlands .-10.13 21 -.34 (Go Top) Cyclical System from Ton Maas
[email protected]).J O Katz Formula: {TASC Feb99} thresh:= {omit whipsaw} 4.tv1).S). CS:={Close Short} Ref(Cross(tv1.5 Indicator ----------------------Name: Cyclical System . back in the Feb99 Trader's Tips section of TASC). (Translated for MetaStock 6.13 21 -.m+k.15 -. k:= {roc comparison period} 3. My guess is that Equis (Alan McNichol) was not in the possession of them when he wrote the Equis version of the system. ---------------------------------------------------------------------------(The system's original Easy Language formulas+system were derived from theabove mentioned TASC article). CL:={Close Long} Ref(Cross(Value2.13 -. ES:={Enter Short} Value2<tv1.233 -.34 -.13 -.8 -.13 34 -.34 89 -.5 -. If((ES>0)=1. hld:= {maximum period holding position} 10.S)-Mov(C. ----------------------MetaStock 6.13 55 -. m:= {cycle period} 63.S).Value2).55 -.20).3 8 -. EL:={Enter Long} Value2>tv1. Value2:= {roc.-------------------5 -.5 System Tester --------------------------- . set Positions to "both".m.S).-1 ) ) .Value2).TASC-article (see also TRADERS' TIPS)} Formulas: {copy-repeat all that is printed below when applying for the right rule} thresh:= {omit whipsaw} 4.C ) ) .m.5))+(CMO(C.13.20).2). tv1:= thresh*Value1. For interpretation refer to the book The New Technical Trader.14 ) CMO_Final . Then click Options. ( C .20). by Tuschar Chande and Stanley Kroll. -1 ) . Rules: {Enter Long} Value2>tv1 {Close Long} Ref(Cross(Value2.20))/(S1+S2+S3).20)))/3) (Go Top) Chande Momentum Oscillator Volatility S1:= Stdev( CMO(C. which is not advisable.0 ) .S).Ref( C .> .m+k.S). and then open a chart and run the system. leave the factory default settings).Periods.5). Click OK to save the changes. hld:= {maximum period holding position} 10. (Go Top) Chande's Momentum Oscillator The following are MetaStock formulas for Tuschar Chande's Momentum Oscillator.-hld) {After entering the formulas.< .Cyclical System Notes: {February 1999 . CMO_1 Sum( If( C .Ref( C . relative comparison ratio} Mov(C. S2:= Stdev(CMO(C.-hld) {Enter Short} Value2<tv1 {Close Short} Ref(Cross(tv1.-1 ) .Periods. set the Trade Delay to zero. click OK.S)-Mov(C.20).5))+(S2*CMO(C.10). CMOV. Value2:= {roc.10). ( Ref( C .S)-Mov(C.10))+(CMO(C.tv1).5).Ref( C.Name: Jeffrey Owen Katz . Mov(Mov(Mov(Fml("Candlecode").0 ) .m+k. and then set any other desired options (apart from Optimizing.2.-1 ) .14 ) CMO_2 Sum( If( C .S). m:= {cycle period} 63.Periods. Value1:= {volatility} Stdev(Mov(C.10))+(S3*CMO(C. k:= {roc comparison period} 3.} (Go Top) Candle Strength Index Periods:=Input("Enter Periods". CMOV:=(S1*CMO(C. On the Testing page. S3:= Stdev(CMO(C.S) (Go Top) Chande Momentum Oscillator Composite Average (((CMO(C. 0). by helping to pinpoint the best performer.-13).Ref(C.-19).REF(C. (This is called dragging and dropping an indicator on an indicator. Load the S&P 500. Drag the S&P 500 plot into a new inner window of the equity.(C-Ref(C.-15). The new indicator will plot in the same window as the S&P 500 plot. moving it over the plot until the plot changes to a pink or lavender color. To Run an Exploration Using Comparative Relative Strength . apply this template to the equity's chart. Save this chart as a Template.-1)+If(C>=Ref(C.1.) 4..) Any time you want to see Comparative Relative Strength of an equity against the S&P 500.1.14))) /((Sum(If(C. Create a custom indicator: Div(close.-1)+If(C>=Ref(C.1.-11).-1)+ If(C>=Ref(C.100 * ( ( Fml( "CMO_1" ) . this template will no longer work.) 1.1.-17).-1)+If(C>=Ref(C.-14).-16). or whatever you wish to find the relative strength for.0). Both data files should be in the same periodicity.-1)+If(C>=Ref(C.14)+ (Sum(If(C. purchase of the best performer "long". 7.0).>.<. both of which must first have been collected from your vendor.-1).<.-18).(C-Ref(C.-1). p) 6. (Go Top) Chande's Trendscore If(C>=Ref(C.MWT. Close the S&P 500 chart.1. such as CMPRELST. and selling the weaker issues "short. 2.-1).-1). you can change this by replacing every occurrence of 14 with your desired time period value. Load the equity.-1)+ If(C>=Ref(C. 5.e.-1)).14)))) *** These formulas were constructed using 14 time periods.1. we assume an equity/stock is compared to the S&P 500.-1)-C). (File|Save As. and give it a name. so that it is effectively invisible. The syntax would be: 100*((Sum(If(C. i.0).(REF(C. such as the S&P 500.) You have two options here: o You can change the color of the S&P 500 plot to be the same as the chart background color. They can also be useful in developing spreads.-1)+If(C>=Ref(C.>.1.-20).-1)+If(C>=Ref(C. Drag the custom indicator into the inner window containing the S&P 500 plot.-1)).-12). 3. set "Save File As Type" to Template." Comparative Relative Strength can be applied in MetaStock for Windows as follows: Creation of a Template for Comparative Relative Strength (For this illustration. (Double-click the S&P 500 plot to get to its "properties".-1)-C). then release your mouse button. (You may need to click Stack first.Ref(C. then choose the color you need from the Colors list. and would have to be recreated.1.14))-(Sum(If(C.Fml( "CMO_2" ) ) / ( Fml( "CMO_1" ) + Fml( "CMO_2" ) ) ) You could also combine the above three formulas into one formula. (REF(C.REF(C.) o You can give both plots different colors so you can tell which is which. Note: if you should move the data file against which you are comparing.1.-1) (Go Top) Comparitive Relative Strength in MetaStock™ for Windows Comparative Relative Strength charts can be useful in deciding which security to buy.-1)+ If(C>=Ref(C.1. .10. 2..: Taken from Stocks & Commodities. (Note: the S&P 500 plot must change to pink/lavender color before you drop it.5/ Sqrt(50 * V)). 3. The mind is attuned to percentage changes because they represent returns.S).) Confidence % (Sum(Mov(C * (2. stock (MSFT) at $50 and it goes to $80. The results are displayed in the Exploration report. SIMPLEST FORMS The moving average is the simplest form of adaptation-level. If you bought Microsoft Corp. Drag and drop this indicator on the S&P 500 (or whatever. you make 60% before dividends. written by Elliot Middleton..). If you bought Berkshire Hathaway (BRK) at $4. If. Coppock reasoned that the market's emotional state could be determined by adding up the percentage changes over the recent past to get a sense of the market's momentum (and oscillators are generally momentum indicators ). If we're shopping for a mortgage and rates have been in the teens (as they were in the early 1980s) and then drop to 10%. It's the percentage change that counts.5) LLV(Mov(C * (2. It all depends on your perspective. Moving average crossover rules accurately signal the onset of periods of returns outside the norm.5). Create a custom indicator of the Close. in the article "The Coppock Curve". 12:11 (459-462): The Coppock Curve by Elliott Middleton "We are creatures of habit. The oscillator is also based on adaptation-level.S)LLV(Mov(C * (2. So if we compare prices relative to a year ago .10. (P is a special variable that points at the last indicator plotted or selected.5/ Sqrt(50 * V)).1. 5.which . we are disappointed. we are elated.000 and it rises to $4.10.) The indicator will plot. 3 ) / Sum(HHV(Mov(C * (2. although in a slightly different way. stock prices and virtually every other variable in our lives. 4.030. The principle of adaptation-level applies to how we judge our income levels. Oscillators generally begin by calculating a percentage change of current price from some previous price. Relativity again. This makes moving average crossovers useful to traders who want to get a boost on entering or exiting stocks or funds.5). V.75% before dividends.5/ Sqrt(50 * V)).S).10. the same dollar gain. Psychologically. where the previous price is the adaptation-level or reference point. 6.p) in column A. relativity prevails. Load the S&P 500 (or whatever you want to compare against). whether positive or negative. Select the indicator plot (by single-clicking with the left mouse button on the line). 3) ) * 100 Coppock Curve The Coppock Curve was developed by Edwin Sedgwick Coppock in 1962. It was featured in the November 94 issue of Technical Analysis of Stocks& Commodities. they've been at 8% and then rise to 10%.5/ Sqrt(50 * V)). and specify which directory to explore. We judge the world relative to what we have experienced.S). you make 0. however. Do an Exploration with DIV(Close. 7.22.%). you may want to zoom in a little to make it easier to draw the Trend Channels more precisely. Hartle did in the article.S).S)>Mov(C. First. and 10%.. click on the Trendline button. and then check the Snap to Price checkbox. you can go to the properties of each of these trendlines and choose to extend the lines to the right..5. Next you may want to identify the bars for the support or resistant points by drawing circles on the bars as Mr.and we see that this month the market is up 15% over a year ago. also located on the Drawing Toolbar.S)<Mov(C. Next." The MetaStock™ formula for the Coppock Curve is: (MOV(ROC(MOV(C. Bullish: Mov(C. After identifying the points to draw the trendline. If you are using MetaStock 6. Finally. then we may judge that the market is gaining momentum and. Shark – 32 In MetaStock for Windows you can use the Expert Advisor to recreate the "Shark – 32" signals on your charts as discussed in Walter T.150. like a trader watching for the upward crossover of the moving average. Down's article "Combining Statistical and Pattern Analysis".S). enter the following formula in the Condition field. we may jump into the market. .250. and draw the trendline between the closing prices of the two bars.20. and enter "3rd Bar" in the Name field.S).5% over a year ago. and then choose OK. choose properties. Trends: Click the Trends tab and enter the following formulas in the Bullish and Bearish fields.20. You can do this by clicking on the "+" button located on the Chart Toolbar at the bottom of the chart.happens to be the most common interval . you may want to right-click on the trendline.5. the months before that.5. (Go Top. After opening a chart.5% and 5%. To create the second trendline of the Trend Channel.E))/100 Channel Analysis Channel Analysis. beginning on page 18 of the July 1998 Technical Analysis of Stocks & Commodities Magazine It's quite easy to create the Trend Channels discussed in Thom Hartle's Channel Analysis article in MetaStock for Windows. or you can use symbols from the symbol palette. last month it was up 12. Bearish: Mov(C. choose New and enter the following formulas: Name: Click the Name tab and enter "Shark – 32" in the Name field. respectively. Drag this parallel line so it aligns with the highest high between the two support points or the lowest low between two resistance points. choose Expert Advisor from the Tools menu in MetaStock 6. If desired.5. Highlights: Click the Highlights tab.) Combining Statistical and Pattern Analysis. right-click on the first trendline and choose Create Parallel Line. Both can be chosen from the Drawing Toolbar which is on left side of the chart. This will make the trendline line up exactly with the closing prices. choose New. Now change the color in the Color field to Blue. -2)-Ref(L.-2). *} Buy:= Buyok=1 AND Ref(Chk.-1)=0 AND ValidChk=1. Shark:=If((H<Ref(H.0). Apex:=(H+L)/2.28.-1)<Ref(H. enter the following Symbol formula.-1) AND Ref(H. Buyok:=Cross(C.-2) AND Ref(L. If the price does not cross above the High value of the base within 25 periods. enter the following 2 highlight formulas.-2))=1.+1)=1. Shark:=If((H<Ref(H. WB:=Ref(H.-1)>Ref(L. and then choose OK.28.If(apex <= (Ref(H. Shark. Apex:=(H+L)/2. Symmetry:=.0).-2). Change the symbol in the Graphic field to Buy Arrow.-1) AND L>Ref(L. Ref(Shark. Ref(Shark.-1) AND L>Ref(L. WB:=Ref(H.-2) AND Ref(L.-2)+(WB*Symmetry)) .25).-2))=1.Symmetry:=. Apex:=(H+L)/2.-2)-(WB*Symmetry)) AND Apex> = (Ref(L.28.-2)-Ref(L. Shark:=If((H<Ref(H.0).-2)-(WB*Symmetry)) AND Apex >= (Ref(L.1.-2)-Ref(L.0).1.-2))=1.-1)>Ref(L.Shark=1. Shark:=If((H<Ref(H. Buy.+2)=1. Using the Same method as above.-1) AND L>Ref(L.0).28.-1)>Ref(L.ValueWhen(1. {Note* The above ValidChk variable makes the Shark signal valid for 25 periods.If(Apex <= (Ref(H.0).-1)<Ref(H. Finally. You can change the number of periods by changing 25 to the number of periods you desire. Now change the color in the Color field to Green.-2)-(WB*Symmetry)) AND Apex> = (Ref(L.-1) AND L>Ref(L.-2)+(WB*Symmetry)) . Click the Graphic tab.-2) AND Ref(L. Chk:=Cum(Buyok)-ValueWhen(1. ValidChk:=Alert(Shark=1.1.-2) AND Ref(L.Shark=1.-2))).-1) AND Ref(H. WB:=Ref(H. you will not receive a signal. Name: 1st Bar Color: Blue Condition: Symmetry:=. Now enter the following formula in the Condition field. Apex:=(H+L)/2.Ref(H.-2)+(WB*Symmetry)) . WB:=Ref(H.-2).-1) AND Ref(H.-1)<Ref(H.Cum(Buyok)).-1)>Ref(L.-2))=1.-1) AND Ref(H.-2). Using the same method as above. Name: 2nd Bar Color: Blue Condition: Symmetry:=.If(Apex <= (Ref(H.-2)-(WB*Symmetry)) AND Apex >= (Ref(L.-2)-Ref(L.0). type "Buy" in the Label field. choose New and enter "Shark Buy" in the Name field.1. Symbols: Click the Symbols tab.0).-2)+(WB*Symmetry)) .If(Apex <= (Ref(H. Name: Shark Sell Condition: .-1)<Ref(H. Symmetry:=. and then Close. The test appears in the article "Combining Trend and Oscillator Signals" by Jeremy G.-1 ) ) Enter Short When( CCI( opt1 ) . Konstenius. WB:=Ref(H.-1)=0 AND ValidChk=1.-1)<Ref(H.Ref( Mov( CCI( opt1 ) .. choose Attach. *} Sell:= Sellok=1 AND Ref(Chk.opt2 .0). you will not receive a signal.If(apex <= (Ref(H.Cum(Sellok)). If the price does not cross below the Low value of the base within 25 periods. Symbol: Sell Arrow Color: Red Label: Sell After you have finished creating the Symbol formulas. Shark:=If((H<Ref(H. Signal Formulas Enter Long .-2))=1..-2)). (Go Top. Sellok:=Cross(ValueWhen(1.opt2 ..Shark=1. Sell. {Note* The above ValidChk variable makes the Shark signal valid for 25 periods.-2)-(WB*Symmetry)) AND Apex >= (Ref(L.0 or higher • Click Tools | System Tester | New • Type a name for the test in the Name column • Enter the following System Test rules and options.opt2 .25).) CCI Moving Average Crossover Test System Explanation: Buy when the Moving Average crosses up through the CCI and sell on the reverse condition.-2).<= . ValidChk:=Alert(Shark=1. Select the Expert called "Shark – 32" from your list of Experts.opt2 . Signal Formulas Enter Long When( CCI( opt1 ) .E ) ) AND When( Ref( CCI(opt1) .-1) AND L>Ref(L.E ) ) AND When( Ref( CCI(opt1) .0).-1) . Apex:=(H+L)/2.Ref( Mov( CCI( opt1 ) .-2)-Ref(L.28.Mov( CCI( opt1 ) . You can change the number of periods by changing 25 to the number of periods you desire.-1) AND Ref(H.-2)+(WB*Symmetry)) .-1) .< .> .-2) AND Ref(L.) Combining Trend and Oscillator Signals The information for this test was published in the December 1996 issue of Technical Analysis of Stocks and Commodities. Konstenius describes a trading system that combines Linear Regression and Moving averages to generate trades. you can attach the Expert to your chart by choosing Expert Advisor from the Tools Menu. Chk:=Cum(Sellok)-ValueWhen(1.-1)>Ref(L. Mr.1.E ) .C).-1 ) ) Optimization Variables Opt1: Min = 5 Max = 40 Step = 1 Opt2: Min = 5 Max = 40 Step = 1 (Go Top.Ref(L.. To create this test in MetaStock do the following: • Run MetaStock version 6.Shark=1.Mov( CCI( opt1 ) .E ) .>= . -250 ) Close Long When( enter your criteria here ) Enter Short When( Ref(CCI( 14 ) . You can modify this test by changing the distance from Minimum to Maximum or the Step used in each OPT variable.< ..OPT3).50) Close Long C<Mov(C. It will close long according to the criteria you specify in close long.OPT1.OPT2)<LinearReg(LinRegSlope(C AND LinRegSlope(C.OPT3).OPT3).50) Enter Short C<Mov(C. (Go Top.OPT1..-250 ) AND When(CCI( 14 ) .> .< .S) . Gregorian calendar }{ Count is independent of any missing chart data }{ ©Copyright 2003-2004 Jose Silva } {
[email protected])>LinearReg(LinRegSlope(C OR LinRegSlope(C. It enters a long position when yesterday's 14 period CCI is greater than -250 and today's 14 period CCI is less than -250.250 ) Close Short When( enter your criteria here ) ** You can change to a different periodicity other than 14 by changing every occurrence of 14 with the desired periodicity.> .. (Go Top.OPT2)<LinearReg(LinRegSlope(C OR LinRegSlope(C.50) AND LinRegSlope(C.C>Mov(C. Signal Formulas Enter Long When( Ref(CCI( 14 ) .) Commodity Channel Index Buy and Sell Signals This system generates buy and sell signals based on the criteria using the Commodity Channel Index indicator. It enters a short position when yesterday's 14 period CCI is less than 250 and today's 14 period CCI is greater than 250 and closes short according to the criteria you specify in close short.com } .OPT2)>LinearReg(LinRegSlope(C Optimize OPT1: Minimum 5 Maximum 50 Step 5 OPT2: Minimum 5 Maximum 50 Step 5 OPT3: Minimum 5 Maximum 50 Step 5 • Initial Equity: Any amount • Positions: Long and Short • Trade Price: Close • Trade delay: 0 The author uses weekly data and a $50 round turn commission.S) ..-1 ) .S) .-1 ) .OPT1.50) Close Short C>Mov(C.OPT1.OPT3).) Calendar Day counter { Day counter from 1/1/0001.S) .250 ) AND When(CCI( 14 ) . ) Calendar Day of Year { Calendar Day of Year counter }{ count is independent of any missing chart data }{ ©Copyright 2003 Jose Silva }{ josesilva22@yahoo. If(Month()=7. m:=leap+ If(Month()=2. If(Month()=10.151. If(Month()=8.com } limit:=1960. If(Month()=3. leap:=Frac(Year()/4)=0 AND Frac(Year()/100)<>0 OR Frac(Year()/400)=0. Day:=m+DayOfMonth().120. Day (Go Top.. If(Month()=9. LimLeap:=Frac(limit/4)=0 AND Frac(limit/100)<>0 OR Frac(limit/400)=0.90. If(Month()=5.2000). If(Month()=7. leap:=Frac(Year()/4)=0 AND Frac(Year()/100)<>0 OR Frac(Year()/400)=0. DayNr:=y+m+DayOfMonth(). NoCount:=limit*365+Int(limit/4)-Int(limit/100)+Int(limit/400)-LimLeap. -leap))))))))))).334. If(Month()=6.31-leap.304.212. {do not change limit year} LimLeap:=Frac(limit/4)=0 AND Frac(limit/100)<>0 OR Frac(limit/400)=0. If(Month()=9.59.) Calendar Weekday counter { Weekday (Mon~Fri) counter from 1960 }{ Count is independent of any missing chart data }{ ©Copyright 2003 Jose Silva } {
[email protected]. .151. DayNr (Go Top.com } leap:=Frac(Year()/4)=0 AND Frac(Year()/100)<>0 OR Frac(Year()/400)=0. If(Month()=6.304. NoCount:=limit*365+Int(limit/4) -Int(limit/100)+Int(limit/400)-LimLeap. m:= If(Month()=2. If(Month()=4. If(Month()=3. If(Month()=11.. If(Month()=12. y:=Year()*365+Int(Year()/4) -Int(Year()/100)+Int(Year()/400)-NoCount. If(Month()=11.243.limit:=Input("count calendar days from year"..1. If(Month()=4.212.181.2100. If(Month()=12.273. -leap))))))))))).181. If(Month()=10.243.59. If(Month()=5.273.31-leap. If(Month()=8. 273. NoCount:=limit*365+Int(limit/4) -Int(limit/100)+Int(limit/400)-LimLeap. y:=Year()*365+Int(Year()/4) -Int(Year()/100)+Int(Year()/400)-NoCount. If(Month()=8. If(Month()=6. If(Month()=5.0). If(Month()=5.90. If(Month()=10. If(Month()=9.0. If(Month()=7.1).304. {Fri} WkDayCount Missing trading days {Plots missing daily (weekday) bars count} {©Copyright 2003-2004 Jose Silva} {
[email protected]. .181. -leap))))))))))).243. If(Month()=6. If(Month()=4. No=0".151. WkDayCount:= Int((DayNr+3)/7)+ {Mon} Int((DayNr+2)/7)+ {Tue} Int((DayNr+1)/7)+ {Wed} Int((DayNr)/7)+ {Thu} Int((DayNr-1)/7).181.V=0. If(Month()=8.90. If(Month()=12.120. VolMissing:=If(ChkVol.59. DayNr:=y+m+DayOfMonth().243. {do not change limit year} LimLeap:=Frac(limit/4)=0 AND Frac(limit/100)<>0 OR Frac(limit/400)=0.31-leap. If(Month()=4. leap:=Frac(Year()/4)=0 AND Frac(Year()/100)<>0 OR Frac(Year()/400)=0.334.59.120.151. limit:=1960.y:=Year()*365+Int(Year()/4) -Int(Year()/100)+Int(Year()/400)-NoCount. m:= If(Month()=2. If(Month()=3. If(Month()=11.212.1. m:= If(Month()=2.212.31-leap. If(Month()=7. If(Month()=9.273. If(Month()=10.com} ChkVol:=Input("Zero-volume days = missing data days? Yes=1. If(Month()=11. If(Month()=3. If(Month()=12. If(Month()=5. -leap))))))))))). If(Month()=6. If(Month()=3.0.334. -leap))))))))))).212. If(Month()=7. DayNr:=y+m+DayOfMonth().120. If(Month()=4.243.) Calendar Week counter { Week counter v2.com } leap:=Frac(Year()/4)=0 AND Frac(Year()/100)<>0 OR Frac(Year()/400)=0.If(Month()=12.334.304.31-leap.181.90.com } limit:=2000. WkCount (Go Top. WkCount:=Int((DayNr-1)/7)+(Year()>=limit). If(Month()=8. DayNr:=y+m+DayOfMonth(). m:= If(Month()=2.. m:=leap+ . {Fri} WkDayCount-ValueWhen(2.WkDayCount)-1 +VolMissing (Go Top.59. If(Month()=11.151.273.. {do not change limit year} LimLeap:=Frac(limit/4)=0 AND Frac(limit/100)<>0 OR Frac(limit/400)=0.. NoCount:=limit*365+Int(limit/4) -Int(limit/100)+Int(limit/400)-LimLeap..1. leap:=Frac(Year()/4)=0 AND Frac(Year()/100)<>0 OR Frac(Year()/400)=0. WkDayCount:= Int((DayNr+3)/7)+ {Mon} Int((DayNr+2)/7)+ {Tue} Int((DayNr+1)/7)+ {Wed} Int((DayNr)/7)+ {Thu} Int((DayNr-1)/7).) Calendar Week of Year { Calendar Week of year counter v2. y:=Year()*365-715870 {count from 1960} +Int(Year()/4)-Int(Year()/100)+Int(Year()/400). y:=Year()*365+Int(Year()/4) -Int(Year()/100)+Int(Year()/400)-NoCount. Gregorian calendar }{ Count is independent of any missing chart data }{ ©Copyright 2003-2004 Jose Silva } { josesilva22@yahoo. If(Month()=9. If(Month()=10.1 }{ count is independent of any missing chart data }{ ©Copyright 2003 Jose Silva } { josesilva22@yahoo. If(Month()=5.If(fdy=5.304.. 01/01/1980~31/12/1999 } Year()=1980 OR Year()=1981 OR Year()=1982 OR Year()=1983 OR Year()=1984 OR Year()=1985 OR Year()=1986 OR Year()=1986 OR Year()=1986 OR Year()=1987 OR Year()=1987 OR Year()=1987 OR Year()=1988 AND Month()=04 AND DayOfMonth()=03 AND Month()=04 AND DayOfMonth()=16 AND Month()=04 AND DayOfMonth()=08 AND Month()=03 AND DayOfMonth()=31 AND Month()=04 AND DayOfMonth()=19 AND Month()=04 AND DayOfMonth()=04 AND Month()=03 AND DayOfMonth()=27 AND Month()=04 AND DayOfMonth()=24 AND Month()=12 AND DayOfMonth()=24 AND Month()=04 AND DayOfMonth()=16 AND Month()=12 AND DayOfMonth()=24 AND Month()=12 AND DayOfMonth()=31 AND Month()=03 AND DayOfMonth()=31 .2. Week (Go Top.334.5+offset)/(374+offset)) *(374+offset)/7)+1.181.212. If(fdy=6. -leap))))))))))). {offset necessary for week start sync} offset:=If(fdy=3.. If(Month()=9. If(Month()=4. If(Month()=8.5-leap)/7)*7)+1.3.-3.-1. If(Month()=12. {1st day of week in year} fdy:=Int(Frac((y+. If(Month()=6.If(fdy=7.90. d:=m+DayOfMonth().273.151.If(fdy=4.1))))). If(Month()=11.243.-2. If(Month()=3.120.) Calendar ASX non-Friday end-of-week(1) { ASX non-Friday end-of-week dates. If(Month()=7. Week:=Int(Frac((d+.If(Month()=2.31-leap. If(Month()=10.59. since 01/01/2000 } Year()=2000 OR Year()=2001 OR Year()=2001 OR Year()=2002 OR Year()=2003 AND Month()=04 AND DayOfMonth()=20 AND Month()=01 AND DayOfMonth()=25 AND Month()=04 AND DayOfMonth()=12 AND Month()=03 AND DayOfMonth()=28 AND Month()=04 AND DayOfMonth()=17 .OR Year()=1989 OR Year()=1990 OR Year()=1990 OR Year()=1991 OR Year()=1992 OR Year()=1992 OR Year()=1992 OR Year()=1993 OR Year()=1994 OR Year()=1995 OR Year()=1996 OR Year()=1996 OR Year()=1997 OR Year()=1997 OR Year()=1997 OR Year()=1998 OR Year()=1998 OR Year()=1998 OR Year()=1999 OR Year()=1999 AND Month()=03 AND DayOfMonth()=23 AND Month()=01 AND DayOfMonth()=25 AND Month()=04 AND DayOfMonth()=12 AND Month()=03 AND DayOfMonth()=28 AND Month()=04 AND DayOfMonth()=16 AND Month()=12 AND DayOfMonth()=24 AND Month()=12 AND DayOfMonth()=31 AND Month()=04 AND DayOfMonth()=08 AND Month()=03 AND DayOfMonth()=31 AND Month()=04 AND DayOfMonth()=13 AND Month()=01 AND DayOfMonth()=25 AND Month()=04 AND DayOfMonth()=04 AND Month()=03 AND DayOfMonth()=27 AND Month()=04 AND DayOfMonth()=24 AND Month()=12 AND DayOfMonth()=24 AND Month()=04 AND DayOfMonth()=09 AND Month()=12 AND DayOfMonth()=24 AND Month()=12 AND DayOfMonth()=31 AND Month()=04 AND DayOfMonth()=01 AND Month()=12 AND DayOfMonth()=30 Calendar ASX non-Friday end-of-week(2) { ASX non-Friday end-of-week dates. signal:=weekChosen=signalCount.5). Weekday-of-Month signals }{ Plot on separate window below chart }{ ©Copyright 2004 Jose Silva } { josesilva22@yahoo.. If(day AND d>28.3.com } ..) Calendar Week of Month { Calendar-absolute Week-of-Month signals }{ Plot on own window below chart }{ ©Copyright 2004 Jose Silva }{ josesilva22@yahoo. [2]Tue.5. If(plot=1.1). [2]Weekday count".1.2.signal. day:=DayOfWeek()=dayChosen.. plot:=Input("plot: [1]Weekday signals.signalCount) (Go Top.com } Fml("Calendar ASX non-Friday end-of-week(1)")+Fml("Calendar ASX nonFriday end-of-week(2)") OR DayOfWeek()=5 (Go Top.7.1.1. [4]Thu. [3]Wed.0))))).OR Year()=2003 AND Month()=04 AND DayOfMonth()=24 { future Thursday Easter dates } OR Year()=2004 AND Month()=04 AND OR Year()=2005 AND Month()=03 AND OR Year()=2006 AND Month()=04 AND OR Year()=2007 AND Month()=04 AND OR Year()=2008 AND Month()=03 AND OR Year()=2009 AND Month()=04 AND OR Year()=2010 AND Month()=04 AND DayOfMonth()=08 DayOfMonth()=24 DayOfMonth()=13 DayOfMonth()=05 DayOfMonth()=20 DayOfMonth()=09 DayOfMonth()=01 Calendar ASX true end-of-week { Plots correct end-of-week signals for ASX stocks.1).2. weekChosen:=Input("[1]st [2]nd [3]rd [4]th [5]th week in month". including ASX nonFriday end-of-week dates since 01/01/1980 }{
[email protected] } dayChosen:=Input("day: [1]Mon. If(day AND d>7 AND d<=14. d:=DayOfMonth(). If(day AND d>14 AND d<=21. [5]Fri".) Calendar Weekday of Month { Calendar-absolute. signalCount:= If(day AND d<=7. If(day AND d>21 AND d<=28. WeekOfMonth:=Input("[1]st [2]nd [3]rd [4]th [5]th week in month",1,5,1); plot:=Input("[1]Week signals, [2]Week count",1,2,1); d:=DayOfMonth(); weekNr:=If(d<=7,1, If(d>7 AND d<=14,2, If(d>14 AND d<=21,3, If(d>21 AND d<=28,4,5)))); signal:=weekNr=WeekOfMonth; If(plot=1,signal,WeekNr) (Go Top...) Cycle Length { Price peak/trough cycle length v4.0 }{ Warning: last peak/trough is dynamic!}{ Plot in own window below price chart } { 6/4/2004 ASX 1152 active stocks exploration, 3.25% ZigZag cycle lengths, mean price cycles: 3.7 trade days for positive price cycles; 4.5 trade days for negative price cycles; 8.2 trade days complete price cycles.} { ©Copyright 2004 Jose Silva }{
[email protected] } zzper:=Input("ZigZag reversal %",.001,100,3.25); pds:=Input("avg StdDev periods",2,2520,7); plot:=Input("[1]Cycles, [2]Cycle Avg, [3]Avg StdDev, [4]ZigZag",1,4,1); pk:=PeakBars(1,C,zzper)=0; tr:=TroughBars(1,C,zzper)=0; lastBar:=Cum(1)=LastValue(Cum(1)); lastLeg:=lastBar*LastValue(BarsSince(pk OR tr)); CycleUp:=pk*BarsSince(tr); CycleUpAvg:= Cum(CycleUp)/(Cum(CycleUp>0)+.000001); CycleUpStdDev:=Stdev(CycleUp,pds); CycleUpStdDevAvg:=Cum(CycleUpStdDev) /(Cum(CycleUpStdDev>0)+.000001); CycleDw:=tr*BarsSince(pk); CycleDwAvg:= Cum(CycleDw)/(Cum(CycleDw>0)+.000001); CycleDwStdDev:=Stdev(CycleDw,pds); CycleDwStdDevAvg:=Cum(CycleDwStdDev) /(Cum(CycleDwStdDev>0)+.000001); statCycle:=CycleUp-CycleDw; lastLeg:=If(ValueWhen(1,pk OR tr,statCycle)<0, lastleg,-lastleg)*lastBar; cycle:=statCycle+lastLeg; zz:=Zig(cycle,zzper,%); plotUp:=If(plot=1,0, If(plot=2,CycleUpAvg, If(plot=3,CycleUpStdDevAvg,0))); plotDw:=If(plot=1,cycle, If(plot=2,-CycleDwAvg, If(plot=3,-CycleDwStdDevAvg,zz))); plotUp;plotDw Market Cycle Explorations MetaStock -> Tools -> The Explorer -> New Copy and paste formulae below. Zig Zag price cycles *Input today's data date in filter section!* Last (dynamic) and previous (static) cycles, based on default values in indicator "ZigZag Cycle Length". 6/4/2004 ASX 1152 active stocks exploration, 3.25% ZigZag cycle lengths, last price cycles: 4 trade days for positive price cycles; 5 trade days for negative price cycles; 9 trade days complete price cycles. ©Copyright 2004 Jose Silva Column A: + cycle { last positive dynamic cycle } x:=Fml("ZigZag Cycle Length"); If(x>0,x,0) Column B: - cycle { last negative dynamic cycle } x:=Fml("ZigZag Cycle Length"); If(x<0,x,0) Column C: AbsCycle { absolute last cycle } Abs(Fml("ZigZag Cycle Length")) Column D: + prev { previous complete (static) positive cycle } x:=FmlVar("ZigZag Cycle Length","CYCLEUP"); ValueWhen(1,x<>0,x) Column E: - prev { previous complete (static) negative cycle } x:=FmlVar("ZigZag Cycle Length","CYCLEDW"); -ValueWhen(1,x<>0,x) Column F: TotalPrv { total last complete (static) full cycle } x:=FmlVar("ZigZag Cycle Length","CYCLEUP"); y:=FmlVar("ZigZag Cycle Length","CYCLEDW"); ValueWhen(1,x<>0,x)+ValueWhen(1,y<>0,y) Filter: { Today's data date, user-input section } day:= 6; { current day of month (1~31) } mth:= 4; { current month (1~12) } yr:= 2004; { current year, eg 2004 } { *********************************** } DayOfMonth()=day AND Month()=mth AND Year()=yr AND V>0 Zig Zag price cycle averages *Input today's data date in filter section!* Historical Average & StdDev of static cycles, based on default values in indicator "ZigZag Cycle Length". 6/4/2004 ASX 1152 active stocks exploration, 3.25% ZigZag cycle lengths, mean price cycles: 3.7 trade days for positive price cycles; 4.5 trade days for negative price cycles; 8.2 trade days complete price cycles. ©Copyright 2004 Jose Silva Column A: + avg { historical positive static cycle average } FmlVar("ZigZag Cycle Length","CYCLEUPAVG") Column B: - avg { historical negative static cycle average } -FmlVar("ZigZag Cycle Length","CYCLEDWAVG") Column C: TotalAvg { historical full static cycle average } FmlVar("ZigZag Cycle Length","CYCLEUPAVG")+ Abs(FmlVar("ZigZag Cycle Length","CYCLEDWAVG")) Column D: + StdDev { Standard Deviation of positive static cycles} FmlVar("ZigZag Cycle Length", "CYCLEUPSTDDEVAVG") Column E: - StdDev { Standard Deviation of nagative static cycles} -FmlVar("ZigZag Cycle Length", "CYCLEDWSTDDEVAVG") Column F: TotStdDv { Standard Deviation of full static cycles } (FmlVar("ZigZag Cycle Length", "CYCLEUPSTDDEVAVG") +FmlVar("ZigZag Cycle Length", "CYCLEDWSTDDEVAVG"))/2 Filter: { Today's data date, user-input section } day:= 6; { current day of month (1~31) } mth:= 4; { current month (1~12) } yr:= 2004; { current year, eg 2004 } { *********************************** } DayOfMonth()=day AND Month()=mth AND Year()=yr AND V>0 Dahl Oscillator I came up with the following to put Dahl into an oscillator format. It is the STOCHRSI formula, replacing RSI with a 55 day Dahl. Does this reflect your thinking on the indicator? It seems to lead changes in Dahl by a period or two, but doesn't seem as fast as the STOCHRSI indicator. Checking a few stocks in my database, there are very few times that it goes below zero, but it will 'peg out' at 100 for significant periods. Perhaps the 14 day smoothing is too short in relation to the 55 period primary indicator. A longer MA period seems to smooth it out significantly, which would seem to defeat the purpose of using an oscillator. Mov((mov(c,55,simp) - ref(mov(c,55,simp),-15)- LLV(mov(c,55,simp) ref(mov(c,55,simp),-15),14))/(HHV(mov(c,55,simp) - ref(mov(c,55,simp),15),14)-(LLV(mov(c,55,simp) - ref(mov(c,55,simp),-15),14))),14,E)*100 (Go Top) Dahl Variations Dahl Volume Trend Mov(C,55,VOL)-Ref(Mov(C,55,VOL),-15) PVT Dahl Trend: Mov((PVT()-Ref( PVT(),-15)),55,E) Smoothed OBV Vol 88: Mov((OBV()-Mov(OBV(),88,VOL)),55,E) OBV Dahl Trend: Mov((OBV()-Ref(OBV(),-15)),55,E) Compare each to ordinary Dahl or some other trend indicator. Remember, I put a 21 EMA trigger on each. (Go Top) Dave's New System (DNS) Is a binary consisting of 8 indicators.} If(SAR(.02,.2)<C,1,0) + If((Mov(C,5,E)>Mov(C,13,E)),1,0) + If((Mov(C,13,E)>Mov(C,40,E)),1,0) + If((Mov(C,8,E)-Mov(C,17,E))> (Mov(Mov(C,8,E)-Mov(C,17,E),9,E)),1,0)+ If(Mov(C,50,SIMPLE) - Ref(Mov(C,50,SIMPLE),-15) > 0,1,0)+ If((Mov(ROC(C,12,%),3,E)>=-6 OR ROC(C,12,%)>0),1,0)+ If(OBV()>Mov(OBV(),40,S),1,0)+ If(V>Mov(V,120,S),1,0) (Go Top) Days Since Crossover {place formula in filter section of explorer, making sure that formulas within quotes are valid indicators} BarsSince(Cross(45, Fml( "Stochrsi (14)" )))> BarsSince(Cross(Fml( "Stochrsi (7,3)" ),72)) AND Ref(BarsSince(Cross(45,Fml( "StochRSI (14)" )))< BarsSince(Fml( "staters (7,3)")>72), -1) (Go Top) Denvelope In the Oct issue of "Futures" there is an article written by Dennis McNicholl called "Better Bollinger Bands". In his article he describes how in a trending market the center band of the B.B. will shift away from the "mean" value of the price, and that the two outer bands will shift outward to such an extent that the envelope loses its utility as a volatility gauge (these are his words... not mine). As usual "Futures" only posted the TradeStation code, so this is my conversion from it. He called the Indicator "Denvelope", and it runs the bands much closer..... similar to "Standard Error Bands". {Denvelope} {Better Bollinger Bands} Lb:=Input("Look-Back Period ?",3,100,20); De:=Input("Band Deviation ?",.5,3,2); Alp:=2/(Lb+1); Mt:=Alp*CLOSE+(1-Alp)*PREV; Ut:=Alp*Mt+(1-Alp)*PREV; Dt:=((2-Alp)*Mt-Ut)/(1-Alp); mt2:=Alp*Abs(C-Dt)+(1-Alp)*PREV; ut2:=Alp*mt2+(1-alp)*PREV; dt2:=((2-Alp)*mt2-ut2)/(1-Alp); But:=Dt+de*dt2; Blt:=Dt-de*dt2; But; Dt; Blt; (Go Top) Denvelope (RSI) pds:=Input("Periods",2,200,14); sd:=Input("Standard Deviations",.01,10,2); D1:= RSI(pds); alpha:=2/(pds+1); mt:=alpha*D1+(1-alpha)*(If(Cum(1)<pds,D1,PREV)); ut:=alpha*mt+(1-alpha)*(If(Cum(1)<pds,D1,PREV)); dt:=((2-alpha)*mt-ut)/(1-alpha); mt2:=alpha*Abs(D1-dt)+(1-alpha)*PREV; ut2:=alpha*mt2+(1-alpha)*PREV; dt2:=((2-alpha)*mt2-ut2)/(1-alpha); but:=dt+sd*dt2; blt:=dt-sd*dt2; blt; dt; but; (Go Top) DEVSTOP Here's what I think a DEVSTOP is in MetaStock language, described in Kase's "Trading with the Odds", and better described in Kaufman's "Trading Systems and Methods". It uses a 2-day range, calculates an average range and SD of the range, and then draws 4 lines below the high, at 1 range and 0,1,2, and 3 SD's. "2.2" and "3.6" are corrections for skew of the distribution. AVTR:=Mov(HHV(H,2) - LLV(L,2),20, S); SD:=Stdev(HHV(H,2) - LLV(L,2),20); HHV(H-AVTR-3.6*SD, 20); HHV(H-AVTR-2.2*SD,20); HHV(H-AVTR-SD,20); HHV(H-AVTR,20); (Go Top) Displace Indicator Forward To displace an indicator forward, you use Ref(myInd,-p). The median and typical prices are built-in functions -- MP() is (H+L)/2 and typ() is (H+L+C)/3. For MP, use Period:= Input("What Period",1,250,10); Disp:= Input("Forward Displacement",0,250,10); EMA1:= Mov(MP(),Period,E); EMA2:= Mov(EMA1,Period,E); Difference:= EMA1 - EMA2; ZeroLagEMA:= EMA1 + Difference; Ref(ZeroLagEMA,-Disp) (Go Top) Divergence Between Close and Indicator Divergence between the Close and an Indicator (Rev. 03/18/97 from Equis Support) The following formula will calculate the correlation of the Close and the MACD. It is written using a "long form" MACD so that the time periods used by the MACD may be changed. This indicator shows "divergence" between the close and the indicator: In the Windows versions of MetaStock the formula is: Correl(((Sum(Cum(1)*(Mov(C,12,E)-Mov(C,26,E)),100))-(Sum(Cum(1),100)* Sum((Mov(C,12,E)-Mov(C,26,E)),100)/100))/((Sum(Power(Cum(1),2),100))(Power(Sum(Cum(1),100),2)/100)),((Sum(Cum(1)*C,100))(Sum(Cum(1),100)* Sum(C,100)/100))/((Sum(Power(Cum(1),2),100))(Power(Sum(Cum(1),100),2)/100)),12,0) The interpretation of the indicator output is as follows: - .08 (80%) and lower is divergence between the Close and the MACD. - 1 is very strong divergence. + 1 is very strong correlation. The formula was constructed this way so that most other indicators may be used in place of the MACD. For example, here is the same indicator using the RSI(14): Correl(((Sum(Cum(1)*(RSI(14)),100))-(Sum(Cum(1),100)* Sum((RSI(14)),100)/100))/((Sum(Power(Cum(1),2),100))(Power(Sum(Cum(1),100),2)/100)), ((Sum(Cum(1)*C,100))(Sum(Cum(1),100)*Sum(C,100)/100))/((Sum(Power(Cum(1),2),100))(Power(Sum(Cum(1),100),2)/100)),12,0) (Go Top) Double Inside Day {For today is an inside day} H < Ref(H,-1) and L > Ref(L,-1) and {For yesterday was an inside day} Ref(H,-1) < Ref(H,-2) and Ref(L,-1) > Ref(L,-2) (Go Top) Double Tops and Double Bottoms In the February 1998 issue of Technical Analysis of Stocks& Commodities magazine, Thomas Bulkowski discusses the use of Double Bottoms as a means of finding profitable trades. In MetaStock for Windows, you can find both Double Tops and Double Bottoms with these formulas. There is a caveat however. In the article, Mr. Bulkowski utilizes the High-Low range in finding Double Bottoms. These formulas use only the close value, so a few of the lower priced issues will not produce signals in MetaStock. Overall, however, these formulas produce most of the major signals he discusses. Double Tops PK.10.04) AND TR2TR1>=10 AND Cross(C.%).10). The code for the actual indicators can be found at the Equis website (www.-1) AND Ref(Zig(C.10.-1)) / ValueWhen(2.%).%)<Ref(Zig(C.10.PK.%)>Ref(Zig(C.-2).60.10.C) Double Bottoms PK:=Zig(C. I'll work on shorting later.%).equis.-1) AND Ref(Zig(C.TR.TR.10.%).PK.com) so I won't post them again here.-2).PK:=Zig(C.96 AND ValueWhen(1.ValueWhen(1.5.Ref(C.C.-1) AND Ref(Zig(C. PK2:=PeakBars(2.Ref(C.C.-5) OR Fml("tendency")>0 AND day=5 Close Long Cross(Fml("dynamik balance point steps").-1))>.10). Here's what I've got so far Enter Long: day:=DayOfWeek().PK. (ValueWhen(1.5.10).96 AND ValueWhen(1.%). PK1:=PeakBars(1.10.10.Ref(C.1)<Ref(Zig(C.TR.10.Ref(C.-2). Fml("dynamic balance")>Fml("dynamik balance point steps") AND Fml("fixed balance point")>Ref(Fml("fixed balance Point").-1))/ValueWhen(2.%)>Ref(Zig(C.Ref(C. (ValueWhen(1.10.%).1)>Ref(Zig(C.-1)) / ValueWhen(2.10.%).Ref(C.C.-2).5.%).Ref(C.S)>=(2*Ref(Mov(V.-1))) (Go Top) Down 20% on Double Average Volume Col A: CLOSE Col B: ROC(C.%) Filter ROC(C. TR2:=TroughBars(2.1)<Ref(Zig(C.10.1)>Ref(Zig(C.10.%).10.%)<=-20 AND Mov(V.-1) AND Ref(Zig(C.%)<Ref(Zig(C.04) AND PK2PK1>=10 AND Cross(ValueWhen(1. I've been testing a system based on these indicators on Best Buy (a stock that seems to be quite amenable to system trading) and getting very good results.PK.%).-5)) Filter enabled Yes Periodicity Daily Records required 1300 (Go Top) DMTF Trading System I know I'm a little slow.TR.-1))/ValueWhen(2.%). TR1:=TroughBars(1. TR:=Zig(C.C.-1))<1.-1))>. but I've just gotten around to working on the Dynamic Multiple Time Frame indicators given by Robert Krausz in the 1999 Bonus Issue of TASC.TR.10.S). TR:=Zig(C.Ref(C.10.10.Ref(C.10). The system is currently for long trades only.Ref(C.-1)).-1))<1.Fml("dynamic balance")) .%). {then}LowestSince(1. Then. {Find The Low Of The Highest High} Hlv:=ValueWhen(1. {then} FmlVar("Dunn-Type1".Lc=1. {Number Of Periods Since Swing Started Up} Hc:=BarsSince(SD=-1).-5) The problem is that the close is not defined. {else}0). Note: 1= Uptrend. {then}HighestSince(1. The DBPS can cross the DB without the 2nd condition occuring.2.-1).L=Lv. {Find Highest Value Of Up Swing} Hv:=If(Hc>Lc AND H>Ref(H.AND Fml("fixed balance point")<Ref(Fml("fixed balance Point"). {Find Lowest Value Of Down Swing} Lv:=If(Hc<Lc AND L<Ref(L.TD2<>0. 1. {then}-1. {then}1. but I prefer to let the system do the work. 1 or 2 ?". {else}If(Sd=-1 AND L<Hlv.Hc=1. {Find The High Of The Lowest Low} Lhv:=ValueWhen(1.} (Go Top) Dunn-Type 1 . when later.H).-1). but to be used as a subroutine. meaning that the two events which initiate the close do not have to happen. TD3 {These formulas simply plot a 1 if market is up or -1 if down. {Call Swing Type Formula} Sd:=If(Round(St)=1.L). the 2nd condition does occur.L). Best wishes. Simply reversing the entry signal and other tries. such as support breakthoughs."TD1"). drastically reduce the result. Theoretically."TD1")).2). {else} FmlVar("Dunn-Type2". I understand that I can set arbitrary stops. Adam Hefner. if we follow the system strictly. {else}0).H). -1= Downtrend} TD2:=If(Sd=1 AND H>Lhv. sell is not triggered because the cross over has not happened simultaneously with the 2nd condition.H=Hv. {else}0)). or possibly in an "Expert Adviser". {Calculate And Plot Trend Direction. this can lead to a complete loss. I really didn't code this to be used as an indicator. (Go Top) Dunnigan Trend {Ask to use 1 day or 2 day Swing type} St:=Input("Short Term Swing Type.TD2). TD3:=ValueWhen(1. {Number Of Periods Since Swing Started Down} Lc:=BarsSince(SD=1). } TD1:=If(BarsSince(H>Ref(H.-1)>Ref(H. is a 5 week average of the Fixed Balance Point.-1) AND H<Ref(H. Adam Hefner: "The Fixed Balance Point is calculated every Friday by taking the weekly (high+low+close)/3. then the trend is up. Down = 2 lower highs and 2 lower lows.} TD1:=If(BarsSince((H>Ref(H. and opposite is true for down trend.-1)<Ref(L. The Dynamic Balance Point is the daily update of the Fixed Balance Point.-2) AND Ref(H. {then}1.-2) AND Ref(L. TD1 (Go Top) Dunn-Type 2 {Market swing is defined as: Up = 2 higher highs and 2 higher lows. I have found that these act in much the same way as a 5/25 moving average cross-over system. you have the market direction (trend) for the shorter (daily) time. The Fixed Balance Point Step.-1)<Ref(H.-1)>Ref(L. {else}-1). seems (IMHO) that these support/resistance areas are very easy to visualize using . I like the Fibonacci Support & Resistance best of all.-1)). Robert Krausz teaches that by watching the balance point calculations of the longer (weekly) time.-1)) AND (Ref(H.-2))).-2))) < BarsSince((L<Ref(L. The Dynamic Balance Point Step is the daily update of the Fixed Balance Point Step. {then}1. He also revealed that the when the Dynamic Balance Point is above the Dynamic Balance Point Step.-1)) AND (Ref(L. {else}-1).-1)) < BarsSince(L<Ref(L.-1) AND L>Ref(L. It really doesn't need to be plotted. but is mostly used to base the other indicators from. Down = lower highs and lower lows.-1) AND H<Ref(H.{Market swing is defined as: Up = higher highs and higher lows. TD1 (Go Top) Dynamic Multiple Time Frame Indicator Explanation of the Dynamic Multiple Time Frame Indicator by the author.-1) AND L>Ref(L. Simple ). Traders typically use one set of buy and sell zones for a bull market and substantially different zones for a bear market." (Go Top) Dynamic Zones {Zamansky&Stendahl's Dynamic Zones for MS6. LwZone. Here's a concept based on zones that are responsive to past levels of the indicator. by changing the zones.100. T) . PS:=Input("Enter Periods for SELL". LwZone:=Mov(RSI(PR). One approach to active investing employs the use of oscillators to exploit tradable market trends. Dynamic zones offer a solution to the problem of fixed buy and sell zones for any oscillator-driven system. And therein lies the problem.70).1. First. decide the value of the lookback period t. This investing style follows a very simple form of logic: Enter the market only when an oscillator has moved far above or below traditional trading levels. High and Low Close if((C-L)/(H-L). Next.PB. (Go Top) Daily Close vs. The objective is to have a system automatically define its own buy and sell zones and thereby profitably trade in any market -.. they negate the system's mechanical nature.100. UpZone..3185 *Stdev(RSI(PR). if((C-L)/(H-L).38.100.>. X.0)) (Go Top) Detrended Price Oscillator The Detrended Price Oscillator (DPO) is an indicator that attempts to eliminate the trend in prices. these oscillator-driven systems lack the ability to evolve with the market because they use fixed buy and sell zones.S)-(1. PB:=Input("Enter Periods for BUY".70).1. e. for the Lookback Periods plot a 9-day RSI along with StDev adjusted rolling 70-day SMAs.this formula.g.PB)). decide the value of the probability Pbuy for buy zone and value of the probability Psell for the sell zone.66 . First. as can be seen in the article's S&P500example} PR:=Input("Enter Periods for RSI".9).PS.1. Here is the MetaStock custom formula for the DPO: Close-Ref( Mov(Close.5 (From the TASC July1997 article). The zones appear to evolve with the market because they use a rolling 70-day period of indicator values in their construction.. The algorithm for the dynamic zones is a series of steps. The area above and below the dynamic zones constitute the upper and lower 10% boundaries. However. UpZone:=Mov(RSI(PR).S)+(1. Most indicators use a fixed zone for buy and sell signals. Detrended prices allow you to more easily identify cycles and overbought/oversold levels.PS)).1.bull or bear.<.3185 *Stdev(RSI(PR).-1. Once traders begin introducing their market opinions into trading equations. E ) ) * 100 ** where X = 13 time periods and ? = Exponential moving average.100).? ) ) * 100 ** where X is the number of time periods and ? is the calculation type of the moving average.11) (Go Top) Disparity Index Steve Nison refers to the his Disparity Index "as a percentage display of the latest close to a chosen moving average".1 is very strong divergence.12.E)). (Go Top) Displaying the Price of a Security in 32nds and 64ths All versions of MetaStock prior to our Windows software would need this formula.E)). or low price instead. H.2)/100)).2)/100)). + 1 is very strong correlation.26.0) The interpretation of the indicator output is as follows: .***where X is the number of Time Periods for the Oscillator and T = X / 2 + 1.12. by using the following custom formulas.100)* Sum((Mov(C.12.100))(Sum(Cum(1).015625 ) / 100 ) **Where C is for the security's closing price and can be replaced with O. This can be defined in MetaStock using the formula: ( ( C . .X .26. a 20 period DPO would be: X = 20 T = (20/2 + 1) = 11 Close-Ref( Mov(Close.Mov( C .E)-Mov(C.? ) ) / Mov( C . This indicator shows "divergence" between the close and the indicator: In the Windows versions of MetaStock the formula is: Correl(((Sum(Cum(1)*(Mov(C. (Go Top) Divergence Between the Close and an Indicator The following formula will calculate the correlation of the Close and the MACD. high.100)* Sum(C. For example: ( ( C .Mov( C .08 (80%) and lower is divergence between the Close and the MACD..((Sum(Cum(1)*C.100). For interpretation on the Disparity Index refer to Steve Nison's book Beyond Candlesticks which is available from the Equis Direct catalogue.100)/100))/((Sum(Power(Cum(1).13.X . For 32nds: INT( C ) + ( ( FRAC( C ) / .E)-Mov(C.100)/100))/((Sum(Power(Cum(1). 20.100))-(Sum(Cum(1). The formula was constructed this way so that most other indicators may be used in place of the MACD.2). It is written using a "long form" MACD so that the time periods used by the MACD may be changed.100))(Power(Sum(Cum(1).03125 ) / 100 ) For 64ths: INT( C ) + ( ( FRAC( C ) / . You can display your security's prices in 32nds and 64ths.E ) ) / Mov( C . Once plotted these values will be displayed in the indicator window. or L for the open.2). For example. For example here is the same indicator using the RSI(14) . Simple).13 .100))(Power(Sum(Cum(1). 28.2).100)* Sum((RSI(14)).100). White describes this test as using a variation of the "tried-and-true simple moving average for entry signals and the "trend analysis index" for exit signals.4)) Close Long: When(Fml("TAI").>=.100)/100))/ ((Sum(Power(Cum(1). Signal Formulas Enter Long: When(Ref(Mov(C. Marshall Wall introduces the Dynamic Momentum Oscillator (Dynamo).5))/C)*100 Darvis Box .Correl(((Sum(Cum(1)*(RSI(14)).21. ((Sum(Cum(1)*C.=.<.100))(Power(Sum(Cum(1). Please refer to this article for interpretation.S O = Stochastic Oscillator = Stoch(5.100).( MAo .O ) where Mc = the midpoint of the oscillator MAo = a moving average of the oscillator O = the oscillator This concept can be applied to most any oscillator to improve its results.2).100)*Sum(C.3) This example applies it to an RSI oscillator: 50-(Mov(RSI(14).28.S). For example: Applying the Dynamo Oscillator to a 5-period %K slowed 3 periods Stochastic Oscillator would give: 50-(Mov(Stoch(5.-1). page 18.2)/100)). Note.-1). The test appears in the article "The Derivative Moving Average" by Adam White.3)) where: Mc = Stochastic Oscillator's midpoint = 50 MAo = Moving average of the Stochastic = Mov(Stoch(5.100)/100))/((Sum(Power(Cum(1).LLV(Mov(C.28. He describes the Dynamo Oscillator to be: Dynamo = Mc .4) TAI Formula ((HHV(Mov(C.0.100))-(Sum(Cum(1).0) (Go Top) Dynamic Momentum Oscillator In July 1996 Futures magazine.S O= RSI Oscillator = RSI(14) (Go Top) Derivative Moving Average The information for this test was published in the June 1996 issue of "Technical Analysis of Stocks and Commodities".100))(Power(Sum(Cum(1).3).0. first you need to create a new indicator called TAI.Based on "How I made 2 million on the stockmarket" Jason Prestwidge .S)-RSI(14)) where: Mc = RSI's midpoint = 50 MAo = Moving average of the RSI = Mov(RSI(14).21.28. E.12.4) AND When(Ref(Fml("TAI").S)-Stoch(5.S).then create the new system test.5)-LLV(Mov(C. using the TAI formula below .100))-(Sum(Cum(1). Mr.21.21.S).S).3).2)/100)). 1.-3) AND H< Ref(H. Published by John Wiley & Sons.-1))*V.1).” (Go Top. its extent. Botbox:=If(Ref(H.com } StDay:=Input("start Day". it shows the bulls are in control. It is useful for finding entry points into the markets. Botbox. StYear:=Input("start Year".Mov(FI. When it crosses above its centerline.-3).Periods:=Input("periods". 1993) “Force Index is an oscillator developed by this author. Inc.12).PREVIOUS).1800. A 2-day EMA of Force Index provides a minimal degree of smoothing.-4) AND Ref(H.Periods).. EnYear:=Input("end Year".12.-2)<Ref(H. .1.-3) AND H< Ref(H.-3).1). you would change the ‘13’ above to ‘2’. A 13-day EMA of Force Index tracks longer term changes in the force of bulls and bears. Topbox.-3)>=Ref(HHV(H.4).260).31).-1)<Ref(H. It provides a new.LLV(L.-2)<Ref(H.2200.13. EnDay:=Input("end Day". practical way of using volume to make trading decisions.. Topbox:=If(Ref(H.Metastock Indicator Formula FI:=(C-Ref(C.1.1. (Go Top. Divergences between 13-day EMA of Force Index and prices identify important turning points.1.E) {Smoothed by 13 period exponential moving average} Dr Elder also refers to a 2 period Force Index in which case. Force Index combines three essential pieces of market information – the direction of price change.1800. as long as you trade in the direction of the 13-day EMA of prices. (The following explanatory notes are taken from ‘Trading for a Living’ by Dr.-3) AND Ref(H. It measures the force of bulls behind every rally and of bears behind every decline. start:=Year()>StYear OR (Year()=StYear AND (Month()>StMnth OR Month()=StMnth AND DayOfMonth()>=StDay)). it shows that bears are in control. It pays to buy when the 2day EMA is negative and sell when it is positive.PREVIOUS).31.Periods).. but it works better if you smooth it with a moving average. StMnth:=Input("start Month". end:=Year()<EnYear OR (Year()=EnYear AND (Month()<EnMnth OR Month()=EnMnth AND DayOfMonth()<=EnDay)). EnMnth:=Input("end Month". Alexander Elder.2003).-3)>=Ref(HHV(H. Force Index smoothed with a short MA helps pinpoint entry and exit points. and trading volume.260.Ref(H. Force Index smoothed with a long MA reveals major changes in the force of bulls and bears.-4) AND Ref(H.2200.) Dr Elder's Force Index . When it turns negative.12..-3).2003).) Date filter { Date filter } { Plots +1 signal within user-input date period } {
[email protected])<Ref(H.-3) AND Ref(H. Force Index can be used raw.31. 100.-1)>Ref(y. Pkx1:=ValueWhen(1.1.Pkx.Ref(xd.-1)). Try2:=ValueWhen(2.Ref(y.0)/100.shift) -Ref((Pkx AND Pky AND Pkx1>Pkx2 AND Pky1<Pky2).H). shift:=Input("shift signals back to match divergences=1"..-2) AND Ref(xu. Ref(Trx AND Try AND Trx1<Trx2 AND Try1>Try2.pds)))).shift) ECO .4.-1)<=(y+Ref(y.-1)>=(xu+Ref(xu.-2))/2*(1+Ch).10).0).Mo(C.-1)).Pkx.E))*100 (Go Top) Elliot Oscillator .Ref(y.2.Ref(y.. Mom=4".-1)).Pky.Ref(xu.-1)).Try.1.DMI(C). Pky:=y<Ref(y. xu:=If(f=1.-1) AND Ref(y.0.1.MACD().-2) AND Ref(xd.start AND (end OR (start AND Alert(start=0.1). Pkx:=xu<Ref(xu.Try. RSI=2. High/Low=2".E))26. Pky2:=ValueWhen(2.0. Pky1:=ValueWhen(1.Trx.Ref(xu.2))) (Go Top.C.-1)).L).-1) AND Ref(xd.R Krauz The Robert Krauz article I read described the ECO as "a double smoothed ratio of the difference between the close(C) and open(O) of each bar. Trx2:=ValueWhen(2.-2))/2*(1-Ch).-1)). Try1:=ValueWhen(1.-1)<=(xd+Ref(xd.2520.-2))/2*(1+Ch). and the difference between the high(H) and low(L) prices for each bar" originally created by William Blau.Ref(xd.-2) AND Ref(y.If(ind=2.Pky.C.-2))/2*(1-Ch). pds:=Input("indicator periods".-1) AND Ref(xu. f:=Input("price field: Close=1.pds). xd:=If(f=1.RSI(C. Try:=y>Ref(y.com } ind:=Input("MACD=1. DMI=3.E)/MOV(MOV(H-L.-1)>Ref(xu. If(ind=3.2.Trx. Trx1:=ValueWhen(1.-1)>=(y+Ref(y.) Divergences .1).E))26. Trx:=xd>Ref(xd.Ref(y.-1)). FWI my interpretation is: {ECO[Ergodic Candlestick Oscillator]} (MOV(MOV(C-O.-1) AND Ref(y.-1)). {y:=insert any indicator or Fml("formula name")} y:=If(ind=1.5. Ch:=Input("peak/trough depth minimum (0-100%)".-2) AND Ref(y. Pkx2:=ValueWhen(2.Class A { Class A price/indicator divergence v3 }{ +1 signal = bullish trough divergences }{ -1 signal = bearish peak divergences }{ ©Copyright 2003 Jose Silva }{ josesilva22@yahoo. 0.-1)<Ref(y.-1)<Ref(xd.5. >.+1.S) (Go Top) Elliot Oscillator Mov(C.-1) exit long mov(c. use a 5/34 histogram for finding wave 4.e)>mov(c.CLD) AND When(CLA.21.8.<. If(SHORT>0.21.TIMESERIES).e). etc.5.-1)>=ref(mov(c.E.-1) (Go Top) End Point Moving Average {The End Point Moving Average was introduced in the October 95 issue of Technical Analysis of Stocks & Commodities in the article "The End Point .e) and ref(mov(c.PREVIOUS)) (Go Top) Elliot Wave Identification As far as using MetaStock for identifying waves.by Joe Luisi} {published in S&C . Of course. The version of the indicator I use in MetaStock v6.e). 3 and 5 and troughs for waves 2 and 4.5.e).34.e) and ref(mov(c. SHORT:=When(CLA.-1).<.0)AND When(CLA. CLD:=Ref(Mov(TRIX(3).5.S) -150 days minimum of data.<.CLC) AND When(CLB.35.S)-Mov(C.-1. The peaks of the histogram help identify waves 1.CLD) AND When(CLA.>.8. CLC:=Mov(TRIX(3). which apparently Advanced Get uses extensively.34.. explorations to find the peaks and troughs of the 5/34 histogram. If(LONG>0.e)<mov(c.>.S) {from Jan Robert Wolansky} {TIMESERIES TRIX .5.+2).g.S)-Mov((H+L)/2.$).CLC) AND When(CLB.TIMESERIES). you can label the waves with the text box. LONG:=When(CLA.52 is: Mov(OscP(5.. channels and fib retracements) for additional wave identification/analysis. with this indicator.-1)<=ref(mov(c. CLB:=Ref(TRIX(3). You can write MetaStock explorations/templates/experts.Mov((H+L)/2. the end of wave 3 and for help with identifying wave 1/2.>.5.21.21.-1).-2).e).5. e.0)AND When(CLA.5.TASC article "Playing Trix" by Joe Luisi (June 1997) and to be used on weekly data} CLA:=TRIX(3).<. (Go Top) EMA Cross System avoid using when the market has no clear direction -enter long mov(c. Use MetaStock line studies (both trendlines. 60.. Lafferty.2 ) ) * Cum( 1 ) + (Mov(C. also over the past 5 days.Mov(C.14 ) * Sum( C. Above condition should be in place for 20 days/ I use c . The Time Series Forecast (TSF) takes this value and the slope of the regression line to forecast the next day and then plots this forecasted price as today's value..60.14) ) / (14 * Sum( Pwr( Cum( 1 ). stands for all Ref( x. Finally.60.5 by your result.60. Then divide 2.14) * Sum( C.14.2*periods-1.} (Go Top) Enter 20 Days after MOV Signal I am trying to use the MetaStock Explorer to find all stocks with the following: 1.S))<0). by Patrick E.Mov(C.periods) = Mov(TR.Mov(c.14 ) .S))<0).14 ).S) . This number is called b.Pwr( Sum( Cum( 1 ). (phew!) .14.-1) AND .Moving Average".. Then take the result of dividing by 2.14) ) / (14 * Sum( Pwr( Cum( 1 ). (Go Top) Equivalent to Wilders TR Wilders(TR.s)<0 2. Call this number c.60.E) (Go Top) Excel Confidence % This is the calculation: Take todays volume * 50 and find the square root of that number.2 ) ) ) {The above formula plots the last value of a linear regression line of the previous 14 periods.2 ).-i) with i between 2 and 18.Sum( Cum( 1 ). c . Ref((C -Mov(C. This is the fundamental calculation which we shall call a. Take the value for a and take it away from the lowest value of itself over the past 5 days.14 ) .14) Pwr( Sum( Cum( 1 ).s)<0 but how do I write the Exploration? from wsb Use (C . Now take the highest value for a over the past 5 days and subtract the lowest value for a. Then plot a 10 day moving average of this figure.Mov( Cum( 1 ). divide b by c and multiply the answer by 100.mov(c.2).14) Sum( Cum( 1 ).5 and * todays close.S) * (14 * Sum( Cum( 1 ) * C. The exact formula for the End Point Moving average is as follows:} ( 14 * Sum( Cum( 1 ) * C. from Equis.14 ). Add up these results for the past 3 days. Write this figure down..S))<0 AND Ref((C .-19) where . S) and C>Mov(C. usually at the extreme ends of the scale.-1)<=Mov(C.50.0)) Filter:ColB and ColC (Go Top) Expansion Pivots Sell A:=Close B:{Breakout}(H-L)>ATR(9) C:{Signal}Ref(C.5/ Sqrt(50 * V)).50.0)) Filter:ColB and ColC (Go Top) Experimental Williams Trading System A trading system based on work of Bill Williams Enter Long: Cross(C.50.50.S).If(Ref(C.S) and C<Mov(C.S).-1)-1.2)-.S)LLV(Mov(C * (2.125 E:{Stop}If(Ref(C.50.C) AND Fml("chaos blue bl") > Fml("chaos green bl") .S) OR Ref(C.-1)<Mov(C. 3 ) / Sum( HHV(Mov(C * (2.50.Ref(C.try 7 & 15) and trade the crossovers.-1)>=Mov(C.50.50. A value of 0 indicates no confidence in the market going up.-1)>=Mov(C.5) LLV(Mov(C * (2.50.50. Although this obviously isn't the holy grail of indicators.125 E:{Stop}If(Ref(C. 10 or lower.50. sell.5).-1)>Mov(C.S) and Ref(C.-1)<=Mov(C.C-1.5/ Sqrt(50 * V)).S) and Ref(C.Simple Interpretation: Excel Confidence % should oscillate between 0 and 100. You can also just trade the values ie 90 or higher. it does offer some insight into what the market is thinking and how one can measure investor sentiment.-2)>=Mov(C.C-1.S) and Ref(C.-1)-1.S). whilst 100 indicates perfect confidence in the market going up.S) and C<Mov(C. buy.10. 3) ) * 100 (Go Top) Expansion Pivots Buy A:=Close B:{Breakout}(H-L)>ATR(9) C:{Signal}Ref(C. Metastock code for Excel Confidence %: (Sum( Mov(C * (2.50.-2)<=Mov(C.50.5).S) and Ref(C. as with stochastics.Ref(C.-2)<=Mov(C.Fml("chaos green bl")) AND Fml("chaos green bl") > Fml("chaos blue bl") Close Long: Cross(Fml("chaos green bl").S) D:{entry}HHV(H.50.2)+.5/ Sqrt(50 * V)).S) D:{entry}LLV(L.S).S).5/ Sqrt(50 * V)).-1)>Mov(C.S).-1)<Mov(C.S) and C>Mov(C.50. You might like to add a slower version of this (just increase the 3 day and 5 day calculations to something you believe to be appropriate .If(Ref(C.50.S).10.10.S) OR Ref(C.-2)>=Mov(C.10. x for Windows there is a way to plot the end points of a linear regression line with channels +/.14) .14) (Go Top) EMA { Exponential Moving Average v2. (Go Top) End Points of a Linear Regression with Standard Deviations In MetaStock 5.14.Ema)-Cross(Ema.2 Standard Deviations.S) * (14 * Sum(Cum(1) * C. I really haven't spent too much time on it yet so I'm not yet sure of the significance of the other indicators.I tested this on several different stocks and it shows potential.0)/100+1. [2]Crossover signals". 1.P.If(x=6.C))))).Mov(Cum(1).2).14)) /(14 * Sum(Pwr(Cum(1).H. shift:=Input("EMA vertical shift %".14) * Sum(C.O.If(x=2. Here are the three formulas: *Linear Regression (14): (14 * Sum(Cum(1) * C.14).2). If(plot=2.6. Ema:=x*2/(pds+1)+PREV*(1-2/(pds+1)).L.14))/(14 * Sum(Pwr(Cum(1).Sum(Cum(1).21).1 } { Positive sensitivity: EMA periodicity shortens on high ATR volatility increases on low ATR volatility } { Negative sensitivity: EMA periodicity shortens on low ATR volatility increases on high ATR volatility } { [1]EMA: ATR volatility-adjusted EMA } .14.14) .1. Cum(IsDefined(x)).pds). x:=Input("use Open=1 High=2 Low=3 Close=4 WClose=5 P=6".signals. dyn-period EMA v2.2* Stdev( Fml( "*Linear Regression (14)" ) .100. -100.1).14).x).2520.4). pds:=If(pds>Cum(IsDefined(x)).If(x=5.S) .2))) *Linear Regression Lower Band: Fml( "*Linear Regression (14)" ) . Ema:=Ema*shift.Pwr(Sum(Cum(1).2.Sum(Cum(1).Pwr(Sum(Cum(1).com } pds:=Input("EMA periods".1.ATR volatility adjusted { ATR volatility-adjusted.WC(). plot:=Input("[1]EMA.Ema) (Go Top) EMA . x:=If(x=1.2 }{ EMA periodicity shortens on low bar count } { ©Copyright 2003-2004 Jose Silva }{
[email protected])) * Cum(1) + (Mov(C.14) .14)* Sum(C.If(x=3. signals:=Cross(x.14) . The above was just what I could throw together based upon what my eyes on the chart with the indicators showed me.14) *Linear Regression Upper: Fml( "*Linear Regression (14)" ) + 2* Stdev( Fml( "*Linear Regression (14)" ) . 75)/100.pds).2.bigpond.2520.O.1. .6.21).1.2.L. [4]Signals".2520.10*Power(ATRvlty.ATREma))) (Go Top) EMA .Cum(IsDefined(x))(pdsVlty+pdsATR).2520. multi:=If(sens>0. signals:=Cross(x.3 2) +.1.5.1/multi.C))))).4.126).ATREma)-Cross(ATREma.ATRvlty*100.signals.2520.1.126). x:=Input("[1]Open [2]High [3]Low [4]Close [5]Vol [6]P".100. [3]ATR vlty.If(x=6.2. [2]Dyn periods.2520.pdsVlty)) / (HHV(ATR(pdsATR). If(plot=4.1. plot:=Input("[1]EMA.If(plot=3.pds).1-(1-multi)*Abs(sens). multi:=If(ATRvlty<=. ATRvlty:=(ATR(pdsATR)-LLV(ATR(pdsATR).x).100)/100.1. x:=If(x=1. pdsVlty:=Input("BB volatility sampling periods".-100.pdsVlty)LLV(ATR(pdsATR). dynamic-period EMA v1.100. ATREma:=x*2/(pds+1)+PREV*(1-2/(pds+1)).100.000001). sens:=Input("BB volatility sensitivity (+100 to -100)%". x:=Input("[1]Open [2]High [3]Low [4]Close [5]Vol [6]P".2520.com } pds:=Input("EMA avg periods". pdsATR:=Input("ATR periods".6.htm } pds:=Input("EMA avg periods".1. If(plot=2.BB volatility adjusted { Bollinger Band volatility-adjusted.H.If(x=5.pds.3.P.If(x=3.10*Power(ATRvlty.21). pdsVlty:=Input("ATR volatility sampling periods". multi:=If(multi<1. pdsBB:=Input("Bollinger Band periods".4739)+.multi).{ [2]Dyn periods: EMA periodicity used } { [3]ATR vlty: ATR volatility 0~100% } { [4]Signals: EMA/price crossover signals } { ©Copyright 2004 Jose Silva }{
[email protected]). pds:=If(pds>Cum(IsDefined(x))-(pdsVlty+pdsATR).pdsVlty)+. pds:=If(pds<1. sens:=Input("ATR volatility sensitivity (+100 to -100)%".4).4).10).000001).1.com/prominex/pegasus.3.1).(multi-1)*Abs(sens)+1).V. pds:=pds*multi.If(x=2.1 } { Positive sensitivity: EMA periodicity shortens on high BB volatility increases on low BB volatility } { Negative sensitivity: EMA periodicity shortens on low BB volatility increases on high BB volatility } { { { { [1]EMA: BB volatility-adjusted EMA } [2]Dyn periods: EMA periodicity used } [3]BB vlty: BB volatility 0~100% } [4]Signals: EMA/price crossover signals } { ©Copyright 2004 Jose Silva } { http://users. multi:=Input("EMA periodicity: Cycle/Avg length x". If(plot=2. signals:=Cross(x.CycleLen).1. Ema:=x*2/(pds+1)+PREV*(1-2/(pds+1)).32) +.P.If(x=6.3. Init:=CycleCount=1 AND Alert(CycleCount<1.BBema)-Cross(BBema.1.5.-1)<Ref(zz.4739)+.ValueWhen(1.1.1.CycleLen>0 AND CycleCount>0.1.100.1-(1-multi)*Abs(sens). choose:=Input("EMA periods based on: [1]Cycle.CycleLen.pr.S.pds))))) (Go Top) .1.pds).1.pdsBB.BBema))) (Go Top) EMA.3.L.P. CycleCount:=If(CycleCount=0.If(x=5. PkTr:=zzpk OR zztr.pds).BarsSince(Init).6.4.If(x=2. x:=If(x=1. Ema:=Ema*shift. shift:=1+Input("EMA vertical shift %".CycleLenAvg.6.If(x=2.H.-1)+1).signals. pds:=pds*multi.Cum(IsDefined(x))(pdsVlty+pdsBB). plot:=Input("[1]EMA [2]Signals [3]Cycle [4]CyAvg [5]CyStdDev".6).100.1). signals:=Cross(x.H.10*Power(BBvlty. pds:=If(pds>Cum(IsDefined(x))-(pdsVlty+pdsBB).-1)>zz AND Ref(zz.1).0)/100.000001.2)-BBandBot(x.pdsBB. zzpk:=Ref(zz.If(plot=4.2. pds:=If(choose=1.-100.signals. BBvlty:=(y-LLV(y.C))))).1.pds).S).-2). x:=If(x=1.pds. zztr:=Ref(zz.Stdev(CycleLen.x). pds:= If(pds>BarsSince(Init).100.If(plot=2.L. multi:=If(sens>0.Ema)-Cross(Ema.pdsBB.CycleCount). cycle-adaptive { Cycle-adaptive Exponential Moving Avg v1. pds:=If(pds<1.multi).2))/Mov(x.-1)>Ref(zz. CycleCount:=Cum(PkTr)-1. pds:=If(pds<1.2).x).0.10*Power(BBvlty.pds).If(plot=3.CycleLenAvg)*multi. y:=(BBandTop(x.1 }{ EMA periodicity determined by historical price cycle based on ZigZag cycles } { ©Copyright 2004 Jose Silva }{
[email protected])<zz AND Ref(zz.V.%).V.com } pr:=Input("ZigZag cycle reversal %".S.pdsVlty))/(HHV(y.. If(plot=5.1/multi.If(x=6.pdsVlty)+.1).Ema.000001).If(x=5. multi:=If(BBvlty<=.If(x=3. [3]BB vlty. zz:=Zig(x. [2]Dyn periods.pdsVlty)-LLV(y.21).-2).O.O. CycleLenAvg:=Cum(CycleLen)/CycleCount. If(plot=1. If(plot=4. [4]Signals". [2]Cycle Avg". multi:=If(multi<1. x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5 P=6".plot:=Input("[1]EMA.000001)..2).If(x=3.5).(multi-1)*Abs(sens)+1). If(plot=3.CycleLen:=PkTr*(Ref(BarsSince(PkTr).C))))).BBvlty*100. BBema:=x*2/(pds+1)+PREV*(1-2/(pds+1)). 5)/100. { Plot EMA on price chart } If(plot=2.-1)>Ref(xpk.2)/200.1). xpk:=If(x=1. .100. plot:=Input("[1]EMA. x:=Input("use Open=1 High=2 Low=3 Close=4 WClose=5 P=6".com } { User inputs } pds:=Input("EMA periods".6.1).WC().If(x=5. 0. maxCh:=Input("Maximum % price change".-1)-1). { EMA crossover signals } signals:=Cross(x.2)/100.EMA .filter. Cum(IsDefined(x)).2520. 1.C))))). { Price field selection } x:=If(x=1.1. filter:=change>=minCh AND change<=maxCh.4). x:=ValueWhen(1. 1. [3]P". plot:=Input("EMA: [1]Composite. spread:=Input("Upper/Lower EMA bands shift %".O.pds).com } pds:=Input("EMA periods".H. [3] EMA shifts to Upper/Lower on crossovers } { ©Copyright 2004 Jose Silva }{ josesilva22@yahoo. pk:=xpk<Ref(xpk. shift:=Input("EMA vertical shift %".x). { Price filter } change:=Abs(x/Ref(x. [3]Long/Short".C.1.2520.100.Ema) (Go Top) EMA .0)/100+1. [2] Upper EMA band based on peaks.L.-1) AND Ref(xpk. { EMA shift } Ema:=Ema*shift. { EMA formula } Ema:=x*2/(pds+1)+PREV*(1-2/(pds+1)).2.100.H.100.3. minCh:=Input("Minimum % price change".21)/2.3. [2]Crossover signals".0 }{ EMA based on trough/peak support/resistance } { Options: [1] Composite EMA: (Upper+Lower)/2.P)). { Reduce periodicity on low bar count } pds:=If(pds>Cum(IsDefined(x)).21).%PriceChange-filtered { Filtered Exponential Moving Average v1.Ema)-Cross(Ema. -100. x:=Input("use: [1]Close.1 }{ EMA ignores prices outside min/max % zone }{ EMA periodicity shortens on low bar count } { ©Copyright 2004 Jose Silva }{
[email protected](x=3.If(x=6. 0.x).-2).If(x=2. [2]High/Low.1.pivotal { Pivotal Exponential Moving Average v1.P. 0.signals.1).If(x=2.1. [2]Upper/Lower. Lower EMA band based on troughs. trEma.L.21).If(x=3.pds).C))))).trpds). trEma:=trEma*(1-spread). plot:=Input("EMA=1.If(x=6.4).C.If(plot=2. multi:=(5+100/pdsRs) /(.1. increases EMA periods on low RSI volatility } { ©Copyright 2003-2004 Jose Silva }{
[email protected])-Cross(RsVEma. pds:=pds*multi.252. signals=4". RsVEma:=x*2/(pds+1)+PREV*(1-2/(pds+1)).pkpds). signals:=Cross(x.1. shift:= 1+Input("vertical shift %".Ref(xtr.}pdsRs)-50)+1.2520. x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5 P=6". dynamic-period EMA v2}{ Tightens EMA on RSI over-bought/sold levels.100.1. pdsRs:=Input("RSI periods". pkEma:=pkEma*(1+spread).06+.-1)).21).H. pkEma:=pkVal*2/(pkpds+1)+PREV*(1-2/(pkpds+1)).0~100% }{ ©Copyright 2003 Jose Silva } {
[email protected] volatility adjusted {RSI-volatility adjusted.RsVEma*shift))) (Go Top) EMA . x:=If(x=1.V.1.If(x=2.21).pds.If(x=5.0.V. pkpds:=If(pkpds<1.If(x=5.trEma.-2).1). Cum(IsDefined(x))-pdsRS.H.2. trVal:=ValueWhen(1.O.If(x=3.C))))).x).Ema.slope % { EMA slope % v2.com } pds:=Input("EMA periods".(RSvoltl-1)*2.pkVal:=ValueWhen(1.P.signals. RSvoltl:=Abs(RSI({x.pkEma.pk.1. If(plot=2. x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5 P=6".L.E).02*Power(RSvoltl. pds:=If(pds<1. EMA:=Mov(x.com } pds:=Input("EMA periods".4.0)/100.Ema.LngShtEma)).L. trEma:=trVal*2/(trpds+1)+PREV*(1-2/(trpds+1)).tr.P. If(plot=4.If(x=2.If(plot=3.LngShtEma)) (Go Top) EMA .pds). RSI volatility=3. trpds:=If(pds>Cum(tr).6.-1)).2.pkEma).pds.P)).-100. trpds:=If(trpds<1. If(plot=1.If(x=6.Cum(tr).1.2)). Ema:=(pkEma+trEma)/2.Cum(pk). If(plot=1. x:=If(x=1.-1).6. dyn EMA pds=2.O.-1) AND Ref(xtr. LngShtEma:=If(C>=Ema.pds).If(plot=2. . tr:=xtr>Ref(xtr. +/.Ref(xpk.-1)<Ref(xtr. pds:=If(pds>Cum(IsDefined(x))-pdsRS.92*RSvoltl+. EMAprev:=Ref(EMA.If(x=2. pkpds:=If(pds>Cum(pk).4). xtr:=If(x=1.pds).2520.1. pds:=If(pds<1. pds:=If(pds>Cum(IsDefined(x))-VAvgPds.signal.pds).1.4.If(x=2.signals.0)/100. Cum(IsDefined(x))-13. pds:=If(pds>Cum(IsDefined(x))-13.4 }{ EMA periodicity shortens on high volatility.pds.x).C))))).58*Power(VolAvg.6.Atan(EMAratio.100.VlEma)-Cross(VlEma. VlEma:=VlEma*shift. If(plot=2.E). increases on low volatility }{ ©Copyright 2003-2004 Jose Silva }{
[email protected]). EMAper:=If(EMAratio<0.Volume adjusted { Volume adjusted.1.pds.1. Atan(EMAratio. If(plot=4. MovVol:=Mov(V.6.pds).VtEma))) (Go Top) EMA . increases on low volume }{ ©Copyright 2003-2004 Jose Silva } {
[email protected](x=6. pds:=pds*multi.com } pds:=Input("EMA periods". Crossovers=4". VtEma:=VtEma*shift.EMAper (Go Top) EMA . signal:=Mov(EMAper.4. Crossovers=4".1.0)/100.2520. multi:=.Vt*10. x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5 P=6".L.5).1).VlEma))) (Go Top) .252.32*VolAvg+. pds:=If(pds<1.pds). VAvgPds:=Input("Volume sample periods".If(x=5. EMAratio:=(If(EMA>EMAprev.2.EMAprev)/Max(EMA.EMAprev).P.10.C))))).com } pds:=Input("EMA periods".VAvgPds.VolRatio). dynamic-period EMA v2.MovVol).21). Dyn EMA pds=2.1)-360.If(plot=3. plot:=Input("EMA=1. VolRatio:=Min(V. -100.100. Vol avg=3.O. shift:=1+Input("EMA vertical shift %".x).2-VolRatio.If(x=3.1. 0.V.21).signals.P.O. x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5 P=6". VlEma:=x*2/(pds+1)+PREV*(1-2/(pds+1)).If(x=6. Cum(IsDefined(x))-VAvgPds.1))*10/9.21).If(x=2.4)). VtEma:=x*2/(pds+1)+PREV*(1-2/(pds+1)). signals:=Cross(x.If(x=5.1. x:=If(x=1.5)/Mov(Stdev(x.y:=Min(EMA.Volatility adjusted { Volatility-adjusted.75/(Vt+.H.4). dynamic-period EMA v2.4). -100. VolAvg:=If(V>MovVol.MovVol)/Max(V. plot:=Input("EMA=1.S).1.If(plot=3.H.If(x=3. Vt:=Stdev(x. shift:=1+Input("EMA vertical shift %".pds).1). x:=If(x=1.75/(.y)-1)*100.1.1+. If(plot=4.L.V.2-y. Volatility=2.VolAvg*50.pds.2520. signals:=Cross(x.3 }{ EMA periodicity shortens on high volume. Dyn EMA pds=3.E).VtEma)-Cross(VtEma. If(plot=2. pds:=pds*. 6. WkEma:=ValueWhen(1.1.If(x=3.If(x=6.E)).520. Wkchart:=LastValue(Cum(y=ValueWhen(2.long.medium.E).pdsLong).NuWk. NuWk:=y>ValueWhen(2. signals:=Cross(C. x:=If(x=1.0 coded by metastocktools.com } pds:=Input("Weekly EMA periods". shift:=1+Input("EMA vertical shift %".252.com} .medium.10).y)))=0. pdsShort:=Input("Short crossover within x periods".WkEma)-Cross(WkEma.medium.com {Dr A.1.provided by www.1. goShort:= Alert(Cross(Mov(x. Elder's AutoEnvelope interpretation v1.C)). -100.medium. pds:=If(pds>Cum(NuWk).4).NuWk.1.signals.E)).V.short.C))))).C).1). y:=Fml("Calendar Week counter").2). Mov(x.2520.If(x=2.2.0)/100.3.Cum(NuWk).2.1008.short.pds).1.1.y).pdsLong) AND Alert(Cross(Mov(x. plot:=Input("plot: [1] EMA. goLong-goShort (Go Top) Elder's AutoEnvelope . medium:=Input("medium EMA periods". [2] Crossover signals".E).E)).20).E).L.pdsShort) AND Alert(Cross(Mov(x.pdsShort). goLong:= Alert(Cross(Mov(x.long. short:=Input("short EMA periods". long:=Input("long EMA periods".ValueWhen(2-Wkchart. Mov(x.WkEma) (Go Top) EMA .0 }{ Plot on Daily or Weekly charts }{ References indicator "Calendar Week counter" }{ Plot is independent of any missing chart data }{ ©Copyright 2003-2004 Jose Silva }{
[email protected]).H.metastocktools. x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5 P=6".E)).5).weekly { True weekly Close Exponential Mov Avg v4.PREV)*(1-2/(pds+1))+WkCl*2/(pds+1).O.1. Mov(x.252. WkCl:=ValueWhen(1.P. Mov(x. WkEma:=WkEma*shift. If(plot=2.EMA Close .100.triple crossover signals { Triggers Long (+1) & Short (-1) signals at crossover of triple EMAs within x periods }{
[email protected](x=5.E).4).com } pdsLong:=Input("Long crossover within x periods".1. Out:=Cross(x.{ User inputs } pds:=Input("EMA periods".pdsD. . loAvg:=LLV(L.2520.9).com} { Plot signals on own window below daily chart } { Variables user-input } pdsNoEntry:=Input("No entry x periods from last exit".pdsW.UpperBand. pdsW:=Input("Weekly EMA periods". pdsLong:=Input("Longer MACD periods". 2.signals. High=2.21.2)).-delay). x:=Input("use: Open=1.L.WC().2.E).Avg.If(plot=2.1.0)).1.hiAvg-Avg.252.12).1.In-Out)) (Go Top) Elder's Impulse system . delay:=Input("Entry/Exit signals delay".0.13)*5. { Plot envelope on price chart } If(plot=1.4). UpperBand:=Avg+shift.LowerBand). pdsD:=Input("Daily EMA periods". [3]All signals".42).provided by www.520. pdsShort:=Input("Shorter MACD periods".If(plot=2.252.252.3. flag:=BarsSince(Init OR In) <BarsSince(Init OR Out)+InInit.LowerBand. LowerBand:=Avg-shift. { Envelope bands } Avg:=Mov(x. { Envelope signals } In:=Cross(x.If(x=2.pdsBak).21). pdsBak:=Input("lookback periods". hiAvg:=HHV(H.O.0).0. tradeDelay:=0.5).1.26). If(plot=1.If(plot=2. shift:= Mov(If(hiAvg>Avg. [2]Long signals.E). signals:=Ref((InInit AND Alert(InInit=0.pdsBak).252.2) OR flag AND Alert(flag=0. WClose=5".pds. 1.UpperBand).Avg-loAvg). Init:=Cum(In+Out>-1)=1. InInit:=Cum(In)=1. { Price field } x:=If(x=1. plot:=Input("[1]AutoEnvelope.1.13).252.0.E).1).E).2)) -(flag=0 AND Alert(flag.pds.5.In-Out)).H.com { Dr Elder's Impulse system interpretation v1.signals.1 coded by metastocktools. Low=3.If(x=3. { Indicators } EmaW:=Mov(C. EmaD:=Mov(C.metastocktools.1. If(plot=1.5. pdsSignal:=Input("MACD trigger signal periods". Close=4.C)))).If(x=5. 2)) -(flag=0 AND Alert(flag. signals:=(InInit AND Alert(InInit=0.pdsSignal.C).E). In1:=EmaW>Ref(EmaW.pdsLong.-1) AND Hist<Ref(Hist.-1). Hist:=Mac-MacTrig.Cum(1)=FirstDay.1). FirstCl:=ValueWhen(1.-1) AND }EmaD<Ref(EmaD. ValueWhen(1.TtlDays-252.-1) AND EmaD>Ref(EmaD. flag:=Ref(BarsSince(Init OR In) <BarsSince(Init OR Out)+InInit. In:=In1 AND BarsSince(Out)>pdsNoEntry. { System logic } Out:={EmaW<Ref(EmaW.signals (Go Top) Exploration for highest percentage rise in share prices.Cum(1)=FirstDay.-1).E).-1) AND Hist>Ref(Hist. InInit:=Cum(In)=1.2)). FirstDay:=If(TtlDays>252.-tradeDelay).E)-Mov(C. FirstDay:=If(TtlDays>252.2) OR flag AND Alert(flag=0.Mac:=Mov(C.1).C) Column D: $ t/over Int(WC()*V) Column E: months Int(LastValue(Cum(1)/21)) Column F: weeks . { System signals } Init:=Cum(In+Out>-1)=1. stocks traded for any length of time { ©Copyright 2001 Jose Silva } Column A: +% incrs TtlDays:=LastValue(Cum(1)). MacTrig:=Mov(Mac.TtlDays-252.pdsShort. { Plot } 0. Int((C/FirstCl-1)*10000)/100 Column B: today Close Column C: 52w back TtlDays:=LastValue(Cum(1)). -13)+ref(c.1) Graphic: Buy Arrow Color: Black Label: Isolated Low Name: Isolated High .-3)+ref(c.-5)+ref(c.-2)+ref(c. I don't recommend this as a *system* at all.-8)+ref(c.-34)+ ref(c.21)+ ref(c.e) {{{ 34 period mov avg of above indicator}}} Look for crosses of the two indicators for positive or negatives.8. It really highlights some big moves but measuring it with the system test is useless. Now.21. (Go Top) Fibonacci Ratios and Momentum In MetaStock for Windows.Int((LastValue(Cum(1)) -Int(LastValue(Cum(1)/21))*21)/5) Filter: colA > 0 AND colD > 10000 FibboGatto FG1: ((c+ref(c.-1) AND LOW < Ref(LOW. Enter the following Expert Highlights and Expert Symbols into your Expert.34.-144))/c)*-1 {{{adding closing price only on fib days 1.-34)+ref(c.5.3. choose Expert Advisor from the Tools menu and then choose New.-144))/c)*-1. you can establish Fibonacci Retracement levels as outlined in the November 1997 TASC article "Using Fibonacci Ratios and Momentum" by Thom Hartle by first creating an Expert in the Expert Advisor.-5)+ref(c.-13)+ref(c. Fibonacci Ratios and Momentum Highlights Name: RSI > 50 Condition: RSI(14) > 50 Color: Dk Green Name: RSI < 50 Condition: RSI(14) < 50 Color: Red Symbols Name: Isolated Low Condition: LOW < Ref(LOW.2.89 and 144 and then dividing by today's close}}} FG2: mov(((c+ref(c.-1)+ref(c. just as an indicator.-3)+ref(c. You must use this as ONE of the tools -not THE tool.13.-2)+ref(c.-8)+ref(c.-1)+ref(c.-55)+ref(c. there are many whipsaws.34. To do this.-55)+ref(c.55.-89)+ref(c.-89)+ref(c.21)+ref(c. FmlVar("FT-DBP". You can now choose Fibonacci Retracement from the Insert menu.DayOfWeek()=1. and then drag from one isolated extreme to another. (Go Top) {Fibonacci Trader .H)+ LowestSince(1.FBC>0.DayOfWeek()=dt."DBC").H)+ LowestSince(1. FBP .Dynamic Balance Point Dynamic Balance Point Calculation dt:=DayOfWeek(). {then}(HighestSince(2. DBC (Go Top) Fibonacci Trader-Dynamic Balance Point Step DPS:=(ValueWhen(1. {Fixed Balance Point Plot} FBP:=ValueWhen(1. FmlVar("FT-DBP".1) Graphic: Sell Arrow Color: Black Label: Isolated High Note: If the Symbol labels make the chart too busy you may want to shorten the label (e."DBC").FmlVar("FT-DBP".FmlVar("FT-DBP".L)+CLOSE)/3. Choose Expert Advisor and then Attach from the Chart Shortcut Menu. In MetaStock 6.L)+ CLOSE)/3.DayOfWeek()=1. {then}(HighestSince(1."DBC"))+ ValueWhen(5.DayOfWeek()=1. open any chart.5 you should right-click on the Fibonacci Retracement lines and choose properties. {else}0))."DBC")))/5."DBC"))+ ValueWhen(15."DBC"))+ ValueWhen(20. and then click the rightmouse button on the chart’s heading.DayOfWeek()=dt.g."DBC").FBC). change plot to last "style" option} {Fixed Balance Point Calculation} FBC:=If(DayOfWeek()=1 AND Ref(DayOfWeek()."DBC"). change Isolated High to IH).Condition: HIGH > Ref(HIGH."DBC").FmlVar("FT-DBP". close the Expert Advisor. (Go Top) Fibonacci Trader.H)+ LowestSince(5. FmlVar("FT-DBP". DPS.-1) <5. FmlVar("FT-DBP".FmlVar("FT-DBP". {else}If(DayOfWeek()=5.FmlVar("FT-DBP". Check the Snap to Price checkbox so the Retracement lines will automatically snap to the high and low prices.Fixed Balance Point} {NOTE: under Color/Style options.-1) AND HIGH > Ref(HIGH.DayOfWeek()=1. DBC:=(HighestSince(5. FmlVar("FT-DBP"."DBC"))+ ValueWhen(10. Next.L)+ CLOSE)/3. Fc1:=BarsSince(DayOfWeek()=5).FmlVar("FT-FBP".-1)+ Ref(LLV(L.FmlVar("FT-FBP".-1)-1. FmlVar("FT-FBP"."FBC")) + ValueWhen(3. (Go Top) Fibonacci Trader. {else}0))). FmlVar("FT-FBP".LastValue(Mc1))+ LLV(L.LastValue(Fc2))+ LLV(L."FBC")) + ValueWhen(2.-1))/3.LastValue(mc1)).LastValue(Fc2)). {else}If(Fc1=0.FmlVar("FT-FBP". FBP."FBC")))/5. change plot to last "style" option} {Weekly Price Range Calculation} Mc1:=BarsSince(DayOfWeek()=1).LastValue(Mc1))+C)/3.-1).LastValue(Fc2))LLV(L. Fc2:=Ref(BarsSince(DayOfWeek()=5).-1)Ref(LLV(L. FmlVar("FT-FBP"."FBC")) + ValueWhen(4."FBC")>0. FmlVar("FT-FBP". FPS (Go Top) Fibonacci Trader."FBC")>0.LastValue(Fc2))+C)/3. {else}If(Fc1=0. {Fixed Balance Point Calculation} FBC:=If(Mc1=0 AND Fc1>2.FmlVar("FT-FBP". {then}(Ref(HHV(H.(Go Top) Fibonacci Trader."FBC")>0. {Fixed Balance Point Plot} FBP:=ValueWhen(1. {else}If(Fc1=0 AND Mc1>5."FBC")>0.REVISED {NOTE: under Color/Style options.-1)-1.FBC). FmlVar("FT-FBP". {then}(HHV(H.LastValue(Mc1)). Fc2:=Ref(BarsSince(DayOfWeek()=5). . change plot to last "style" option} {revised 1 Jan 99} Mc1:=BarsSince(DayOfWeek()=1). {else}If(Fc1=0 AND Mc1>5.Fixed Balance Point. Fc1:=BarsSince(DayOfWeek()=5)."FBC")>0. {then}Ref(HHV(H.FmlVar("FT-FBP".FBC>0.-1)+ Ref(C.Support and Resistance {NOTE: under Color/Style options.LastValue(Mc1)). {then}HHV(H. {then}(HHV(H.LastValue(mc1)).Fixed Balance Point Step FPS:=(ValueWhen(1. WRC:=If(Mc1=0 AND Fc1>2."FBC")) + ValueWhen(5. 1) (Go Top) Finding Trendiness A remark by Chuck LeBeau about trading with the trend has stayed with me.618).-1).. 1)<> Ref(Peak(1.LastValue(Mc1))LLV(L. SR2.WRC). SR2:= FmlVar("FT-FBP". Fml ( "Uptrend" ) = Peak(1.4)."FBP")+(WRP*. 0).LastValue(Mc1)).. For convenience. -1).. If (L<Ref(LLV(L. consisting of both direction and strength..WRC>0. He speaks of the actual strength of a trend as opposed to merely its direction. Here are some initial thoughts. {Resistance Range} RR1:= FmlVar("FT-FBP". WRP:=ValueWhen(1."FBP")+(WRP*. -1). {Plot Ranges} RR1.4). Ref(HHV(H."FBP")-(WRP*.-1) . { then } Ref ( HHV (H.. RR2. RR2:= FmlVar("FT-FBP".4).. 1) and..4).-1). I'll describe only long trades."FBP")-(WRP*. I. Trend picks up steam: EMA(13) > EMA(21) > EMA(55) . Ref(LLV(L.4). or call it a classification. If (H>Ref(HHV(H.5). SR1.4).5). 0). If (L<Ref(LLV(L. 0).618). he says. If (H>Ref(HHV(H. -1).. Fml ( "Downtrend" ) = Peak(1. General direction. 0). This makes perfect sense to me. Entry strategies (pullbacks in his view) should be tailored to both direction and strength. -1 ).4).{then}HHV(H. {else}0))). long term: EMA(21) > EMA(55) II.. Ref(LLV(L.. 1)<> Ref(Peak(1. or a taxonomy.. (Go Top) Final Plot {from Richard Estes} Fml ( "Final Plot" ) = If (BarsSince ( Fml ( "Downtrend" )) < BarsSince ( Fml ( "Uptrend" )).. {Support Range} SR1:= FmlVar("FT-FBP".-1 )) where.4).-1) .4) .4). { else } Ref (LLV (L.-1). Perhaps you can help me to arrive at some kind of "hierarchy" of trendiness. Ref(HHV(H. & others). . . I'd prefer not to hear the lectures about the folly I pursue. CMO. Somewhere between II. MACD Histogram.. a rising ADX at any level generally means business: ADX(13) > Ref(ADX(13). So.ForecastOsc(CLOSE. and III. Bollinger Band Histogram.opt3)) Close Long: Cross(ForecastOsc(CLOSE.-1) V. very little direction (but don't fall asleep at the wheel): ADX(13) < say.opt3).III. From what I've seen. we are "best fitting" circumstances to static prices etched in stone. I've been system testing since 1975 and I've made a bazillion mistakes (and a little chump change) over the years.opt2) Enter Short: Cross(ForecastOsc(CLOSE.. I've continued to use the same "framework" for my testing. . The basic formula: Enter Long: Cross(opt1. In an earlier post today (a private email that made it to the list. I'm still looking for the holy grail.opt3). Before I explain the method to my madness.I'm a little dingy tonight..had to get up a 5 am to trade cocoa). The act of backtesting is not the dangerous part.. Forecast Oscillator.. So please. a modified Time Series Forecast.opt2) Close Short: Cross(opt1. I've used many indicators in these tests (i. Very strong trend: (this is where Linda Bradford's "Holy Grail" and such kick in) ADX(13) > Ref(ADX(13) and ADX(13) > 30 Almost forgot .e. Backtesting systems is very dangerous. I alluded to using the CMO. I still communicate with many of the original respondents. The response was surprising (lots of it) and today. I posted a little linear regression system that featured the Forecast Oscillator.believing that the results can be duplicated in the future is very dangerous. Strong: EMA(8) >EMA(13) > EMA(21) > EMA(55) IV. 12-15 and has been bumbling along down there for a while (hard to quantify for me to date) (Go Top) Forecast Oscillator Many moons ago. here's the outline: 1..opt3)) You can substitute any standard formula for the ForecastOsc or you can put in a custom formula (just remember that custom formulae need to look like: fml("Karnack's SuperSecret") It's in your manual.ForecastOsc(CLOSE. Let's face it.. please read the following sentences carefully. the ADX(13/14) usually starts rising. Attached is the original system. because I using a fixed set of parameters within the custom formula. For the forecast oscillator. opt2: Opt2 is the numeric value above a zero basis line that will trigger a short sale. but if I'm using a custom formula. I usually use three (3) to ten (10) for the forecast oscillator. Yes Virginia. As in many markets. one must be aware of the terrain the indicator travels over. I usually use 0 to -3. cocoa. I use: .1 steps. 5. Steps: I step opt3 using whole numbers to represent days. 3. sometimes I don't even need opt3. One must eyeball the forecast oscillator to see how far it swings above and below zero. 6. this system works better when things trend indefinitely. 4. What will happen when the grains. using the Forecast Oscillator. the market is either overbought or oversold. it does work on stocks) you're trading. Zero to 3 seems to work for this formula. The trick is not to trigger action when the indicator turns in a new direction (if you're interested. It would be ridiculous to us zero to 3 (as the optimizing numbers) if the mid point is 50 and the indicator traverses between +10 (on the downside) and +90 (on the upside). With Opt1 and Opt2. opt3: In this search "opt3" represents the number of days inserted into the forecast oscillator. the short sale trigger (opt2) is going to be closer to the zero basis line than opt1. and damn near everything else starts to go up? Good question Steve! The system will not perform as well if you continue to use the same parameters.2. The theory is that once an indicator extends to a certain level. I prefer stop and reverse trading. I hope this post will help others who have inquired about the linear regression system. for March Crude Oil. In a perfectly sideways market. I've been down that road and I'm still wearing a neck brace from the whiplash). In this example. Other indicators: When substituting the CMO (or any indicator) for the Forecast Oscillator. opt1: Opt1 is the numeric value below a zero basis line that will trigger a long position and close out the short. in my secular little world. In downtrending markets (can you spell deflation?). opt3 is set to 8 (number of . Please see the attachment. The parameters for this option depends on the commodity (and yes. crude. The overall theory behind this test is that many indicator oscillate from positive to negative and back again (duh). one would assume that the trigger points would be equal distance from zero. multiply by 0.02 and write each value down.0) Exit long: Cross(Mov(C. opt2 is . opt1 is -2.18 days ago (inclusive). multiply each daily value by 0. Finally. Then take the closing prices of your instrument 25 days ago .N.02 and write each value down. Then take the closing price of your instrument 7 days ago .3. Then take the closing price of your instrument 5 days ago .03 ad write the value down. Then take the closing price of your instrument 17 days ago and multiply by 0.E).6 days ago (inclusive). multiply by 0.21)) AND Cross(6. by observation.E)) AND Cross(ForecastOsc(C. multiply by 0.1 day ago (inclusive). multiply each daily value by 0. (Go Top) Forecast Oscillator System Enter long: Cross(ForecastOsc(C.ForecastOsc(C.E)) (Go Top) Forecast Oscillator System Alternative Enter long: Cross(ForecastOsc(C. Then take the closing prices of your instrument 25 days ago .days in the forecast oscillator).0) Exit long: Cross(Mov(ForecastOsc(C." To qoute Karnack (my alter ego): "I got knocked down seven times and got up eight".3. Elliot: "Even though we many not understand the cause underlying a particular phenomenon.1 (sell signal).21).21)) AND Cross(6. from a trader on the realtraders forum: "Futures trading involves financial risk.ForecastOsc(C.26 days ago (inclusive).21)) {You can use alert() function on either if you don't require both conditions to fire on the same day.18 days ago (inclusive).21).3. predict the phenomenon's recurrence. To quote R. we can.Mov(C. .07 and write each value down.3.21).21).3 (buy signal).3.031 and write each value down.ForecastOsc(C.8 days ago (inclusive). multiply each daily value by 0.Mov(C. Then take the closing price of your instrument 16 days ago .Mov(ForecastOsc(C.21). lots of it".006 and write each value down.01 and write each value down.} (Go Top) Front Weighted 36 Day Moving Average This indicator requires 3 sub calculations and then the totalling of all 3 to get the final indicator: This is the basic calculation: Take the closing prices of your instrument 34 days ago .21).E).E)) AND Cross(ForecastOsc(C. 031 * Ref(P.-6) + 0.02 * Ref(P.-12) + 0.031 * Ref(P.031 * Ref(P.006 * Ref(P. add up all the values that you wrote down and plot the value on the chart.01 * Ref(P.-15) + 0.031 * Ref(P.-5) + 0. repeat this for every new trading day.-28) + 0. with a sliding scale for each trading days value.01 * Ref(P.-4) + .-20) + 0.031 * Ref(P.-26) + 0.-22) + 0.-34) + 0.031 * Ref(P. This particular variation attempts to weight the data at the front more than that at the back.02 * Ref(P.02 * Ref(P.01 * Ref(P.-17) + 0.006 * Ref(P. Metastock code for Front Weighted 36 Day Moving Average: Fml( "1FrontWeighted36BarMA1" ) + Fml( "2FrontWeighted36BarMA2" ) + Fml( "3FrontWeighted36BarMA3" ) Where Fml( "1FrontWeighted36BarMA1" ) = 0.02 * Ref(P.01 * Ref(P.-13) + 0. The interpretation is just as with all others.02 * Ref(P.-11) + 0.-25) + 0.02 * Ref(P.Then take the closing price of your instrument today.01 * Ref(P.-32) + 0.07 * Ref(P.-7) + 0.02 * Ref(P.-30) + 0. multiply by 0.031 * Ref(P.-24) + 0.-27) + 0.-16) + 0.-18) Where Fml( "2FrontWeighted36BarMA2" ) = 0. Finally.-33) + 0.031 * Ref(P.01 * Ref(P.-29) + 0. the trend is up when prices are above the moving average and the trend is down when prices are below the moving averages.-23) + 0.01 * Ref(P.01 * Ref(P.031 * Ref(P.-14) + 0.-8) + 0.07 * Ref(P. Simple Interpretation: Front Weighted 36 Day Moving Average is similar to all other moving averages.02 * Ref(P.-9) + 0.01 * Ref(P.-10) + 0.-21) + 0.03 * Ref(P.-19) + 0.079 and write this value down.-31) + 0. -1)<0. it is only available from Barrons magazine and must be manually input.-2) Where Fml( "3FrontWeighted36BarMA3" ) = 0. To keep the GMI data updated.E).3 for the standard deviations. To do this.-(P-Ref(P.0). then choose the Barron's Gold Mining Index as the Primary symbol and Handy and Harman prices as the secondary symbol.a number of periods in rsi(n).-1)).-1) + 0.-1).E) /Mov(If(P-Ref(P. The only source we are aware of on diskette is the author of the article.-1)<0. Make sure the directory specified is the directory where your weekly GMI and Handy and Harman data are located. This may be obtained from the Wall Street Journal as well. Name the composite the K ratio. The Handy & Harman data must also be manually updated.1000000. It must be output to ASCII and then converted to MetaStock data files. Change m if you choose another # of periods n for rsi. n .07 * Ref(P.-1)>0.-1)).0). It was not that important for me. Mind that since I didn't use those particular tricks from the standard rsi(n) to shorten the initial transitional period.07 * Ref(P.E)=0.23. launch The Downloader from MetaStock.} {I wrote my own "canonical" RSI(12) which coincides with MetaStock's RSI(12) if m=2*n-1 where m is used below in Mov( . The data necessary for this chart/indicator. you must first create the K ratio as a composite security.+ If(Mov(If(P-Ref(P. two conditions to colour bars and two system . He will make a small charge for this data.m.} 100 . 0). and choose New and then Composite from The Downloader's File menu. is extremely difficult to obtain. (Go Top) From Terms to Technical Tools In Walter Downs’ article "From Terms To Technical Tools" he introduces the Point of Balance Oscillator. Next. so I used this shortcut. choose Divide as the Operator and the click the OK button to add the composite. Plot the Bollinger Bands Indicator and enter 46 for the number of periods and 2.07 * Ref(P.079 * P (Go Top) Full Formula for RSI {The following is copied from the Formula Field of my *RSI canonical_12_day_for_P_I indicator.-(P-Ref(P.100/ (1. this function and standard rsi(n) differ for about month or so from the day 1. P-Ref(P. Plot Bollinger Bands again and enter 4 for the periods and 1. The data is in a Lotus spreadsheet.E) )) (Go Top) Freeburg Precious Metal Switch Fund System To create the Freeburg Precious Metal Switch Fund system in MetaStock for Windows.6 for the Standard Deviations.23.23. Open the K ratio chart in MetaStock.-3) + 0. Mov(If(P-Ref(P.0. n))/2.LLV(HIGH. POBC10 := (HHV(POBC9.n))/2.LLV(HIGH. n) + LLV(POBC6. BullFear := (HHV(HIGH. POBC9 := (HHV(POBC8.n).Signal Formulas Enter Long: n := 12 {Time periods}.n) . POBC1 := (HHV(CLOSE. CLOSE > BullFear Color: Blue Name: Bear Fear Condition: n := 12 {Time periods}.n))/2. choose Expert Advisor from the Tools menu. POBC4 := (HHV(POBC3.LLV(LOW.n))/2 + LLV(HIGH. choose Indicator Builder from the Tools menu.n))/2. click on the New button and enter the following expert: Bull Fear and Bear Fear Expert .CLOSE) Four-Bar Fear System Test .n))/2 + LLV(HIGH. To create the Point of Balance Oscillator. POBC2 := (HHV(POBC1.Signal Formulas Enter Long: n := 12 {Time periods}. BearFear := (HHV(LOW.tests. CLOSE < BearFear Color: Red To test the two systems discussed in the article. n) + LLV(POBC2.BullFear) Enter Short: n := 12 {Time periods}. Cross(CLOSE.n).n))/2 + LLV(HIGH. . choose System Tester from the Tools menu and enter both of the following systems: Bull and Bear Fear System Test .n). BullFear := (HHV(HIGH. n) + LLV(POBC4.1.n))/2 + LLV(LOW. BearFear := (HHV(LOW. 10)-LLV(CLOSE. n) + LLV(POBC7.n).n) . POBCOsc := 100 * ((CLOSE . Cross(BearFear.n))/2. POBC5 := (HHV(POBC4.n) .n) .n))/2 + LLV(LOW.n))/2. AV := (POBC1 + POBC2 + POBC3 + POBC4 + POBC5 + POBC6 + POBC7 + POBC8 + POBC9 + POBC10) / 10.n))/2. All of these can be created quite easily in MetaStock 6.5.n))/2.LLV(LOW.n). click on the New button.n))/2.AV) / (HHV(CLOSE.LLV(LOW. BearFear := (HHV(LOW. n) + LLV(POBC5.n))/2. n) + LLV(POBC8. BullFear := (HHV(HIGH. 10))).100.n) .Highlights Name: Bull Fear <Condition: n := 12 {Time periods}. n) + LLV(POBC1. POBC6 := (HHV(POBC5.n).LLV(HIGH. POBCOsc To highlight bars based on the Bull Fear and Bear Fear conditions discussed in the article. POBC8 := (HHV(POBC7.n) . and enter the following formula: Point of Balance Oscillator n := Input("Time Periods". n) + LLV(POBC3. POBC3 := (HHV(POBC2. n) + LLV(CLOSE.12)/2. POBC7 := (HHV(POBC6. n) + LLV(POBC9.n))/2 + LLV(LOW. HLv:=ValueWhen(1.BullFear) AND Ref(Sum(CLOSE < BullFear AND CLOSE > BearFear. BLF:=((HHV(H. (Go Top) Gann Hi-Lo .3).S)).LLV(HIGH.-1). BLF. POB:=((BLF-BRF)/2)+BRF. {then}1.%)>10 OR ROC(C. BullFear := (HHV(HIGH. {else}Mov(L. but not contained in the Traders Tip published in TASC.100.-1).TP))/2).-1) Enter Short: n := 12 {Time periods}. {then}Mov(H.S).5.n))/2 + LLV(LOW.4).%)<-10) AND C>5 Filter enabled: Yes (Go Top) Gann High Low {name: GANN-HiLo} HLd:=If(CLOSE>Ref(Mov(H.Cross(CLOSE.1.3.LLV(LOW.5. Please note. POB Gain By % Col A: CLOSE Col B: ROC(C.12).S). Cross(BearFear. Moving Averages Formula for MetaStock TP:=Input("Time Periods".HLd). Following is the formula for the moving averages discussed in the article.n))/2 + LLV(HIGH.TP)+LLV(L. {else}If(CLOSE<Ref(Mov(L.n) . HiLo:=If(HLv=-1.S).n). this formula will plot all three moving averages. BRF:=((HHV(L. but will not plot them in three different colours. {then}-1.TP)+LLV(H.HLd<>0.5.3. BearFear := (HHV(LOW.-1) = 4 Close Short: HIGH > Ref(HHV(HIGH.TP))/2).3.CLOSE) AND Ref(Sum(CLOSE < BullFear AND CLOSE > BearFear.%) Filter: (ROC(C.4). BRF.n) .-1) = 4 Close Long: LOW < Ref(LLV(LOW.3).3.-1) After entering the systems click on the Options button in the System Tester dialog. HiLo. go to the Testing tab and change the Trade Price to Open and set the Trade delay to one. {else}0)).n). -1).-2))). Gann Weekly Expert Instructions 1.-1) > Ref(BarsSince(Sd1=-1). Ds:=BarsSince((L < Ref(L. {else}0). (Go Top) Gann Swing Update This is an update to Gann-Swing indicators I had posted several months back. Sd2:=If(Sd1=1. uplot:=If(BarsSince(Ut=1)< . Most of the code has been improved and I have modified the swing definition slightly. Td1.-1)<>LowestSince(1. Sd1:=If(Us=0. {else}0)). Down = 2 lower highs. {then}If(Ref(H.H).-1) < Ref(BarsSince(Sd1=-1).} Us:=BarsSince((H > Ref(H.Ds=0.-2))). {then} If(Ref(BarsSince(Sd1=1).-1)) AND (Ref(H. {then}1. {else}If(Ds=0. 2a. {else}0)). {then}If(Ref(L.-1)<> HighestSince(1. First create a new expert and name it whatever you want. TD1:=ValueWhen(1.Us=0.Sd2<>0.-1) < Ref(L. {else}0). {then}-1. {then}1.L). {then}If(Ref(BarsSince(Sd1=1). {else}0). under "trends" tab put this code for bullish: ut:=FmlVar("GANN-Trend".-1).Sd2).-1) > Ref(H. {then}-1. {else}0)."TDV"). {else} If(Sd1=-1.colA BUY BarsSince(C< Fml("GANN-HiLo")) colB SELL BarsSince(C> Fml("GANN-HiLo")) filter colA=1 OR colB=1 (Go Top) Gann-Swing {Market swing is defined as: Up = 2 higher highs.-1)) AND (Ref(L. and this for bearish: dt:=FmlVar("GANN-Trend". 2b. uplot:=If(BarsSince(Ut=1)< BarsSince(Ut=-1)."SD2")=1."TD").. then under graphic choose "Buy Arrow". 2b. Under highlights tab create a new and call it "HiLo Change".1. uplot=1. Create new and call it "DownSwing". As for the HiLo . choose color.1. uplot:=If(BarsSince(Ut=1)< BarsSince(Ut=-1). {else}0)). HLv<>Ref(HLv.-1).0).. {else}If(CLOSE<Ref(Mov(L.3.1. and small size. dt:= FmlVar("GaW-Trend". dplot:=If(BarsSince(dt=1)> BarsSince(dt=-1). dplot=1. choose color (Dark Red). uplot=1. Create new and call it "Up-Trend". 3b. choose color. 3a. enter this code: FmlVar("GANN-Swing". Then click on the "ribbon" option and turn off "Display Vertical Lines".BarsSince(Ut=-1).just plot it as a regular indicator and choose the last "style" option under "color/style" tab.0).S). dplot=1. I also turn off the corner option.0). {then}1.HLd). choose color.-1).HLd<>0. and small size. then pick "Above Price Plot". and enter this code: ut:=FmlVar("GANN-Trend". Note: For daily bar charts ribbon use these formulas: 2a.. HLv:=ValueWhen(1. enter this code: FmlVar("GANN-Swing". dplot:=If(BarsSince(dt=1)> BarsSince(dt=-1).1. 4a. 3c."TDV").1. then pick "Below Price Plot".-1)."TDV") . then under graphic choose "sell arrow". uplot=1. (Go Top) .S).0).0)."TDV") . and enter this code: HLd:=If(CLOSE>Ref(Mov(H. 4b. dplot:=If(BarsSince(dt=1)> BarsSince(dt=-1). choose color (Dark Green). dplot=1. ut:= FmlVar("GaW-Trend"."SD2")=-1. and enter this code: dt:=FmlVar("GANN-Trend". Under "Symbols" tab create new and call it " UpSwing"."TD").3. Create new and call it "Down-Trend". {then}-1.0).1. {then}1.-1)=-1. {then}LowestSince(1. (Go Top) Gap 1 System {BUY} L>Ref(H.Tv).-1) OR Cum(1)=LastValue(Cum(1)) {SELL} N1:=5.-1) OR Cum(1)=LastValue(Cum(1)) (Go Top) Gap 2 System {BUY} N1:=5. {else}0)).N1).Td). {else}0). {then}HighestSince(1. Tdv. {Peak Value} Pv:=If(Scl=1.L). {UpTrend=1 DownTrend =-1} Tdv:=ValueWhen(1.N1). {else}0).Sch=1. {else}If(L<ValueWhen(1."TD1") .Gann-Trend {Swing Direction} Sd:= FmlVar("GANN-Swing". {else}0).-1) OR Cum(1)=LastValue(Cum(1)) (Go Top) Gap 3 System {Enter Long} N1:=5.Pv). {Swing Change Low} Scl:=If(Sd=-1 AND Ref(Sd.-1)=1. {then}1. {then}-1.Td<>0. {Trend Direction} Td:=If(H>ValueWhen(1.Scl=1. {else}0).-1) OR Cum(1)=LastValue(Cum(1)) {SELL} H<Ref(L.N1).-1) OR Cum(1)=LastValue(Cum(1)) . {Swing Change High} Sch:=If(Sd=1 AND Ref(sd. H<Ref(LLV(L. L>Ref(HHV(H.Tv>0. L>Ref(HHV(H.H). {Trough Value} Tv:=If(Sch=1.Pv>0. {then}1. 1%).-1) OR Cum(1)=LastValue(Cum(1)) {Enter Short} N1:=5. C>Ref(HHV(H. Cum(Gap >= MinGap AND Gap< MinGap + GapIncrement). OPEN-CLOSE.10000.-1)*100. H<Ref(LLV(L. Cum(prf). GapIncrement := Input("Gap Increment (%)". LookingForGapDown := MinGap < 0. dn:= 1. CLOSE-OPEN. which would give you a range of 1-2%)..0)). and the second input is the gap increment (e. For practical reasons. -1))/Ref(CLOSE.N2). up:= 1. 1%..Ref(CLOSE. If(LookingForGapDown.N2). NumGaps := If(LookingForGapUp. showing the cumulated profit. LookingForGapUp := MinGap >= 0.g. • GapUp() (Go Top) Gap Trading Here is the gap-trading system code for use in Equis International's MetaStock software.1).-1) OR Cum(1)=LastValue(Cum(1)) {Exit Short} N2:=3. -1).g. Formula to determine whether the closing price is equal to or exceeds the opening price on a gap day: MinGap := Input("Minimum gap to consider (%)". Cum(Gap <= MinGap AND Gap > MinGap - .0. gap:= 100*(OPEN .-1) OR Cum(1)=LastValue(Cum(1)) (Go Top) Gap Days Shows stocks which have gapped up or down on the open compared to yesterdays price. change the percentage to a negative. C<Ref(LLV(L. The first input is the minimum gap (e.-1))/Ref(CLOSE. prf:= If(gap>=up. the system has been defined as an indicator rather than a system.1). If(gap<=-dn.{Exit Long} N2:=3.Ref(CLOSE.-10000. The search returns 1 for Ok and 0 for not ok.0. { Gap percentage } Gap := (OPEN .100. (Go Top) Gap Up Formulas The MetaStock formulas to calculate these percentages are shown below.N1). To calculate gaps down.0. -1)*100. +1.0).Ref(CLOSE. If(LookingForGapUp. GapYesterday := (Ref(OPEN.10000. +1. If(LookingForGapDown.1). Cum(Gap <= MinGap AND Gap > MinGap GapIncrement). GapIncrement := Input("Gap Increment (%)".0)). LookingForGapDown := MinGap < 0. If(OPEN > Ref(CLOSE. Cum(If(Gap >= MinGap AND Gap < MinGap + GapIncrement.0)). LookingForGapUp := MinGap >= 0.100. If(CLOSE <= OPEN.-1). GapIncrement := Input("Gap Increment (%)". 0))/NumGaps*100. If(CLOSE >= OPEN.-1) .1). Cum(Gap >= MinGap AND Gap< MinGap + GapIncrement).0)).-1).0)). If(LookingForGapUp. LookingForGapDown := MinGap < 0. +1.GapIncrement). LookingForGapUp := MinGap >= 0. Cum(GapYesterday <= MinGap AND GapYesterday > MinGap GapIncrement). 0))/NumGaps*100.0. +1. Cum(GapYesterday> = MinGap AND GapYesterday < MinGap + GapIncrement). { Gap percentage } Gap := (OPEN . If(HIGH >= Ref(CLOSE. If(LOW <= Ref(CLOSE. +1.-10000. If(LookingForGapUp. Cum(If(Gap <= MinGap AND Gap > MinGap GapIncrement.0.10000.1).0)).0). Formula to determine whether the daily range crosses the previous day’s close on a gap day: MinGap := Input("Minimum gap to consider (%)".-2))/Ref(CLOSE.-1).-10000. NumGaps := If(LookingForGapUp. If(LookingForGapDown. If(LookingForGapDown. 0).-1))/Ref(CLOSE.Ref(CLOSE. Formula to determine whether the following day’s open continues the gap trend: MinGap := Input("Minimum gap to consider (%)". Cum(If(Gap <= MinGap AND Gap > MinGap GapIncrement.100. If(LookingForGapDown.0)).1).0). NumGapsthruYesterday := If(LookingForGapUp.0)).0)). 0). . Cum(If(Gap >= MinGap AND Gap < MinGap + GapIncrement. Cum(If(GapYesterday >= MinGap AND GapYesterday < MinGap + GapIncrement.-2)*100. -1).50)+L (Go Top) Gilligan's Island Sell A:Close B:GapUp()>=Ref(HHV(H.50)+L (Go Top) Guppy MMA Exploration from Trading Tactics.-1) and C<=O and C<=((H-L)*.-1) Ref(C. part 2 NOTE This EXPLORATION uses the results of several INDICATOR FORMULAS.GapIncrement.40).125 D:{stop}H+. 100% (Go Top) Gilligan's Island Buy A:Close B:GapDown()<=Ref(LLV(L.40).-1) and C>=O and C>=((H-L)*. 0). If(OPEN < Ref(CLOSE.125+1 Filter: GapUp()>=Ref(HHV(H. You must create the INDICATORS first before running the exploration.0)). (Go Top) Gap Up System with Delayed Exit Enter long GapUp() Close long Ref(GapUp().40). depending on your system you may have some problems importing this into early versions of Metastock 7. +1.-1) .-5) Initial equity 10000 Positions Long and short Trade price Open Trade delay 1 Entry commission 0% Exit commission 0% Interest rate 0% Margin req. Ref(C. Also.-2) Fml("mma 3/30") +Fml("mma 5/35") +Fml("mma 8/40") + Fml("mma 10/45")+Fml("mma 12/50")+Fml("mma 15/60") Ref(Fml("mma 3/30") +Fml("mma 5/35") +Fml("mma 8/40") + Fml("mma 10/45")+Fml("mma 12/50")+Fml("mma 15/60").-1) and C>=O and C>=((H-L)*.-1) and C<=O and C<=((H-L)*.If(LookingForGapDown.50)+L C:{entry}H+.40). 0))/NumGapsthruYesterday*100.125-1 Filter: GapDown()<=Ref(LLV(L.50)+L C:{entry}L-.125 D:{stop}L-. Cum(If(GapYesterday <= MinGap AND GapYesterday > MinGap . E). Mov(C.Mov(C. Mov(C..E).E). Daryl Guppy) Try MMA (Multiple Moving Averages).0) (Go Top) Guppy MMA Indicators (Note this is not the same as the formula given in Trading Tactics. Mov(C.Mov(C.E).E).E).55.>.40.Mov(C.} (Go Top) Guppy's MMA Long {long-term} Mov(C.5.E).14. The exit at the top of the bubble is indicated by MMA Short turning down after a good separation from the underlying MMA Long.50.E). Mov(C.E).E). Name: MMA Short Term -------Mov(C.15.E). RED for the SHORTs and BLUE for the LONGs.7.8.Mov(C.60.Mov(C. from Jeff Lederman.Ref(Fml("mma 3/30") +Fml("mma 5/35") +Fml("mma 8/40") + Fml("mma 10/45")+Fml("mma 12/50")+Fml("mma 15/60").50.5.g.3.11. Mov(C.E).E).E).40. e.E). Mov(C.<=.E). The shorter ones are closer to the action and the longer ones tell you about the trend. In the current market I like taking short momentum trades where the MMA Short is bouncing up off a slowly rising MMA Long Term.Mov(C. Mov(C. I use two indicators like this: Name: MMA Long Term -------Mov(C.Mov(C.Mov(C.E).-2) When(colD.10.E). giving SHORT and LONG MMAs separate colours.45. (Go Top) .45. Mov(C.E).E) (Go Top) Guppy's MMA Short {short-term} Mov(C.30.0) AND When(colE. {Suggestion: Create a single TEMPLATE with all the above indicators.12.35. choose System Tester from the Tools menu.E))(Mov(CLOSE.2)-(ref(tsf(C.9.60.E)+Mov(CLOSE.3.9).9)-ref(tsf(C. Click on the New button and enter in the following rules: Signal Formulas Enter Long Cross( Mov( Close. (Go Top) Gap Identification if(L.E)+Mov(CLOSE.40.-2)))+((ref(tsf (C.S).S)) And Close > Mov( Close.E)+ Mov(CLOSE.E)+Mov(CLOSE.80.ref(L.E)).35.E)+Mov(CLOSE.E)))*10.-1)-(ref(tsf(C.-1).80.9. In MetaStock for Windows.S) Close Short Cross( Mov( Close.E)+ Mov(CLOSE.E)+ Mov(CLOSE.1.45.-2))) GRIIF3 Momentum Oscillator (ref(tsf(C. if(H.9).60.S).9).50. (Mov((Mov(CLOSE.E)+Mov(CLOSE.12.3.9.30.Guppy MMA Oscillator by Leon Wilson ((Mov(CLOSE.15.9).S)) And Close < Mov( Close.E)+Mov(CLOSE. Mov( Close.S).0.9).9).30.E))*10.-1))+((ref(tsf(C.E)+ Mov(CLOSE.E)+Mov(CLOSE.10.S)) And Close > Mov( Close.E)+ Mov(CLOSE.8.-1)-ref(tsf(C.9)-ref(tsf(C.<.13.80.E))(Mov(CLOSE.-1). Mov( Close. choose Options from the System Tester dialog and then Points Only Test from the Testing page.50.15.8.50.S) When testing futures in MetaStock it’s best to use a "points only" test.9).-3)))) (Go Top) Genesis of a Simple Futures Trading System It’s quite easy to use MetaStock for Windows to duplicate the Genesis of a Simple Futures Trading system which is presented in the TASC May 97 issue's interview of Jay Kaeppel.S) Enter Short Cross( Mov( Close.E)+Mov(CLOSE.0)) (Go Top) GRIIF1 Identification Oscillator GRIIF1 Momentum Oscillator tsf(C.S).9.E)+Mov(CLOSE.S)) And Close < Mov( Close.50.E)+Mov(CLOSE.50.E)+ Mov(CLOSE.9).5.E)+ Mov(CLOSE.80.E)+Mov(CLOSE.9).40. Mov( Close.35.5. .S) Close Long Cross( Mov( Close.-1. Mov( Close.-1) GRIIF2 Momentum Oscillator (ref(tsf(C.9).45.12.>.-3))) GRII4 Momentum Oscillator (tsf(C.E)+ Mov(CLOSE.ref(H.10.-2)-(ref(tsf(C. To do this.E)+Mov(CLOSE.50. >.89). Tsokakis.400.EXPONENTIAL)) * 100 • When(colA.EXPONENTIAL) • ((VOLUME . • CLOSE • CLOSE -1 • CLOSE -2 • **When(colA.9.E)).S).-1)) + Abs(L . {Buy Signal-->}Cross(C.// CALIBRATE THE ZIG() SENSITIVITY .50.21).-1)) ). HighestSince(1.>.H) (Go Top) High Low Len:=Input("Periods".L + Abs(H .>. Mov( Close. for example.20.colC) (Go Top) Higher Volume Exploration Required: today's volume to be greater than the highest high over the past 21 days.1.S) Filter Source Filter Enabled: Yes Formula: colA = 1 OR colB = 1 Next choose Explore and The Explorer will search for and then display any futures.S).Mov(C.EXPONENTIAL)) • /Mov(VOLUME.S)) And Close < Mov( Close.colB) (Go Top) Historical Trendlines and Breakouts.100.9. by D.80.100. • VOLUME • Mov(VOLUME. the highest high since a buy signal was triggered? I want to add this into a system test that I am trying to run.80.50.Ref(C. choose The Explorer from the Tools dialog and enter in the following rules: Column Formulas Column A: Buy Sign Cross( Mov( Close.Ref(C.S)) And Close > Mov( Close. Oct2003 x = Cum(1). Higher Closes Shows stocks which have closed higher on successive days.colB) AND When(colB. (Mov((H .-1) (Go Top) Highest High Since Buy Signal Anyone know how to keep track of.S) Column B: Shrt Sig Cross( Mov( Close. which have generated new signals. The search returns 1 for Ok and 0 for not ok. per = 3.100.len. Mov( Close.E))/2 (Go Top) High Volume Displays those where volume is above the 100 day moving average.Mov(VOLUME. MetaStock Explorer filter: V>Ref(HHV(V.To use The Explorer to screen for futures generating a recent signal with this system. x.100). x .Last=Max(endt.//RESISTANCE LINE first=Min(startt. trendlineR = aR * ( x -endt1 ) + bR. To test trading systems using this indicator it would he helpful to use the alert function along with a trend following indicator.1)).1e10). Choose Historical Volatility Indicator Properties and then choose the Horizontal Lines page. x . Plot(IIf(x>=first-d AND x<=Last+d. startt=SelectedValue(ValueWhen( pS.-1)).colorBrightGreen.ref(hhv(H.0)) (Go Top) Historical Volatility Daily With MetaStock™ for Windows. 2 )). bearishbreakout=x>endt AND x<last+d AND Cross(trendlineS. s11.bS = endS.100) Plot this indicator in MetaStock for Windows.1.// INCREASE d TO EXTEND THE LINES bullishbreakout=x>endt1 AND x<last+d AND Cross(C.100). endR = SelectedValue(ValueWhen( pR.colorRed. 1 ) ). Historical Volatility Indicator Std(Log(C/Ref(C.64). x.-1)).trendlineR). Plot(C.10)/Std(Log(C/Ref(C. (Go Top) Hi Low Wave Daily if(H. 2 ))."Resistance". 1 ) == 0.<. s11.IIf (bearishbreakout.colorBlack)).-1.-1). endt1= SelectedValue(ValueWhen( pR. such as the following example: . endS = SelectedValue((ValueWhen( pS."Close".1).-1)).-1)).trendlineS. startR = SelectedValue( ValueWhen( pR.ref(llv(L. dtS =endt-startt. per. startt1=SelectedValue(ValueWhen( pR. you can easily plot the 10 and 100 day Historical Volatility.if(L.bR = endR. You now know the 10 period volatility is less than half the 100 period volatility anytime this indicator crosses below its horizontal line.-1).100)*Sqrt(365)*100 Next plot both indicators in the same inner window.1e10). 1)).s1=L.s11=H. choose the Merge with Scale on Right (or left) option. First use the Indicator Builder to enter the following Custom indicators: Historical Volatility 10 day Std(Log(C/Ref(C. aR = (endR-startR)/dtR."Support". If the Scaling Options dialog appears. Plot(IIf(x>=first -d AND x<=Last+d.colorBrightGreen.startt1). s1 .10)*Sqrt(365)*100 Historical Volatility 100 day Std(Log(C/Ref(C. aS = (endS-startS)/dtS.IIf(bullishbreakout.2)).//SUPPORT LINE pR = PeakBars( s11.1).2))). then click your mouse button on the indicator.colorRed. startS = SelectedValue(( ValueWhen( pS.>. endt=SelectedValue(ValueWhen( pS. I find it easier to see the Historical Volatility signals by combining the 10 and 100 day indicators into the following indicator. 1 ) == 0. s1.endt1). Add a horizontal line at . per.trendlineR.C). pS = TroughBars( s1.5 and then choose the OK button. d=10. dtR =endt1-startt1. trendlineS = aS * ( x -endt ) + bS.1) )). Mov(C. The system will sell when the close crosses below its 20 day moving average. You now know the 10 period volatility is less than half the 100 period volatility anytime this indicator crosses below its horizontal line.5 or lower within the last 10 days.5 or lower within the last 10 weeks.100)*Sqrt(365/7)*100 Next plot both indicators in the same inner window.E).10) This system will enter a long trade when the close has crossed above its 20 day moving average. you can easily plot the 10 and 100 week Historical Volatility.CLOSE) AND Alert(Fml("Historical Volatility Indicator")<=5. and when Historical Volatility Indicator was . On my (slowpoke) 200 Mhz PC at home.E)) AND Alert(FmI("Historical Volatility Indicator")<=5. First use the Indicator Builder to enter the following Custom indicators: Historical Volatility 10 week Std(Log(C/Ref(C. and when Historical Volatility Indicator was .-1)). Add a horizontal line at . this just provides a basic example of how to use this indicator in a system test.20.20.10) This system will enter a long trade when the close has crossed above its 20 week moving average.-l)).10)/Std(Log(C/Ref(C.20.10) Enter Short: Cross(Mov(C.5 or lower within the last 10 weeks. (Go Top) Historical Volatility Weekly With MetaStock™ for Windows. I find it easier to see the Historical Volatility signals by combining the 10 and 100 week indicators into the following indicator. it took about 1 to 2 minutes to calculate the formula on a single stock. Improved Chandeleir Exit A few weeks ago when the Chandelier Exit was posted to on our board board.CLOSE) AND Alert(Fml("Historical Volatility Indicator")<=5.-1)). To test trading systems using this indicator it would he helpful to use the alert function along with a trend following indicator.5 or lower within the last 10 days. Use any indicator you would like.5 and then choose the OK button. choose the Merge with Scale on Right (or left) option. Use any indicator you would like. and when Historical Volatility Indicator was .100) Plot this indicator in MetaStock for Windows.E). I asked if there was a faster version of it. such as the following example: Enter Long: Cross(CLOSE.20. Choose Historical Volatility Indicator Properties and then choose the Horizontal Lines page.-1)).Mov(C. .10) Enter Short: Cross(Mov(C. If the Scaling Options dialog appears.E)) AND Alert(Fml("Historical Volatility Indicator")<=5. The system will sell when the close crosses below its 20 week moving average. this just provides a basic example of how to use this indicator in a system test. Historical Volatility Indicator Std(Log(C/Ref(C. and when Historical Volatility Indicator was .10)*Sqrt(365/7)*100 Historical Volatility 100 week Std(Log(C/Ref(C. then click your mouse button on the indicator.Enter Long: Cross(CLOSE. ENTRY PRICE AND NO TRADE BEING 0} {Move PREV into a variable to speed things up . here is how the code (at least this iteration) should be modified to speed up the calculation by a factor of 5. -vPREV. {DEFINE ENTRY PRICE. LSS. Last night. I tested it with the sample Entry Rule and receive the same results in 1/5th the time. we move PREV into a variable vPREV prior to using it (so that it is only calculate once) in the long and short exits.5)-Ref(O. Y:=C-LLV(L. {Trade entered today?} If(LongEntry. CLOSE. If(LOW <= HighestSince(1. Stopped today?} If(LOW <= vPREV .-1)-Ref(L.Anyway.5). LSS:=100*(X+Y)/(HHV(H.-1))/(Ref(H.5))*2. HIGH) . Basically. . -vPREV. WITH EXIT BEING -. 0).3 * ATR(10). BSN:=2*X-H.-3). I'm sure everyone knows where I'm going with this by now.vPREV=0.vPREV=0.5 * ATR(10).5)-LLV(L.-5).-1)) LLS Pivot Breakout Buy Number X:=(H+L+C)/3.-1)-Ref(L. LSS:=100*(X+Y)/(HHV(H.5)-LLV(L.MoneyMgmtStop. BBN:=2*X-L.-5). -vPREV. Diff:=LSS-Ref(LSS. Just modify the SHORT exit in the same way. vPREV)))). CLOSE) .2.5)-Ref(O. EntryPrice:= If(vPREV <= 0. it struck me that the original Chandelier Exit (see below) had a whole bunch of PREV statements in it. Anyway. BBN. Hope this helps everyone using it. BSN.5). If(LOW <= HighestSince(1. upon reading about the 25X25 system on this site . Y:=C-LLV(L. (Go Top) Instantaneous Trendline & Sinewave Indicator as described by John Ehlers Here are a few formula's that I picked up from a mailing from George Angell LSS 5 day Osc X:=HHV(H. I did not hear of any feasible solutions.5))*2. Here is the code for the long exit. {Trade entered before today. LLS 5 DAY Osc Diff from 3 day osc X:=HHV(H. LLS Strength Index(1 day) 100*(Ref(C.DB 2/17/00} vPREV:=PREV. Diff. 1a").0) + If(Sum(value. 4.DTA file from the temp file it was downloaded to. 2. 3.6)>=360 AND Sum(value.5)<360 .11.13)>=360 AND Sum(value.10)>=360 AND Sum(value. Name: H cycle count 1a value:= Fml("Hilbert cycle period .8.0) + If(Sum(value.12.(Go Top) Instantaneous Trendline and Sinewave Indicator by John Ehlers Here is the MetaStock 6.0) + If(Sum(value. so you may wish to prevent the others from being displayed in the Indicator QuickList by unchecking the “Display In QuickList” option when creating the formula. 1. To implement them the following formulas must be created in MetaStock’s Indicator Builder.13)<360 . Only the last two formulas are plotted.0) + If(Sum(value.13.52 or higher formula code for the Instantaneous Trendline and Sinewave Indicator as described by John Ehlers in his article “At Last! A Trend-Friendly Oscillator”.14.9)>=360 AND Sum(value.12)<360 . Run MetaStock.7)<360 .6)<360 .11)>=360 AND Sum(value.DTA Use the following instructions to Import the MS65FORM.10)<360 . Each formula must be created separately and must be named exactly as it appears below.8)>=360 AND Sum(value.0) + If(Sum(value.7)>=360 AND Sum(value.15)>=360 AND Sum(value.0) .8)<360 . Follow the on-screen instructions.DTA file into a temp folder To Download the file for this formula click MS65FORM. To download and install the formulas use the following steps Download the MS65FORM.14)>=360 AND Sum(value.9.11)<360 .0) + If(Sum(value.15.0) + If(Sum(value.7. Click the Organize button to launch the Formula Organizer Wizard.10. Choose Indicator Builder from the Tools menu.9)<360 .6.14)<360 .0) + If(Sum(value.0) + If(Sum(value.12)>=360 AND Sum(value. If(Sum(value. 1a").26.17)<360 .25)<360 .0) + If(Sum(value.18.0) + If(Sum(value.16.32)>=360 AND Sum(value. If(Sum(value.24.20.22)<360 .35.0) + If(Sum(value.17)>=360 AND Sum(value.23)>=360 AND Sum(value.0) + If(Sum(value.21)<360 .19)<360 .28)<360 .0) + If(Sum(value.34)<360 .0) + If(Sum(value.31)>=360 AND Sum(value.21.27.33)<360 . If(Sum(value.0) Name: H cycle count 3a value:= Fml("Hilbert cycle period .0) + If(Sum(value.27)>=360 AND Sum(value.29)>=360 AND Sum(value.32)<360 .0) + If(Sum(value.20)>=360 AND Sum(value.25.34.29)<360 .25)>=360 AND Sum(value.22)>=360 AND Sum(value.18)>=360 AND Sum(value.0) + If(Sum(value.1a").16)<360 .23)<360 .0) + If(Sum(value.30)>=360 AND Sum(value.30)<360 .30.21)>=360 AND Sum(value.22.31.15)<360 .29.0) .19)>=360 AND Sum(value.0) + If(Sum(value.32.0) + If(Sum(value.28)>=360 AND Sum(value.19.27)<360 .34)>=360 AND Sum(value.33)>=360 AND Sum(value.26)<360 .16)>=360 AND Sum(value.20)<360 .33.0) + If(Sum(value.0) + If(Sum(value.17.0) + If(Sum(value.0) + If(Sum(value.18)<360 .28.23.35)>=360 AND Sum(value.26)>=360 AND Sum(value.24)>=360 AND Sum(value.Name: H cycle count 2a value:= Fml("Hilbert cycle period .0) + If(Sum(value.31)<360 .0) + If(Sum(value.24)<360 . If(pd>15. Cos(360*(11/pd))*Ref(pr. 0)+ If(pd>18. Cos(360*(16/pd))*Ref(pr.-6). 0)+ If(pd>8.-17).-4))+ (Cos(360*(5/pd))*Ref(pr.-13). 0)+ If(pd>11.-1))+ (Cos(360*(2/pd))*Ref(pr.-11). Cos(360*(13/pd))*Ref(pr. 0)+ If(pd>14. 0)+ . Cos(360*(14/pd))*Ref(pr. 0)+ If(pd>12.-15). 0)+ If(pd>17.-16). Cos(360*(12/pd))*Ref(pr. pr:=(H+L)/2. 0) Name: H ip sum 2 pd:=Int(Fml("Hilbert cycle period .-5))+ If(pd>6.-9).-10).final-a")). Cos(360*(6/pd))*Ref(pr.Name: H ip sum 1 pd:=Int(Fml("Hilbert cycle period . 0)+ If(pd>16.-3))+ (Cos(360*(4/pd))*Ref(pr.final-a")). Cos(360*(10/pd))*Ref(pr. (Cos(0)*pr)+ (Cos(360*(1/pd))*Ref(pr.-8).-7). 0)+ If(pd>19. Cos(360*(18/pd))*Ref(pr.-2))+ (Cos(360*(3/pd))*Ref(pr. Cos(360*(9/pd))*Ref(pr. Cos(360*(8/pd))*Ref(pr.-18). pr:=(H+L)/2. Cos(360*(7/pd))*Ref(pr. Cos(360*(19/pd))*Ref(pr. 0)+ If(pd>10. 0)+ If(pd>13.-19). 0)+ If(pd>9. 0)+ If(pd>7. Cos(360*(15/pd))*Ref(pr.-14).-12). Cos(360*(17/pd))*Ref(pr. 0)+ If(pd>27. Cos(360*(27/pd))*Ref(pr.-32).-23). 0) Name: H ip sum 3 pd:=Int(Fml("Hilbert cycle period . Cos(360*(21/pd))*Ref(pr.-3))+ .If(pd>20. 0)+ If(pd>21. 0)+ If(pd>26.-26). Cos(360*(32/pd))*Ref(pr.-1))+ (Sin(360*(2/pd))*Ref(pr. Cos(360*(25/pd))*Ref(pr.-21). 0)+ If(pd>24. 0)+ If(pd>32. (Sin(0)*pr)+ (Sin(360*(1/pd))*Ref(pr.-33). pr:=(H+L)/2. Cos(360*(33/pd))*Ref(pr. 0)+ If(pd>33.-29).-20).final-a")). pr:=(H+L)/2. Cos(360*(34/pd))*Ref(pr. 0)+ If(pd>34.-22).-28). 0)+ If(pd>29. 0)+ If(pd>28.-2))+ (Sin(360*(3/pd))*Ref(pr.-34). Cos(360*(29/pd))*Ref(pr.-30). Cos(360*(30/pd))*Ref(pr.final-a")). Cos(360*(20/pd))*Ref(pr.-25). 0)+ If(pd>31. 0) Name: H rp sum 1 pd:=Int(Fml("Hilbert cycle period .-27). Cos(360*(28/pd))*Ref(pr. Cos(360*(26/pd))*Ref(pr. 0)+ If(pd>22.-31). 0)+ If(pd>23.-24). Cos(360*(31/pd))*Ref(pr. Cos(360*(23/pd))*Ref(pr. 0)+ If(pd>30. Cos(360*(22/pd))*Ref(pr. If(pd>25. Cos(360*(24/pd))*Ref(pr. 0)+ If(pd>8.-11).-15). 0)+ If(pd>21. Sin(360*(10/pd))*Ref(pr. Sin(360*(16/pd))*Ref(pr.-16). 0)+ If(pd>20. Sin(360*(19/pd))*Ref(pr.final-a")). Sin(360*(8/pd))*Ref(pr. 0) Name: H rp sum 3 . Sin(360*(11/pd))*Ref(pr.(Sin(360*(4/pd))*Ref(pr. Sin(360*(7/pd))*Ref(pr.-9). Sin(360*(13/pd))*Ref(pr.-6).-7). Sin(360*(17/pd))*Ref(pr. Sin(360*(23/pd))*Ref(pr. 0)+ If(pd>23.-18).-19). Sin(360*(6/pd))*Ref(pr. 0)+ If(pd>11.-14).-22). Sin(360*(21/pd))*Ref(pr. Sin(360*(12/pd))*Ref(pr. Sin(360*(14/pd))*Ref(pr.-23).-20). Sin(360*(22/pd))*Ref(pr. Sin(360*(18/pd))*Ref(pr. 0)+ If(pd>9. Sin(360*(9/pd))*Ref(pr. 0)+ If(pd>16.-12). 0)+ If(pd>7.-13). Sin(360*(15/pd))*Ref(pr. If(pd>15. 0)+ If(pd>17. Sin(360*(20/pd))*Ref(pr.-5))+ If(pd>6. 0)+ If(pd>19. 0)+ If(pd>13. 0)+ If(pd>18. 0)+ If(pd>22.-21).-10).-17).-8). 0)+ If(pd>24. 0)+ If(pd>10.-4))+ (Sin(360*(5/pd))*Ref(pr. 0) Name: H rp sum 2 pd:=Int(Fml("Hilbert cycle period . 0)+ If(pd>14.-24). Sin(360*(24/pd))*Ref(pr. pr:=(H+L)/2. 0)+ If(pd>12. 15.-30). Sin(360*(32/pd))*Ref(pr. 0)+ If(pd>32.16. Sin(360*(27/pd))*Ref(pr.S).S).-28).14.0) + If(value=12. 0)+ If(pd>34. Mov((H+L)/2. 0) Name: H TL sum 1 value:=Int(Fml("Hilbert cycle period . Mov((H+L)/2.-25).-33). Sin(360*(26/pd))*Ref(pr.final-a")).S).-29).S).10.-26).13.S). If(value=6. If(pd>25. Sin(360*(28/pd))*Ref(pr. Mov((H+L)/2.0) + If(value=11. Mov((H+L)/2. Mov((H+L)/2.0) + If(value=15.S).final-a")). Mov((H+L)/2.17.12.-27).S).11. Sin(360*(25/pd))*Ref(pr.8. Mov((H+L)/2.0) Name: H TL sum 2 .0) + If(value=9.0) + If(value=8.S). 0)+ If(pd>30.0) + If(value=7.S).-32).0) + If(value=10. Mov((H+L)/2. pr:=(H+L)/2.pd:=Int(Fml("Hilbert cycle period . 0)+ If(pd>29. Sin(360*(31/pd))*Ref(pr. 0)+ If(pd>31. 0)+ If(pd>27. 0)+ If(pd>28.0) + If(value=13.-34). Mov((H+L)/2.0) + If(value=14.9. Mov((H+L)/2. Sin(360*(34/pd))*Ref(pr. 0)+ If(pd>26. Sin(360*(30/pd))*Ref(pr. 0)+ If(pd>33. Sin(360*(33/pd))*Ref(pr.S). Sin(360*(29/pd))*Ref(pr.-31). 21. Mov((H+L)/2.23.0) + If(value=18.S). Mov((H+L)/2.19. If(value=16.S). Mov((H+L)/2.28.S).20.-6). Mov((H+L)/2.0) + If(value=27. Mov((H+L)/2.0) + If(value=29.0) + If(value=24.0) + If(value=31. Mov((H+L)/2. Mov((H+L)/2.22.34.S).18.31.0) + If(value=25.0) + If(value=22.S).36. Mov((H+L)/2.0) + If(value=28.0) + If(value=32.0) Name: Hilbert cycle period .final-a")).final-a")).33.30.S).0) + If(value=30.27.0) + If(value=20.0) + If(value=34.26. Mov((H+L)/2.Ref(((H+L)/2).S).S). Mov((H+L)/2.24. Mov((H+L)/2. Mov((H+L)/2.value:=Int(Fml("Hilbert cycle period . Mov((H+L)/2.0) + If(value=23.0) + If(value=35. Mov((H+L)/2.25.S).S).S).1a value1:=((H+L)/2) .0) + If(value=21.37. Mov((H+L)/2.35. Mov((H+L)/2.S). .32.0) Name: H TL sum 3 value:=Int(Fml("Hilbert cycle period . Mov((H+L)/2.S).S).29.S).0) + If(value=33.S).S).0) + If(value=17.S).0) + If(value=19. Mov((H+L)/2. If(value=26.S). Mov((H+L)/2.S). Mov((H+L)/2. value2:= Ref(value1. If(inphase>0 AND quad<0.4)). (Fml("H TL sum 1") + Fml("H TL sum 2") + Fml("H TL sum 3")).8 * PREV). 180-p1.5*(pr-Ref(pr. c2:=If(c1=0.-1)<90 AND phase>270.33 * value2 + (0.-6)) + 0. 360-p1.-3)))) + (0.-1)phase.67 * PREV).67*PREV) .p1))).75*(value1-Ref(value1. phase:=If(inphase<0 AND quad>0. inphase:= 0. If(dp > 60. dp)). value3:=0.-1)-phase). quad:= 0.Ref(phase. p1:=Atan(Abs(quad+Ref(quad. dp:=If(Ref(phase. 180+p1. dp2 Name: Hilbert cycle period .Abs(inphase+Ref(inphase.25*c2) + (0.final-a c1:= Fml( "H cycle count 1a") + Fml( "H cycle count 2a") + Fml( "H cycle count 3a") . 360+Ref(phase. dp2:=If(dp < 1.-2)-Ref(value1.75*PREV) Name: Instantaneous Trend Line pr:=(H+L)/2.-1))).c1).33*(pr + (0.2 * value3 + ( 0. 1.25*(Ref(value1.PREV. 60. If(inphase<0 AND quad<0. (0.-1)). 0.-3). dc3:=If(ip<0.Fml( "BOLInSLB" ) ) / ( Fml( "BOLInSUB" ) . dcp:=If(dc3>315. Sin(dcp+45) (Go Top) INSYNC Index The formula from Equis: Insync Index (rev. ip:=Fml( "H ip sum 1") + Fml( "H ip sum 2") + Fml( "H ip sum 3").20 ) ) BOLInS2 ( C . dc2:=If(pd<30 AND cp>0. in Technical Analysis of Stocks & Commodities Jan 1995.S ) + 2 * ( Std( C . dc1:=If(Abs(ip)>0. 90*If(rp>=0. Atan(rp/ip. Insync Index to run properly.1. 01/06/97) The interpretation for the following formulas came from the article "The Insync Index".818/cp .1).0.Name: Sinewave Indicator pd:=Int(Fml("Hilbert cycle period .final-a")). dc3-360.20 ) ) BOLInSUB Mov( C .227)*360). dc2+270.Fml( "BOLInSLB" ) ) BOLInSLL . They are listed in the order in which they should be copied and pasted into the MetaStock Formula Builder BOLInSLB Mov( C .dc1+((6. by Norm North.dc1).20 . dc2+90). rp:=Fml( "H rp sum 1") + Fml( "H rp sum 2") + Fml( "H rp sum 3").S ) .-1)).20 .final-a"). All of these formulas are necessary for the last one. dc3).001. cp:=Fml("Hilbert cycle period .2 * ( Std( C . Sin(dcp). 0 ) .0 ) RSIInS If( RSI(14 ) .0 .< .10 .10 .80 .-5 .10 .10 .If( Mov( DPO ( 18 ) .0 ) MFIInS If( MFI( 20 ) .> .0 .> .20 .> .20 .-5 .S ) .-5 ..< .3 ) .0 .> .> .10 .> .10 . If( MFI( 20 ) .> .10 .0 ) .If( Mov( ROC( C .> .0 .80 .< .Mov( ROC( C .0 .> .0 .> .If( Fml( "BOLInS2" ) .5 .0 ) MACDInSS If( Fml( "MACDInS2" ) .5 .Mov( EMV(10 .0 ) .> .> .If( Mov( MACD( ) .10 .0 ) PDOInSS If( Fml( "PDOInS2" ) .0 ) ) PDOInS2 DPO( 18 ) .0 ) ) EMVInS2 EMV(10 .< .S ) .-5 .0 .$ ) .0 .S ) .80 .S ) .> .Mov( MACD( ) .10 .-100 .70 .0 .If( Stoch(14 .30 .0 ) MACDInS2 MACD( ) .5 .$ ) .0 .0 ) ) STO%dInS If( Stoch(14 .0 ) EMVInSS If( Fml( "EMVInS2" ) .05 .< .1 ) .$ ) .< .< .0 .S) .If( Mov( EMV(10 .If( Stoch(14 .0 ) ROCInSS Index If( Fml( "ROCInS2" ) .S ) PDOInSB If( Fml( "PDOInS2" ) .-5 .-5 .S ) .0 ) ) CCIInS If( CCI(14 ) .10 .0 ) ) STO%kInS If( Stoch(14 .S ) .0 .10 .> .Mov( DPO( 18 ) .< .If ( CCI(14 ) .0 .0 ) ROCInS2 ROC( C .100 .0 .10 . S) .If( Mov( DPO( 18 ) .-5 .S ) ROCInSB If( Fml( "ROCInS2" ) .5 .S) .If( RSI(14 ).5 .5 .10 .S ) .0 ) .< . .$ ) .-5 .1) .< .0 ) .0 ) .< .If( Mov( MACD( ) .If( Mov( ROC( C .5 .0 ) ) InSync Index .0 ) .10 .5 .0 .S ) MACDinSB If( Fml( "MACDInS2" ) .If( Fml( "BOLInS2" ) .5 .-5 .If( Mov( EMV(10 .10 .20 .0 .-5 .< .S ) EMVInSB If( Fml( "EMVInS2" ) .5 .S) .95 .0 ) .S ) .10 .3 ) . < .< . 2. • The resultant plot is the Investor Preference Index.%).-10 ) + Ref (Fml( "PDOInSB" ) .05)+(Stoch(89.16)+(S toch(
[email protected])*.-10 ) + Fml( "MACDInS S" ) + Fml( "MACDInSB" ) These formulas were provided by Barry Millman.26)+ (Stoch(34. • Open a chart of the New York Stock Exchange index. The article was written by Cyril V.13)*. Smith Jr.8)*.43)+(Stoch(55.15.54)+1)*100 System test: Enter Long C=HHV(C. blue chips versus mid-cap. compares the performance of the S&P 500 to the New York Stock Exchange index to measure sentiment. follow these instructions. When complete.24.24. All questions should be addressed to him at 73374. if you save this as a chart. Mr. during phases of a bull market. page 19.3)*.8)*.50 + Fml( "CCIInS" ) + Fml( "BOLInSLL" ) + Fml( "RSIInS" ) + Fml( "STO %kInS " ) + Fml( "STO%dInS" ) + Fml( "MFIInS" ) + Fml( "EMVInSB" ) + Fml( "EMVInSS" )+ Fml( "ROCInSS" ) + Fml( "ROCInSB" ) + Ref (Fml( "PDOInSS" ) . • Drop the indicator listed below on the plot of the S&P 500.13)*. Please note that the final formula `InSync Index' requires all of the previous formulas to be correct.3)*.5)*.S).05)+(Stoch(89. you will simply need to load the chart and it will recalculate using the newest data." To plot this in MetaStock for Windows.04) Jack Landis' Weighted Stochastic (shortened to Landis) ((Stoch(8.S)Mov(ROC(Log(C).26) Close Long Fml("Investor Preference Index")<97.term stock market investment tool. Millman wrote these formulas using many Custom Formula slots for clarity and ease of understanding. The theory is that investors have a preference for certain types of investments.5)*. • Drag the S&P 500 price plot into the NYSE chart.10)).26)+ (Stoch(34.16 )+(Stoch(21. a long . "This indicator.21)*.24.$)<=(.24.6 AND ROC(Fml("Investor Preference Index").38.15.com.10)) Landis 3 week s m a mov(((Stoch(8.%)ROC(Log(P). (Go Top) Investor Preference Index This indicator was discussed in the December 1997 Technical Analysis of Stocks & Commodities magazine.43)+(Stoch(55. The plot will turn a different color when you are pointing at it.%).s) landis multiple time periods . Formula: Investor Preference Index: (Sum(Mov(ROC(Log(C). • Open a chart of the S&P 500.%)-ROC(Log(P). 5)*.13)*.S) AND C<Mov(C.S) AND Ref(C.3)*.15.s).2.50. 8)*.5)*.-1)<=((Ref(H.2)-.16 )+(Stoch(21.10.5)*.05)+(Stoch(89.21)*.s).25 D:{Entry}HHV(H.21)*.50.13)*.s) multiple slopes of landis formula #1 slope(mov(((Stoch(8.2)+.26)+ (Stoch(34.-1)-Ref(L.2) (Go Top) Jeff Cooper 180's Buy A:Close B:{MA}Ref(C.13)*.125+1 (Go Top) Jeff Cooper Lizards Buy A:close B:{Signal}O>H-(H-L)*.50.-1) AND C>=H-(H-L)*.5.125 E:{Stop}HHV(H.26)+ (Stoch(34.16 )+(Stoch(21.S) AND C>Mov(c.3)*.13)*.s) formula #3 mov(((Stoch(8.3)*.26)+ (Stoch(34.2)-.26)+ (Stoch(34.43)+(Stoch(55.s) formula #4 mov(((Stoch(8.S) C:{Breakout}Ref(C.10.-1))*.10)).5.26)+ (Stoch(34.05)+(Stoch(89.43)+(Stoch(55.43)+(Stoch(55.2) formula #3 slope(mov(((Stoch(8.05)+(Stoch(89.8)*.8)*.-1)<Mov(C.05)+(Stoch(89.10)).10.-1)<Mov(C.-1)>=((Ref(H.05)+(Stoch(89.2) formula #2 slope(mov(((Stoch(8.-1)-Ref(L.21)*.S) C:{Breakout}Ref(C.21)*.10. 8)*.25)+Ref(H.3)*.5)*.3)*.43)+(Stoch(55.25)+Ref(L.-1)>Mov(C.S) AND C<Mov(c.8)*.10)).-1)>Mov(C.16 )+(Stoch(21.43)+(Stoch(55.5)*.2)+.s).S) AND C>Mov(C.s) formula #2 mov(((Stoch(8.10.16)+(Stoch(21.5)*.5)*. 8)*.-1) AND C<=L+((H-L)*.25) D:{Entry}LLV(L.16)+(Stoch(21.10.formula #1 mov(((Stoch(8.21)*.125 E:{Stop}LLV(L.15.25 AND C>H-(H-L)*.3)*.05)+(Stoch(89.10)).13)*.13)*.13)*.10)).16)+(Stoch(21.-1))*.43)+(Stoch(55.05)+(Stoch(89.10)).21)*.125-1 (Go Top) Jeff Cooper 180's Sell A:Close B:{MA}Ref(C.16 )+(Stoch(21.26)+ (Stoch(34.8)*.21)*.43)+(Stoch(55.10)).26)+ (Stoch(34.50.S) AND Ref(C.25 AND .3)*. 125 D:{Stop}L-1.S) AND C<Mov(C.25 AND C<L+(H-L)*.-1) and Ref(L.125.S) AND O>Ref(C.O.-1)-.3)+.125 F:{stop}LLV(L.-1)-.-1) (Go Top) Jeff Cooper Slingshots Buy A:Close B:{Range breakout}Ref(H.40).125 D:{Stop}Ref(C.125.-1)-.25 C:{Entry}Ref(C.125 (Go Top) Jeff Cooper Slingshots Sell A:Close B:{Range breakout}Ref(L.-1)>=Ref(HHV(H.25 AND C>H-(H-L)*.-1)-.S) AND O>Ref(C.-1)+.125 Filter:O>H-(H-L)*.-1)>=Ref(HHV(H.-1)+.10).40).-1)-.L<Ref(LLV(L.125+1 Filter:C<Mov(C.-1)<=Ref(LLV(L.0) Filter:Ref(L.125 C:{entry}If(O<Ref(L.50.O.25 A:Close B:ADX(14){The higher the better} C: PDI(14)>MDI(14) D:If(L<Ref(L.3) Filter:ColB>30 and ColC and ColD=1 .-1) AND H>Ref(H.-1) AND H>Ref(H.0) Filter:Ref(H.0) E:{Entry}HHV(H.O.-2)<Ref(L.Ref(O.1.25 AND L<Ref(LLV(L.10).125 (Go Top) Jeff Cooper Whoops Sell A:close B:C<Mov(C.0) D:{Stop}If(If(O<Ref(L.-1)+.10).-1)+2.S) AND C<Mov(C.40).-1)+.25 AND H>Ref(HHV(H.-1)-2.O.125 D:{Stop}H+1.-1)+.-1) AND L<Ref(L.-1) AND L<Ref(L.-1) C:{entry}H+.125.Ref(O.0).-3).40).125 C:{entry}If(O>Ref(H.0)=O.-1)+.10.25 AND H>Ref(HHV(H.0) D:{Stop}If(If(O>Ref(H.10).25 AND C<L+(H-L)*.-1) (Go Top) Jeff Cooper Lizards Sell A:close B:{Signal}O<L+(H-L)*.-1)-.50.-2) and Ref(L.125.-1)<=Ref(LLV(L.-1) C:{entry}L-.125 Filter:O<L+(H-L)*.-1)<Ref(L.10. -1). MFI(23))AND MFI(23)>50 closeShort: MFI(23)=HHV(MFI(23).8*HHV(C. (The third test is to eliminate past false breakouts. Can any body help to form an exploration to find stocks for whom this system will work best ? EnterLong: Cross(MFI(23). It is a developing system and will like input from other readers to improve it> Thanks for any suggestions to improve it.opt1).-1) AND Ref(C.20) Mov(CLOSE.BBHistogram) .<=. 20 Step: 1 enterShort: Cross( (HHV(MFI(23).-1) AND H = x AND y > 0 AND y > Ref(y.13.W) AND V*C > 250000 (Go Top) John Hunt's Exploration for Metastock Place in FILTER section of Exploration.3. 5 Max.60).0.23) .25.20. 5 Max. when today's close < 80% of highest value of all closes for past year. and finally.23) ShortOptimisationFullDetails: OPT 1 = Min. when highest value of 3 day moving average of yesterday's (close .} When(C-Mov(C.260)) {This means: when today's (close .moving average) over past 19 days <= 0.-1) < Ref(x.<=. y:=MACD().25.0) AND When(HHV(Mov(Ref(C-Mov(C.25.19).)} KA Money Flow System by Karim Anwar This system is based on Money Flow Index . {Col A } CLOSE {Col B} V {Filter} x:=HHV(H.0) AND When(Ref(C-Mov(C.34.moving average) <= 0.0) AND When(C.23) + opt1)) AND MFI(23)<50 closeLong: MFI(23)=LLV(MFI(23).SIMPLE)) / (4*(Std(CLOSE.S). Cross(0.-1) AND C > Mov(C.S). It tries to buy when MFI is starting to rally from an oversold state and sells short when MFI starts falling from overbought state.<. No other information need be entered in the Exploration columns. (LLV(MFI(23).moving average) > 0.23) longOptimisationFullDetails: OPT 1 = Min.W) AND C > Mov(C. when yesterday's (close .S).(Go Top) Jim's Uptrender As the name implies this metastock exploration finds stocks with a recent uptrend.S).-1).20))) * 100.>. 20 Step: 1 (Go Top) Karnish Bollinger Band Histogram Trading System {EnterLong and Close Short} BBHistogram:= (CLOSE + 2*Std(CLOSE. C > Ref(x. If(Cum(1) <= Period. the Fast Kurtosis(FK).S) The Kurtosis is constructed from three different parts. PREV + sc*(CLOSE .S))/(4*(Std(C.1.S). .. because it's simply the average of the last three bars High (stop for short position or long entry) or Low (stop for long position or short entry) plotted one period forward: Ref(Mov(L.20) Mov(CLOSE. I believe this approach has recorded 11 straight S&P winners. Add to positions when the BB Histo leaves "above 100" or "below zero" and then "repenetrates" the trigger levels. sc := Abs(RSI(Period)/100 .20).-1).20)))*100) Sell the opening days after the BB Histogram penetrates 100 and buy when it penetrates zero. BB Histogram: ((C+2*Std(C.20. Right! My only disclaimer is that I guarantee that I will sell software. charting services and anything else that I can think of to make a "buck" in 2000. and the Fast/Slow Kurtosis(FSK).3.10000.3. And most of all.E).-1) or Ref(Mov(H. Seek the answers from "within" (with some shortcutting help from people that are willing to share). suck all the free stuff from me you can copy. please note. by Perry J. The Kurtosis. In the meantime. Third Edition. Kaufman.20))) * 100.20. The MetaStock formula for the Kurtosis is as follows: Mov(Mov(Mo(3)-Ref(Mo(3).5)*2.{Enter Short and Close Long} BBHistogram:= (CLOSE + 2*Std(CLOSE.PREV)) (Go Top) Krausz's Gann Swing HiLow Activator I was only able to implement Krausz's Gann Swing HiLow Activator in Metastock. Cross(BBHistogram. (Go Top) Kauffman's Adaptive RSI MetaStock formula derived from calculations in Trading Systems and Methods. this system must not be working any more because it is losing the last trade you put on". Period := Input("Period". This formula adapts the standard RSI to a smoothing constant.SIMPLE)) / (4*(Std(CLOSE.S). with 700+ points. "But Steve.3.100) Here's a "freebie". the biggest antagonists on the list provide absolutely "zero" when it comes to helping you trade. CLOSE.66.-1) (Go Top) Kurtosis Indicator The Kurtosis is a market sentiment indicator.20)-Mov(C. E).nio. rh:=ROC(O.66. a BUY or a COVER SHORT Signal would occur when C > Upper Keltner Band and a SELL or a SELL SHORT Signal would occur when C < Lower Keltner Band ** Thus.10. a 50 period FK and a 10 period FSK.-1.nio+2.S) . by Chester W. rl:=ROC(O.-1).10.S) + MOV((H-L).The Kurtosis(K) portion of this calculation is mo(3)-ref(mo(3). The syntax for the formulas in MetaStock are: Formula #1 Name: The 10-Day Moving Average Formula: MOV( (H+L+C)/3. The Fast/Slow Kurtosis(FSK) is the complete formula mov(mov(mo(3)ref(mo(3).%)/(nio+2).-1). to calculate a 4 period Kurtosis. For example. . 10.10. rhh:=ROC(O.S) (Go Top) Keltner Channels Keltner Channels are explained in the book The New Commodity Trading System and Methods by Perry Kaufman and were first introduced in the book How To Make Money in Commodities. In the System Tester.E) mov(mo(3)-ref(mo(3). use the following formula: mov(mov(mo(4)-ref(mo(4). Which is today's Kurtosis . Which is the FK smoothed with 3 period simple moving average.50.E).S) Formula #3 Name: Lower Keltner Band Formula: MOV((H+L+C)/3.E). Keltner. the system is always either long or short.-1). For interpretation refer to either of the two books listed above.10.10.yesterday's Kurtosis. The four ROCs _per day_ used for interpolation are:} rll:=ROC(O. Which is the Kurtosis smoothed with a 66 period exponential moving average.MOV((H-L). The Fast Kurtosis(FK) is mov(K.S) ** All three formulas must be plotted.3.S). **You may want to experiment with different time periods to optimize the results.%)/(nio+1).nio+1.66. (Go Top) Linear Regression Slope {The basic "programming" in MetaStock of the LRS-ROC indicator is like this: NIO is the _basic_ number of points taken to calculate the ROCs.66. Simple ) Formula #2 Name: Upper Keltner Band Formula: MOV((H+L+C)/3.%)/nio.%)/(nio-1).nio-1. 57) as input to be splitted into NIO and XIO and to be used in the formulas above. the LRS-ROC indicator is calculated for. i. To be clear: This LRS-ROC indicator triggers _only the timing_ for entering/closing a position. NIO.nio). using the basic number of points. {Then the LinearRegressionSlope is taken _twice_ (for numerical reasons) from the interpolated ROC. interpolation is done at a point XIO (0<=xio<=1). 1. it's to take data from a MetaStock file and use it to update an Excel file. But probably this TA system may also be used as a "stand-alone" system. i. Here I am using a single daily closing price as object. between the points NIO and NIO+1. 0001)+1/(1-xio)+1/(2-xio)).0001)+rh/(1-xio)+rhh/(2-xio))/(1/(1+xio)+1/(xio+. To create a Close Only Template : • Start the Win95-Explorer and create a new folder named OLE(which folder will hold your Template and Charts used for this OLE) below your working folder(that is holding your metastock files dat/dop/master/emaster etc.) • Then switch back to MetaStock • Open the by you desired security using Smart Charts as type • Delete all other charts and all inner windows and all indicators that are open in the current screen(=layout) except for the base securities' Price indicator . and both are subjected to some "optimization" in accordance to the historical prices.{Now. e. for a simplified use of the Win 95's OLE program. because of the restrictions in MetaStock. Unfortunately. Additional (also ROC-based) criterions are used to stay out/in during extreme bearish/bullish situations.g.e. (Go Top) Linking Metastock Updates to Excel Files As I understand your desire. The way to have this update-process automatically done requires for you to have an OLE-link capable object (chart or indicator) to be present. 4. MetaStock is not able to use _one_ real number (e. Additionally: This "TA" is only one basic element of my option trading system..57 days. named RO here:} ro:=LinRegSlope(LinRegSlope(rit. In MetaStock this can be easy established by creating separate Charts for each security. using an appropriate criterion.. So NIO and XIO have to be provided separately. That is where we get our LRS-ROC indicator.nio). using a simple interpolation formula weighting with the _distances_ of the four ROCs from the interpolation point XIO:} rit:=(rll/(1+xio)+rl/(xio+.e. First make a new indicator Close Only : • Start MetaStock and click the button for the Indicator Builder • In Indicator Builder create a custom indicator named "Close Only" (without the quotations) and in the formula field type CLOSE and click OK 2. Follow and execute these steps below.g. 4. {NIO+XIO together represent the _real_ (not integer!) number of points or days. primarily to catch some "special reality effects" that cannot be modeled by example-based know-how recycling from historical data.. the longer it will take to calculate and also the . the longer the column contents(displayed cells). drag down this first column(A) and release button until you have reached record row #999 and all of the selected cells will be colered black(Note that this selection made. Note here that the more history is stored in your 'original' Metastock files. and that the Link has been made • Close and Save As the Excel file to the OLE folder(with standard XLS as file type) with the security's name as the pointer name • Each time now. sticks) • Drag the newly created Close Only indicator down from the IBQuick List (from the small window in the middle at the top) and release it to have the newly created indicator displayed in its own inner-window • Now SAVE AS the current screen (with Template as the file type) using the CloseOnly name(without a space) as the Template's name("CloseOnly. To create the OLE link from Metastock to an Excel spreadsheet : • Start MetaStock (fresh again) and click Open • Open the required security in the newly created OLE-folder • Right-click to Select and click Copy to have the security's CloseOnly indicator copied to the Clipboard • Start Excel and check that the first cell at the top-left is been selected(=black line bordered rectangle) • Select the required cells by placing the mouse-pointer at the right corner of the selected rectangle and click and press down the Leftmouse button and whilst at the same time holding the mouse-button down. To create the separate Charts used for OLE : • Start MetaStock (fresh again) and click New|Chart or click Open • Click Apply Template (this action is always required prior to selecting a security) and scroll to the OLE folder to apply the newly created CloseOnly Template • On Opening of this New Chart the above mentioned Template's layout containing the Price and the Close Only indicators will be displayed • Now SAVE AS the current screen (with Chart as the file type) using the security's name as the Charts' pointer name("SecurityX. has to be done in one(1) straight firm move down the column. line. Within the Excel program's options (Tools|Options|Calculations or Edit|Link| Manual) you can pre-set this to "manual" as well. eg a one single selection has been made) • Now let the mouse-pointer float on this blackened selection and Right-click to choose Paste Special • In the Paste Special's Dialog Window click the Paste Link radiobutton and choose CSV as file-type • With plenty of system memory on board it will not take that long before the Special Linked data is calculated and displayed (as the cell's contents). eg the files the Chart uses as its base. that you Open this XLS-file again.mwc") to the newly created OLE-folder • Close Metastock 4.(the bar.mwt") • Close down MetaStock + Win95-Explorer 3. but then you will have to click Edit|Link|Update Now to update once the spreadsheet's above Linked cell selection entirely A. automatically the Excel program will have you prompted if you would to update the Link. eg using Excel's cell linking(referencing) and formula language(the tiny editor) capabilities and/or apply any of the other Excel program's features.100.more memory is being used. multiply this number by -1.x and Excel8. To reverse this OLE linkage back into MetaStock . Subtract the result of this by the value of a divided by volume 5 days ago.3.Lb). See MS-Help or MS-Manual or Equis' Customer|Support Website for more detailed instructions. Note here also that the above applies for MS6. so as to enable you to make calculations in Excel. You can also use it to compare its rate of change against that of the market. C. Call the result of this a. Finally.3)) (Go Top) LRS-ROC Indicator--another one Lb:=Input("Look-Back Periods?". prior to creating the Link. ROC( LinRegSlope(C. For the first.LLV(c. Metastock code for Lone Ranger: (( Fml( "Z Range" ) / V) . B. Note here too that you can then apply the special instructions (mailed in a previous mail to the List) to have the Linked cells' contents SPLIT UP over more cells in the spreadsheet(s). Then divide a by volume. In MS click Window|New Inner Window and then Right-click in this Inner Window and choose Paste Special|Paste Link (with CSV as file type). (Go Top) Lone Ranger This is the calculation: There are 2 calculations needed for this. do not forget to create an empty Inner Window first.3) . just take the highest value of the close in the past 3 days (including todays close) and take this away from the lowest value of the cose in the past 3 days. Simple Interpretation: This is a short term indicator which will show short term divergences against the market instrument.0(OfficePro97). Extreme lows or highs in the indicator may be a signal of similar instances in the market.Lb.$) (Go Top) LSS Oscillator & Pivot Point . however you would want to define a time period to make use of this function. so you will have to keep this 'history' as short as what can be possible for any fast results.-5)) * -1 Where Fml( "Z Range" ) = (HHV(c.13).Ref((Fml( "Z Range" ) / V). D. 5).-1)-Ref(L.-1)) LLS Pivot Breakout Buy Number X:=(H+L+C)/3. Y:=C-LLV(L. BBN. -1). LSS:=100*(X+Y)/(HHV(H. -1). 30). Diff:=LSS-Ref(LSS.5)-LLV(L. Z := 1+((X-Y)/X). BSN:=2*X-H.-5).Here are a few formula's that I picked up from a mailing from George Angell LSS 5 day Osc X:=HHV(H. -1). Y := Ref(X.5))*2. LowB := Ref(Fml("SellBreak"). LLS 5 DAY Osc Diff from 3 day osc X:=HHV(H. Y:=C-LLV(L.5))*2. LLS Strength Index(1 day) 100*(Ref(C. Min(Max(Prev*Z.-3). Diff. If(Cum(1)=1. LastValue(Fml("LookBack")/2+Prev-Prev)) Name: SellBreak Formula: LLV(L. LSS. LastValue(Fml("LookBack")/2+Prev-Prev)) Name: BreakWhere Formula: TopB := Ref(Fml("BuyBreak"). BBN:=2*X-L.LowB)*100/(TopB-LowB). ((O+H+L+C)/4 . -1) . Name: DBS-System Enter Long: H > Ref(Fml("BuyBreak").-1))/(Ref(H. -1) Close Short: H > Ref(Fml("SellExit"). 20. LastValue(Fml("LookBack")+Prev-Prev)) Name: SellExit Formula: HHV(H.-5). 20). (Go Top) LookBack Formula: X := Stdev(C.5).-1)-Ref(L.5)-Ref(O.5)-LLV(L. LSS:=100*(X+Y)/(HHV(H.5)-Ref(O. BSN. -1) Enter Short: L < Ref(Fml("SellBreak"). 60)) Name: BuyBreak Formula: HHV(H. LastValue(Fml("LookBack")+Prev-Prev)) Name: BuyExit Formula: LLV(L. -1) Close Long: L < Ref(Fml("BuyExit"). adjust:=LastValue(LastValue(Cum(1)) -Highest(If(end. x:=If(x=1.2.LinearReg(x.L. lastValLRS:=LastValue(Highest( If(end.31.2520. To delete all securities that have been non-trading since a user specified date. It is also the basic system used as the basis for Thomas Stridsman's year-long series of articles about system development and tweaking.-10000))).1800. (Go Top) Last Date Exploration This set of column formulae allows you to either scan the results of a previous MetaStock exploration or the whole market to view the last trading date of each code. multi:=Input("Channel Standard Deviations". LastValue(Cum(1))=Cum(1).2). pds:=Input("Linear Regression Trendline periods".6.H. EnYear:=Input("end Year". x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5 P=6".If(x=5. LR:=lastValLRI-lastValLRS*countback. end:=Year()>EnYear OR (Year()=EnYear AND (Month()>EnMnth OR Month()=EnMnth AND DayOfMonth()>=EnDay)).31). 0.2006).com } EnDay:=Input("end Day".end). { rem next line to extend plot to end of chart } countback:=Ref(Ref(countback.C))))). end:=end AND Alert(end=0. MetaStock Column Formula {Day} Column A: Dayofmonth() {Month} Column B: Month() {Year} Column C: Year() No filter is required for this formula.If(x=2. lastValLRI:=LastValue(Highest( If(end.pds).pds)))=0. end:=If(LastValue(Cum(Ref(end. Text in {} indicates the column name (not required) Download the Last Date Formula for use in your MetaStock software by clicking here.1.LinRegSlope(x.12.4). (Go Top) Linear Regression Trendline { Linear Regression Trendline Channel v2.12).100.2200.1.0))).0))).Cum(1).P.This is George Pruitt's ("Futures Truth") basic system.pds).1. EnMnth:=Input("end Month". . you will need to use a program such as StockDelete.2).adjust).O.If(x=6. countback:=LastValue(Cum(1))-Cum(1)-adjust.If(x=3.0 }{ ©Copyright 2004 Jose Silva }{
[email protected]).-adjust). E ).mp2 .40.E)Mov(C.E) .EXPONENTIAL)) * 100 • **Cross( MACD().mp2.377.13.40. keep the same Enter Long but change the Close Long to = Cross(Mov(C.-restrict).34).1.-1) • Mov(MACD(). Mov(C .13.E) MACD .1.mp1 .13). • CLOSE • MACD() • Ref(MACD().pds)*multi.34).E)) Now you can play with these combinations on both the enter long and close long side.89). (Mov(C.9.34).377.E) ) .Mov(C.13.1.1.EXPONENTIAL) • Ref(Mov(MACD(). mp2:=Input("Long MA".Signal Line mp1:=Input("Short MA".377.13). LRT:=Ref(Ref(LR.1.mp2.13).377.E ) MACD signal line mp1:=Input("Short MA".mp1 .mp3. Mov(MACD().5.E)) (Go Top) MACD Crossover Buy Signal Shows those stocks where an MACD crossover has been signalled. mp2:=Input("Long MA".1.E) > Mov(C.89). lwLR:=LRT-Stdev(LR.9. upLR:=LRT+Stdev(LR.EXPONENTIAL)) /Mov(MACD().Mov(C .pds)*multi.-1) • ((MACD() . Mov( (Mov(C .9.restrict).E)-Mov(C.The search returns 1 for Ok and 0 for not ok.E) Close Long: Cross(Mov(C.E) AND Mov(C.5.EXPONENTIAL)) (Go Top) MACD Crossover System test in MetaStock.9.mp1. mp2:=Input("Long MA". mp3:=Input("Signal MA".9.EXPONENTIAL).E ). upLR.Mov(C.5.mp1.mp2 .Mov(MACD().E )).1.LRT MACD Additions {These MetaStock MACD indicator formulas allow user input for parameters when run} mp1:=Input("Short MA".E).377.E))-(Mov((Mov(C.1.restrict:=adjust-(LastValue(Cum(1))-pds).E) > Mov(C.377.377.377.E)). an example of how to create Enter Long: Mov(C.mp3.lwLR. For example.Mov(C . mp3:=Input("Signal MA". 14 {Default} ). You may want to enter when the 5 crosses above the 13 and not wait for the 40 OR. YourTrig When creating the exploration just click the function button and look under the Custom Indicators heading for both of the above custom indicator functions.226-227 and 208-209 and 212). E ). MACD" ) > FML( "MACDcustom . YourTrig:=Mov( MACD().This will keep you in the trade longer. By referencing the Input() Function using the fml() CALL Function (MSK-man. 5 {Minimum}. MACD().347-348) . to paste them into your column TABs (MSK-man. p. than just re-code it. the custom indicator's default value can be used in an exploration. (Go Top) MACD Custom The Input() Function(MSK-man. Alexander Elder .p.271-273) cannot be used directly in the Explorer (MSK-man. Since you have created a {faulty} custom indicator. you may just want to use the 5 cross above the 40 and forget about the 13. YourTrig" ) Filter: Formula: Colb > Colc {or FML( "MACDcustom . In his book "Trading for a Living". Custom Indicator : Name: MACDcustom Formula: MAprd:=Input( "Periods". However. It is reserved to be used in a custom indicator. YourTrig" ) } (Go Top) MACD Histogram Divergence This explorer looks for stocks exhibiting extreme divergence from the MACD Histogram.351). MACD" ) Colc: Name: MACDTrigger Formula: FML( "MACDcustom . Exploration: Name: MACD crosses my Trigger Columns: Cola: Name: Close Formula: C Colb: Name: MACD Formula: FML( "MACDcustom . MAprd. p. 30 {Maximum}. and "Open" each of them one by one. p. you can still use its {by you at design time} assigned Default value. -1) ColC: Volume 10% above the average of the previous 10 days V > 1. ColA: md := MACD(). ROC(MACD() . you could smooth it a bit with: RocPeriods := 1. mdhist := md .100))(Sum(Cum(1). Mov(3 * ROC(MACD(). MovAvePeriod :=1. ROC(MACD(). However. I'm working on code to identify divergences using this method.2).E) Another way to do what you want would be to look for peaks and troughs using the 'Peak' and 'Trough' functions.$) If that is to noisy. Correl(((Sum(Cum(1)*( mdhist ). .E) {the 3 just 'magnifies' the line on the plot but doesn't affect the calculation} or for the MACD histogram: RocPeriods := 1.E). that could be use by the Explorer or the System Tester? ANSWER: One way to do what you want would be using the 'Rate of Change' function. Is there any way to calculate the MACD first derivative function to identify MACD tops/bottoms.100)* Sum(C. MACD is always bottoming or topping before crossing its trigger line.9.RocPeriods.2).0) Filter Column: colA and colA <-0.$) .2)/100)).12.80 Initial tests with this system have been encouraging. The following addition is then made. the MACD signal comes always a bit late compared to price movement. MovAvePeriod :=1.100)/100))/((Sum(Power(Cum(1). (Go Top) MACD Offset (MACD()*10 +50) {offset the MACD to 50} (Go Top) MACD Tops and Bottoms QUESTION: As you know.-1) + 1.2)/100) ).E). ColB: The volatility buy signal H > Ref(C.E). the MACD signal comes always a bit late compared to price movement. QUESTION: As you know.$) .Mov(MACD().9.100)/100))/((Sum(Power(Cum(1). MovAvePeriod.((Sum(Cum(1)*C.$) or for the MACD histogram you would have RocPeriods:=1.1 * Ref( Mov(V.100)* Sum(( mdhist ).RocPeriods.10.9. For example: RocPeriods:=1.100))(Power(Sum(Cum(1).100))(Power(Sum(Cum(1).8 * Ref( ATR(10).argues that divergence from the MACD Histogram gives the strongest signals in the whole of technical analysis.100). . that could be use by the Explorer or the System Tester? . MACD is always bottoming or topping before crossing its trigger line.RocPeriods.100). However.RocPeriods. MovAvePeriod.E).8 The above formula can also be combined with a volatility buy signal and a volume signal. Mov(3 * ROC(MACD() Mov(MACD().-1) Filter Column: colA AND colB AND colC AND colA <-0. Is there any way to calculate the MACD first derivative function to identify MACD tops/bottoms.Mov(md.100))-(Sum(Cum(1). LBnd.E). MovAvePeriod :=1.RocPeriods. I'm working on code to identify divergences using this method.$) If that is to noisy.$) or for the MACD histogram you would have RocPeriods:=1.10.0."CNTDN") >= 1 {Graphic: Dot. -CntDn. Magenta. {Name: %BandsCount} Pds:= Input("EMA Periods?". EXPERT {Name: %Bands} Symbols tab.1000.E). ROC(MACD() .E). IUp:= (H > TBnd) * Ref((H <= TBnd).5).1.RocPeriods. MovAvePeriod :=1.TBnd. Pct:= Input("Percentage Bands?". Mov(3 * ROC(MACD(). Pct:= Input("Percentage Bands?". MovAvePeriod.0. (Go Top) Mark Brown Band2 Study {Name: %Bands} Pds:= Input("EMA Periods?".Pds.10. Above price plot} Symbols tab.E) {the 3 just 'magnifies' the line on the plot but doesn't affect the calculation} or for the MACD histogram: RocPeriods := 1. ROC(MACD().$) . MovAvePeriod.$) .Ultimate This is the basic calculation: .RocPeriods.ANSWER: One way to do what you want would be using the 'Rate of Change' function."CNTUP") >= 1 {Graphic: Dot. Small. . TBnd:= MA*(1+Pct/100).21).5).21). For example: RocPeriods:=1.-1). CntUp:= IUp + BarsSince(IUp=1) * (H > TBnd). Small. IDn:= (L < LBnd) * Ref((L >= LBnd). LBnd:= MA*(1-Pct/100).1. {Name: %BandUp} FmlVar("% BandsCount". Mov(3 * ROC(MACD() . LBnd:= MA*(1-Pct/100).1000.1. {Name: %BandDn} FmlVar("% BandsCount".E). Below price plot} (Go Top) Market Pressure . CntUp.Mov(MACD().E) Another way to do what you want would be to look for peaks and troughs using the 'Peak' and 'Trough' functions.Mov(MACD().RocPeriods. . CntDn:= IDn + BarsSince(IDn=1) * (L < LBnd).-1). MA:= Mov(C.Pds. MA:= Mov(C.9. you could smooth it a bit with: RocPeriods := 1. MA.1. TBnd:= MA*(1+Pct/100). Green.9. If(C < Ref(C. write down todays volume as a negative number * close.-1) AND V > Ref(V. If toadies close is less than yesterdays close and toadies volume is less than yesterdays volume.-1). If(C < Ref(C.14) * 2 + Sum(If(C > Ref(C. Metastock code for Market Pressure . write down toadies volume * close. otherwise. add this to the past 28 days total. add this to the past 14 days total and * 2.0)).7) * 4 + Sum(If(C > Ref(C.-1). V * C. Extensive coverage of the McClellan Oscillator is provided in their book Patterns for Profit .0)).If toadies close is greater than yesterdays close and toadies volume is greater than yesterdays volume. Comparing rates of change/moving averages of the indicator against that of the instrument may reveal accumulation/distribution pressures. If(C < Ref(C. Neg(V) * C. V * C.-1) AND V < Ref(V. Neg(V) * C.-1). It may show signs of support and resistance when the indicator hits areas of support/resistance on its own graph.-1) AND V < Ref(V. . Then add up the past 7 days and * 4.-1). Plot this grand total in your chart for each new trading day.-1) AND V > Ref(V.-1). Neg(V) * C. Simple Interpretation: Market Pressure .-1) AND V > Ref(V.-1) AND V < Ref(V. Buy signals are typically generated when the McClellan Oscillator falls into the oversold area of -70 to -100 and turns up. Sell signals are generated when the oscillator rises into the overbought area of +70 to +100 and then turns down.0)).Ultimate can show divergences with the instrument it is plotted against. V * C.-1).28) (Go Top) McClellan Oscillator The McClellan Oscillator.Ultimate: Sum(If(C > Ref(C. otherwise write down 0. is a market breadth indicator that is based on the smoothed difference between the number of advancing and declining issues on the New York Stock Exchange. The McClellan Oscillator is one of the most popular breadth indicators. developed by Sherman and Marian McClellan. {NAME: %Bands} Pds:= 21.then right-click on one of the bands.5.19. Instead.Pds. Open a chart of the composite in MetaStock™ and plot this custom indicator. Or make the change in the Formula Editor.Mov(C. then create a template. the Expert appears to read only the default values. Look for major tops to occur when a divergence with the market occurs above a Summation Index level of +1600. select '%Bands Properties'.19.E).g. plot the %Bands formula. create a composite security in The DownLoader™ of Advancing Issues minus Declining Issues.EXPONENTIAL) (Go Top) McClellan Summation Index The McClellan Summation Index is a market breadth indicator developed by Sherman and Marian McClellan. Mov(CLOSE. click 'OK'.E)). then the 'Formula' tab.39. No matter what optional parameters are entered for EMA length or % bandwidth. . (Go Top) Metastock % Bands Revised I found a problem with the %Bands formulas posted yesterday.39. get the display to your liking. the %BandsCount formula and the Expert will take their values from that. Alternatively. McClellan suggests the following rules for use with the summation Index: Look for major bottoms when the Summation Index falls below -1300. below is a hard-coded version. For more extensive coverage of the index refer to the book Patterns for Profit. by Sherman and Marian McClellan. The formula is Cum(Mov(C. As a result. There is no screen to enter optional parameters. {ENTER EMA LENGTH} Pct:= 2. the index moves from -1600 to +2000).Mov(CLOSE. The beginning of a significant bull market is indicated when the Summation Index crosses above +1900 after moving upward more than 3600 points from its prior low (e.EXPONENTIAL) . the coloured dots appear in inappropriate places. If the coloured dots are considered unnecessary the Expert can simply be detached. It is a long-term version of the McClellan Oscillator and its interpretation is similar to that of the McClellan Oscillator except that it is more suited to major trend reversals. when using other than default parameters. The summation index is plotted by adding the Cum function to the McCllellan Oscillator. For regular use. The values need to be entered only once. {ENTER PERCENT BANDWIDTH} MA:= Mov(C.E) . in the %Bands formula. and change the parameters in the first two lines of the %Bands formula.To plot the McClellan Oscillator. Above price plot Symbols tab. I have found this idea in Tushar Chande's "New Technical Trader"."LBND"). During short-term range-bound markets. Green.5. The upper band can be used as the extreme point to get rid of shorts and vice versa.5). (HHV(LLV(L. CntUp:= IUp + BarsSince(IUp=1) * (H > TBnd).10). {NAME: %BandUp} FmlVar("%BandsCount". Upper Band Prd1:=Input("ATR Period".10)."CNTUP") >= 1 Graphic tab: Dot.20. and prices remain below the bands in a downtrend.-1).5.5). Below price plot (Go Top) Metastock Adjustable Trading Bands Using the default values used in the formulas. IUp:= (H > TBnd) * Ref((H <= TBnd). Prd2:=Input("Period for Lowest Low Value". Can be made into a template for easier usage. Small.20. I have found that these upper and lower bands provide effective risk control while trading. CntDn:= IDn + BarsSince(IDn=1) * (L < LBnd).Prd1)+ATR(Prd1)."TBND").5. Prd2:=Input("Period for Highest High Value".20."CNTDN") >= 1 Graphic tab: Dot.Prd2)) Lower Band Prd1:=Input("ATR Period". it would be be very nice if you could comment on them. {NAME: %BandDn} FmlVar("%BandsCount". LBnd. they tend move between the bands. In fact. -CntDn. MA. . Magenta. EXPERT {Name: %Bands} Symbols tab.20. LBnd:= MA*(1-Pct/100). Since you have studied ATR so thoroughly. prices tend to remain above both the bands while the market is in a strong uptrend.TBnd:= MA*(1+Pct/100).5. LBnd:= FmlVar("%Bands". {NAME: %BandsCount} {USE WITH %BANDS FORMULA} TBnd:= FmlVar("%Bands".-1). Small. CntUp. TBnd. IDn:= (L < LBnd) * Ref((L >= LBnd). 50.-50.. As a result.S)... Mike Helmacy www.. I was looking for finding stocks at intermediate term lows and highs..50.%).. Mov(ROC(C.50. but it did NOT give me indication of the strength or duration of the new move.L....1).L. periods2:=Input("Smoothing Period". I have been following a few stocks (medium volatility.1. and that only signals that identify stocks WITHIN a momentum trend (ie.. ((PDI(8) ..10))) *TroughBars(1.. the first formulas had an "Absolute Value" that wasn't called for in the article ( I had mistaken the "[" "]" to mean "|" "|"). You will also need to change the line style to the last one in the drop down list.... only that it probably would occur.-50.-5)...2.0..MDI(8)) ..I think you'll like it. but good %% moves both up and down over a 2-5 week time frame) and tracking them with about 15 templates on which most of the formulas that I have acquired reside..and it's the same coding in WOW..techanalysis.(PDI(21) .10))) This formula will draw a trendline from the most recent bottom. I also tracked those formulas that were late in showing turns in momentum vs those that caught the turn close on.. Thanks go out to William Golson for the help. In this regard.L.12). I wanted to track those that did best and those that were not as effective.10)-Trough(2.com Those who know me have found out I vacillate between the VERY complicated and the very simple. My momentum trend change indicator is derived from an intermediate trend indicator I've used for some time in MSWIN 6.but I wanted the code to match the math in the article. Input("horizontal line 2"..10)+ ((((Trough(1.. I believe. I came up with a very simple indicator that showed a HIGH degree of accuracy in "turn-calling"....MDI(21))) + (PDI(13) ..periods2...MDI(13)) Try it.L.periods1..L..50.Prd1)-ATR(Prd1).. The L (low) can be changed to C (close) and the 10 can be changed to a different percent value. PDI(34) . (Go Top) Metastock Expert Commentary by Michael Arnoldi Review of : <symbol> as of <date> TODAY'S CLOSE WriteVal(CLOSE.3) .L. The new formulas seem to plot exactly as the old.10)-TroughBars(1.BW Chan I have posted an update to the RMTA and TOSC formula's.MDI(34) My new formula is. Input("horizontal line 1".Prd2)) (Go Top) Metastock Automatic Trendline Formula Trough(1.already established) are able to do that.(LLV(HHV(H. NOT for indicators that identified stocks that had begun their run in any direction and were destined to continue.2...10)) / (TroughBars(2. I believe that I have finally discovered that any signal of a change in momentum will NEVER give you a sense of strength or duration BY ITS VERY NATURE... (Go Top) Metastock Custom Indicator Moving Averages periods1:=Input("Periods of ROC".5). 21.2)") WriteIf(C=O.02 which you can change.-1)<Ref(HHV(H.13. "WRITEVAL(-L+ (2*H+L+C)/2.3) BOLLINGERBAND BOTTOM: WRITEVAL( BBandBOT(C.2))) {colb:SELL: this means: label colum B as "SELL" and then enter the following formula:} Cross(SAR(.E). "WRITEVAL(-H+ (2*H+L+C)/2.60).02.13. ColA: {Close) C ColB: {Previous 60-day High} Ref(HHV(H. "WRITEVAL(-H+ (H+2*L+C)/2. "WRITEVAL(-L+ (H+2*L+C)/2. "WRITEVAL(-H+ (H+L+2*C)/2.25.25.2)") WriteIf(C>O. try doing a sys test by replacing the numbers with opt1 & opt2} (Go Top) Metastock-Stocks Closing Above 60 Day High To find the securities that have closed above their high today (the last trading day in the database) for the first time.2)") PROJECTED LOW WriteIf(C<O.21.2)") WriteIf(C=O.(SAR(.60)) This formula does two things: 1) It lists only those securities which have met the required conditions only on the last trading day.3) (Go Top) Metastock SAR Exploration {cola:BUY: this means: label column A as "BUY" and then enter the following formula:} Cross(L.25.E. 2) The new 60-day high must have taken place only on the last trading day.E. "WRITEVAL(-L+ (H+L+2*C)/2.2.3) BOLLINGERBAND TOP: WRITEVAL( BBandTop(C. -1)) AND (H=HHV(H.02.25.21.2). -1) ColC: {Current 60-day High} HHV(H.13. I have written this MetaStock Explorer.2)") BOLLINGER BANDS CLOSING PRICE:WRITEVAL(C.H) {enter the following in the filter section:} cola=1 or colb=1 {where the AF=0.2)") WriteIf(C>O.TOMORROW's PROJECTED HIGH WriteIf(C<O.60) ColD: {Volume} V Filter: (colA>colB) AND (Ref(C.2).3) 21 DAY MOVING AVERAGE: WRITEVAL(MOV(C..25.60). from Rajat Bose {Stocks Closing Above 60 Day Highs} ..2).25. -1). It's not worth using for long term investors.-2)<=Ref(C. C>Ref(C. It will pick up stock that was in a trading range or consolidating. (Go Top) Miesal Indicator "It's a short term timing tool.-4) This formula will pick up all stocks that have closed up either the same as the previous day or below the previous day for 3 days.-3) AND Ref(C.{closing above the 60-day high of the close} close>ref(hhv(close.-3)<=Ref(C.-1) AND C>Ref(C.-1) (Go Top) Mick's Breakout Exploration This is a MetaStock formula that I have had good success with.-1) AND Cross(100.60).Fml("CCIF-P")) . 0)). Once I have a short list. +1. then on the 4th day closes up higher than the previous 3 days close.Fml("CCIF-P")) OR Cross(-100. I check it with Daryl's 3 day countback line and sometimes run a 10/30 moving average. -1.-1)<=Ref(C. I will enter the trade and put a trailing stop loss into play." Sum(If(C > Ref(C. then breaking out of the range.-3) AND Ref(C.-4) AND Ref(C. Some have also suggested using periods of 25 or 50 days.-2) AND C>Ref(C.-4) AND Ref(C. Copy and paste this into the Explorer filter.-1) AND Cross(Fml("CCIF-P"). though I use only 10 days. If(C < Ref(C.-1)<=Ref(C.-1) if you want those that are {closing above the 60-day intraday high} close>ref(hhv(high.100) sell: Fml("CCIF-P")<Ref(Fml("CCIF-P").-1)<=Ref(C. The reason that I specified that the first 3 days close was the same as or less than the previous days close was that it would pick up all stock in an up trend if it was just the 4th day closing higher than the 3 previous you would get hundreds of returns on the search.-1).-2)<=Ref(C.-2) AND Ref(C. If the stock breaches the previous day's close on the open.-4) AND Ref(C.60).-100) OR Cross(Fml("CCIF-P"). Others have suggested it's very useful when used in conjunction with Welles Wilder's RSI. The reason that I had the 4th day higher than the 3 previous was because it would otherwise pick stock in a downtrend with no significant increase in the close on day 4.10) Entry/Exit signal buy: Fml("CCIF-P")>Ref(Fml("CCIF-P").-3) AND C>Ref(C. sOneC:=((n-41)/2)*Ref(C.-3)+ ((n-9)/2)*Ref(C.-31)+ ((n-65)/2)*Ref(C. sOneB:=((n-21)/2)*Ref(C.-20)+ ((n-43)/2)*Ref(C.-13)+ ((n-29)/2)*Ref(C.-14)+ ((n-31)/2)*Ref(C.-28)+ ((n-59)/2)*Ref(C.-21)+ ((n-45)/2)*Ref(C.-5)+ ((n-13)/2)*Ref(C.-12)+ ((n-27)/2)*Ref(C.-11)+ ((n-25)/2)*Ref(C.{horizontal lines @ -100 & +100} where: {"CCIF-P" is} (CCI(8)+CCI(13)+CCI(21))/3 (Go Top) Mixed Balance Point Krause Update I have updated some of the code since my last post concerning the TASC articles written by Robert Krausz.-8)+ ((n-19)/2)*Ref(C.-9).-6)+ ((n-15)/2)*Ref(C.-4)+ ((n-11)/2)*Ref(C.-16)+ ((n-35)/2)*Ref(C.-19).-32)+ ((n-67)/2)*Ref(C.-18)+ ((n-39)/2)*Ref(C.-17)+ ((n-37)/2)*Ref(C.-2)+ ((n-7)/2)*Ref(C. TN:=Mov(C.N.-29).-22)+ ((n-47)/2)*Ref(C.-15)+ ((n-33)/2)*Ref(C.S). sOneD:=((n-61)/2)*Ref(C.-23)+ ((n-49)/2)*Ref(C.-1)+ ((n-5)/2)*Ref(C. These are named different so you should delete the old code after you have installed the new. sOneA:=((n-1)/2)*C+ ((n-3)/2)*Ref(C.-34)+ . The code now plots on the proper days (instead of 1 day ahead) and they should also be more efficient to calculate.-7)+ ((n-17)/2)*Ref(C. I will also post a follow up with a graphic to show how these plot.-24)+ ((n-51)/2)*Ref(C.-27)+ ((n-57)/2)*Ref(C.-30)+ ((n-63)/2)*Ref(C.-25)+ ((n-53)/2)*Ref(C. (Go Top) Modified 50 Day Moving Average N:=50.-33)+ ((n-69)/2)*Ref(C.-10)+ ((n-23)/2)*Ref(C. Note: the formulas on the Equis web page WILL NOT calculate for missing days (Holidays).-26)+ ((n-55)/2)*Ref(C. -47)+ ((n-97)/2)*Ref(C. Divergences have also been somewhat better. The ratio of the summed positive and negative money flows are then normalized to be on a scale of zero to 100. for that matter.-46)+ ((n-95)/2)*Ref(C.-49).-48)+ ((n-99)/2)*Ref(C. I have tested it on various time periods (for Bollinger Bands) using 2 standard deviations. NumDev))/((( BBandTop(C. NumDev))))) {All I have done here is to substitute High and Low of any bar with that of Bollinger Band Top and Bollinger Band Bottom. sOne:=sOneA+sOneB+sOneC+sOneD+sOneE.2). S.-41)+ ((n-85)/2)*Ref(C. NumDev))-(BBandBot(C. NumDev := Input("No. of any other overbought-oversold indicator. the structure shows that most of its properties are similar to those of the Williams %R or. Periods. 1. Instead of using up closes versus down closes.5).-36)+ ((n-75)/2)*Ref(C.} (Go Top) Money Flow Index The MFI (Money Flow Index) can be used in place of the OBV (On Balance Volume) and Chaikin Oscillator to confirm Bollinger Bands. sOneE:=((n-81)/2)*Ref(C.-37)+ ((n-77)/2)*Ref(C. 3. Periods. yTwo:=TN+(6*sOne)/((N+1)*N). of Standard Deviations".-42)+ ((n-87)/2)*Ref(C. yTwo (Go Top) Modified Williams %R Metastock Indicator by Rajat Bose Periods := Input("Time Period".-43)+ ((n-89)/2)*Ref(C. v.((n-71)/2)*Ref(C. It sometimes gives an early indication of reversals than the Williams %R of the same period. S. 12:8 (321-324): SIDEBAR: The Money Flow Index "The money flow index (MFI) is a volume-weighted form of the relative strength index (RSI). the MFI compares today's average price to yesterday's average price and then weighs the average price by volume to calculate money flow (MF).-40)+ ((n-83)/2)*Ref(C.-35)+ ((n-73)/2)*Ref(C. Periods. However.50. S.-38)+ ((n-79)/2)*Ref(C.-39)." Here are the MetaStock formulas for the Money Flow Index: Positive Money Flow: .5. From Stocks & Commodities magazine. (100*(C-BBandBot(C.-45)+ ((n-93)/2)*Ref(C.-44)+ ((n-91)/2)*Ref(C. 4 * LLV(LOW. SellSignal3 := CLOSE < (1-.Periods. BuySignal4 := CLOSE > UpperBand AND CLOSE > 1. I just draw another . and saving them in a template: Mov(C. LowerBand := BBandBot(CLOSE.S. creating three indicators in the following way.00 Percent (Go Top) Moving Average Channel "The MetaStock moving average function has an option for displacing the mov both vertically and horizontally. BuySignal1 OR BuySignal2 OR BuySignal3 OR BuySignal4 Close Long: Periods := 11.-1).-1 ) .< . Like the 10% +/-.0 ) . PERIODS) Money Flow Ratio: fml ( "Positive Money Flow" ) / fml ( "Negative Money Flow" ) Money Flow Index: 100 .2) = 2. BuySignal2 := CLOSE > UpperBand AND Ref(LOW. SellSignal2 := CLOSE < (1-. When I see a buying opportunity ahead.S) displaced +10% Mov(C.sum ( if ( typ( ) .18) * HHV(HIGH. PERIODS) Negative Money Flow: sum ( if ( typ( ) . 28. BuySignal3 := LOW > UpperBand AND Ref(CLOSE.S) > 2000 {assuming volume in 100's otherwise use 200000} AND Mov(HIGH." from L.10% Mov(C.3.V * typ ( ) * -1 . (Go Top) MovAvg Asymmetric Volatility Price Bands SIGNAL FORMULAS Enter Long: Periods := 11.-1). BuySignal1 := Sum(CLOSE > UpperBand.-1) .3) = 3. I prefer to use a mov channel in place of Bollinger Bands.3.S). most of the time.-1) > Ref(upperband.S)> Mov(HIGH .> .Periods + 1) AND Mov(VOLUME.( 100 / ( 1 + fml ( "Money Flow Ratio" ) ) ) NB:The time periods are controlled by PERIODS in the Positive & Negative Money Flow formulas.LOW.-1) > Ref(upperband.1. 28. instead of Bollinger Bands.18) * HHV(HIGH.2).S) > UpperBand AND Mov(HIGH LOW.V * typ ( ) .S) displaced . this should be adjusted for each security and for the particular condition you are waiting for (buy/sell).7).ref ( typ ( ) .S) 28 days is the basic span of time.ref ( typ( ) . SellSignal1 OR SellSignal2 OR SellSignal3 STOPS Maximum Loss: LONG ONLY 10.0 ) .Periods.Periods. UpperBand := BBandTop(CLOSE.3. 28.Periods + 1) AND Sum(CLOSE < LowerBand.Periods + 1) AND HIGH < LowerBand. Issen "I use moving average.S.3) = 3. and G. SellSignal1 := Sum(CLOSE < LowerBand. E)<Mov(C.10.0)))>=1 enter short c<=mov(c.EXPONENTIAL) • ((CLOSE-Mov(CLOSE.5) 200 dma w/i 1 pt enter long c>=mov(c.30.0)). Custom indicator which gives 1 for longs and -1 for shorts-Indicator Name: Position MASwitch:=If(Mov(C.30.200.s)*2) 200 dma violated by 50% enter short c>=(mov(c.1.1.10)).5.10.Ref(C.200.C-Ref(C. to time the entry.1. employing 10 and 30 day exponential averages.EXPONENTIAL)) * 100 • **When(colA> colB) (Go Top) Moving Average Crossovers What follows is a simple example using a moving average crossover system for MetaStock. with other indicators/oscillators.30.trio of faster MAs (keeping the slow on the chart) and use them.75*hhv(c.15)-. Indicator name: TotalEquity Fml("Equity1")+Fml("Equity2") (Go Top) Moving Average Violated By % 200 dma violated by 100% enter short c>=(mov(c.. These are just examples and profitability is dubious. If(BarsSince(MASwitch=1) <BarsSince(MASwitch=-1).10.0)) + (if ((c<=. Same process to exit the market.-1)=1.30.200.EXPONENTIAL)) * 100 • ((CLOSE-Mov(CLOSE. Results close to 0 pinpoint the crossover.EXPONENTIAL)) /Mov(CLOSE.s)*1.EXPONENTIAL)) /Mov(CLOSE. e.s)-1 .-1) Custom indicator for cumulative open Equity curve without trading costs-Indicator name: Equity Cum(If(Ref(Fml("Position").10.s)+1 exit long ((if ((c<=prev(llv(c.-1)-C)) You can make several such equity lines and then just add them by using a yet another custom indicator.1." (Go Top) Moving Average Crossover---Bullish This is a10 and 30 day moving average crossover search.If(Mov(C.E). 1)).E)>Mov(C.200.30.1.-1).g. • CLOSE • Mov(CLOSE.E). 200.-1).Wt>0.1) and adx(1)>adx(14) and (pdi(9)<mdi(14)) exit short c>prev(hhv(c.15).Wt)+ ValueWhen(3.21).L).H).5 21 d reversal w di enter long c>prev(hhv(c. {then}(Ref(HighestSince(1.-1). DwP:=ValueWhen(1.-1) + Ref(C.Dw=1.Wt)+ ValueWhen(5.Wt>0.Wt>0.-1) + Ref(C.1.Dw=1.0).Dw=1.5 200 dma w/i 3pts enter short c<=mov(c. Wt:=If(Dw=1.21).Wt)+ ValueWhen(4.15). 15)+.-1)+ Ref(LowestSince(1.0).1) and (pdi(9)>mdi(14)) (Go Top) MTF-Fixed Balance Point name: MTF-Fixed Balance Point {Multiple Time Frame "Fixed Balance Point" 4/23/99} Dw:=If(DayOfWeek()<=Ref(DayOfWeek().21). {else}0). {else}0).1. Wt:=If(Dw=1.Wt>0.1) and (pdi(14)<mdi(9)) enter short c<prev(llv(c.-1))/3.21). Dwp name: MTF-Fixed Balance Point Step {Multiple Time Frame "Fixed Balance Point Step" 4/23/99} Dw:=If(DayOfWeek()<=Ref(DayOfWeek().Wt))/5. Dwps ------------------------------------------------ .-1))/3.-1)+ Ref(LowestSince(1.Wt)+ ValueWhen(2.Wt).Wt>0.s)-3 exit short c>=hhv(llv(c. {then}(Ref(HighestSince(1.H).1) and adx(1)>adx(14) and (pdi(9)>mdi(14)) exit long c<prev(llv(c.L). 15)+.exit short c>=hhv(llv(c.Wt>0.Dw=1. DwPs:=(ValueWhen(1. L). BarsSince(Ref(dt.Dw=1. SR2:=DwP-(Wr*.BarsSince(Ref(dt.5).dt.-1)=1)+1.L). Wl:=If(Dw=1. {else}0).H). If(Dt=4. dc:=If(Dt=1.BarsSince(Ref(dt.Dw=1."DBC").H).-1))/3. Wr:=ValueWhen(1.L).H).Wt>0.Dr)+ ValueWhen(20.-1).Wt).-1))/3).dt. DBC -----------------------------------------------name: MTF-Dynamic Balance Point Step {Multiple Time Frame Dynamic Balance Point Step 4/23/99} Dr:= FmlVar("MTF-Dynamic Balance Point".618). DwP:=ValueWhen(1.Dw=1. .dt.5).Wh)-ValueWhen(1. RR1:=DwP+(Wr*.Dr. {then}Ref(HighestSince(1.-1)=2)+1.1.-1). Wh:=If(Dw=1. Wt:=If(Dw=1.Wl>0. {else}0). If(Dt=3.Dr)+ ValueWhen(5.Dr.-1)+ Ref(LowestSince(5.-1)=5)+1)))). {then}(Ref(HighestSince(1.-1))/3.-1)=3)+1.H). DBC:=If(dc=5. Dsc -------------------------------------------------name: MTF-S&R {Multiple Time Frame "Weekly Support & Resistance" 4/23/99} Dw:=If(DayOfWeek()<=Ref(DayOfWeek().Dr. RR2:=DwP+(Wr*.Dr.-1)+ Ref(LowestSince(1.618).Dr)+ ValueWhen(10.Dr))/5.-1)+ Ref(CLOSE.-1).BarsSince(Ref(dt.Wl). {else}0).Dw=1. SR1:=DwP-(Wr*.-1)=4)+1. {else}(Ref(HighestSince(4.Wh>0.-1)+ Ref(LowestSince(4.0).dt.name: MTF-Dynamic Balance Point {Multiple Time Frame Dynamic Balance Point 4/23/99} dt:=DayOfWeek().-1)+ Ref(CLOSE.-1) + Ref(C.BarsSince(Ref(dt. If(Dt=2.Dr)+ ValueWhen(15. {then}Ref(LowestSince(1.L). Dsc:=(ValueWhen(1. {then}(Ref(HighestSince(5.Dr. {else}0)).L)+C)/3)."DWP"). If(Mt>0. I'll bet other people could benefit from the answer as well. {then}Ref(C.Fw=1.FmlVar("MTF-Fixed Balance Point".1. Suppose I've got some indicator that ranges from 0 to 100 and I have a system that says "buy when the indicator goes above 90 and hold until it goes below 10 and then sell" or something.-1). This seems like a general problem that must come up often but it is not obvious to me how to code it." This may take the form of another indicator that is "1" when the system is in hold mode and "0" when it is in don't hold mode. There were two responses. I use WOW and MetaStock.If(Mt<0. What I actually wanted to do was have a way of looking for system 2 signalling a buy during anytime that system 1 was saying hold because its last signal had been a buy.H)+ LowestSince(1. Notice that if the indicator is between 10 and 90 that you don't know whether that's a hold or a don't hold unless you know whether it last crossed 90 or 10.1. So far so good.0)) (Go Top) MTF Tendency Update {Multiple Time Frame .0)). one can be seen in #3310 from Larry on the Yahoo! MetaStock board (thanks Mike) which is answering a slightly different question. Mt:=If(Fw=1 AND Ref(dw.-1. Ref(C. RR2. --------------------------------------name: MTF-Tendency Mt:=If(DayOfWeek()=1.-1.1. SR1. (Go Top) Multipart Formulas QUESTION: I've got a specific question. Fw:=If(dw<Ref(dw."DWP").0).SR2.Tendency 5/23/99} {This will plot 1 for Bullish -1 for Bearish} dw:=DayOfWeek(). Bob Anderton ANSWER: Thanks to all of you for the great help and input to the question of how to deal with combining the indicators in a system when one of them gives a signal by crossing.-1)<>5.Fw=1. Now suppose I want to combine the signal from this system with another indicator/system so that I can say something like "buy when system #2 says buy only if system #1 is in "hold the stock" mode.-1). . RR1. That solution seems like what one would use if one wanted to look for system 2 signalling a buy the same day as system 1 signalling a buy by crossing a value. If(Mt>0.If(Mt<0.FmlVar("MTF-Fixed Balance Point". {else}If(dw=5. 0). {then}C-((HighestSince(1.-1). Ph.S).89.2).E)Mov(C.-1) Color: Red Click OK to save the changes to the Expert. Create a new Expert with the following highlights: Expert name: New Market Paradigm HIGHLIGHTS Name: Contraction Condition: BBandTop(CLOSE.2)<Ref(BBandBot(CLOSE.13.E))+(490*(Mov(Mov(C.13. In MetaStock for Windows 6.E).SIMPLE. use the Expert Advisor to create highlights. The price bars in the chart will be highlighted blue during a contraction phase and red in an expansion phase.0 or higher. which will show when contraction and expansion phases are present.5). This is a big step forward for me.5)/Mov(Stdev(P.2).2)> Ref(BBandTop(CLOSE.SIMPLE.SIMPLE.SIMPLE.This was addressed very nicely by Paul in message #3311.34. meaning that the first indicator was in hold mode.28.2)>Ref(BBandBot(CLOSE. I'd never used this BARSSINCE function before(which is PERIODSSINCE for WOW) and this was key to being able to do this I think.SIMPLE.34.2)< Ref(BBandTop(CLOSE.SIMPLE.SIMPLE.-1) Color: Blue Name: Expansion Condition: BBandTop(CLOSE. Open a chart and then click your right-mouse button while pointing at the chart heading.E))-(420*Mov(C. I took his idea to make the following indicator: If(BarsSince(Cross(Fml("Indicator1").-1) AND BBandBot(CLOSE.100.1.28. K:=Stdev(P.SIMPLE. Choose the New Market Paradigm Expert and then click the OK button.2). First.E))))/42) Tar(SZ)an Short .28.28. Vidya. choose Expert Advisor from the tools menu in MetaStock.28.28.2).-1). Tar(SZ)an Long C-(((462*Mov(C. Volatility and a New Market Paradigm Mutated Variables.28. Imagine that this is a really long term indicator.-1) AND BBandBot(CLOSE. (Go Top) Mutated Variables. Now you can look for your short term indicator #2 to signal a sell and just AND it with this new indicator being = 1. A:=(2/(Periods+1)). (Go Top) My version of Tushar Chande's Vidya using the P variable Vidya{P} Periods:=Input("length of MA".20).28.0) This makes a new indicator that is 1 when the last signal is a buy and 0 when the last signal was a sell.Fml("Indicat or1"))). Volatility and a New Market Paradigm by Walter T.20.90))<BarsSince(Cross(10. Vidya:=A*K*(P)+(1-A*K)*Ref(P. Choose Expert Advisor and then choose Attach from the chart shortcut menu.D.5. Downs. <.-1).26.0)) Where: 1 = +. 12:6 (253-254): The Market Facilitation Index by Gary Hoover "Applying technical analysis to developing trading signals begins with the investigation of price movement and often incorporates volume studies to improve trading accuracy." Range: High-Low MFI: Fml("Range") / Volume Efficiency: If(Fml("MFI").Ref(Fml("MFI"). If the MFI decreased.(Go Top) Market Facilitation Index Expert Advisor In the August 1996 Stocks & Commodities. then the market is becoming less efficient.1). by Gary Hoover. the color and then entering the following formulas: Green Bar (Green Bar) . The efficiency is measured by comparing the current bar's MFI value to the previous bar's MFI value. The MFI is the ratio of the current bar's range (high-low) to the bar's volume.=. Taken from Stocks & Commodities.Ref(Fml("MFI").12.Ref(Fml("MFI").Ref(Fml("MFI").-1.E).(C-(((325*Mov(C.9.3. If(Fml("MFI").If( Fml("MFI").26.>.3 = -.If(Fml("MFI").0)).If(Fml("MFI").Ref(Fml("MFI").E))-(297*Mov(C.E))))/28)*2 (Go Top) Market Facilitation Index The following formulas were constructed using interpretation from Technical Analysis of Stocks & Commodities Magazine June 1994. article "The Market Facilitation Index". then the market is facilitating trade and is more efficient.E))+(351*Mov(Mov(C.If(Fml("MFI"). Enter the following Highlights by choosing New. which may indicate a trading range is developing that may be a trend reversal….1.Ref(Fml("MFI").Ref(Fml("MFI"). an article by Thom Hartle titled "The Market Facilitation Index" showed how to color bars to identify chart patterns based on changes in the market facilitation index and volume.-1).Ref(V.0)).E)Mov(C.>.-1).2. Here is how to do this in MetaStock 6.<. enter any notes you like and then click on the Highlights tab.0's new Expert Advisor.+ 2 = +.-1).4.If(V.< .0. Name the expert "Market Facilitation Index". V. 1.-1).13. If the MFI increased.1).0))) Where: +1 = increase -1 = decrease 0 = unchanged Market Facilitation Comparison: If(V.+ 4 = -. The Market Facilitation Index (MFI) is one indicator that synthesizes both price and volume analysis. and then choose New from the Expert Advisor.>.-1).-1) .<. If(Fml("MFI").>. The MFI is designed to gauge the efficiency of price movement. implying that the market is trending.Ref(V. The first step is to create a new expert by choosing Expert Advisor from MetaStock's Tool menu. NYSEJ (declines).1.$) > 0 AND ROC(V. Advances. Advances.( C * V ) ) / ( ( P + ( C * V ) ) ) )To plot it: • Load advances. Next select Expert Advisor and then Attach from the Chart shortcut menu.1. The tickers are X. Equis International (Go Top) Market Thrust Oscillator The following formulas were taken from the article. The tickers are @*NAZ_K and @*NDZ_K. Downvolume. For the Windows versions of MetaStock: For RTD and Dial Data: #1: C * V #2: 100 * ( ( P . Attach the market facilitation index expert. For CompuServe data: #1: C .$) > 0 Fade Bar (Blue Bar) ROC((H-L)/V.$) > 0 AND ROC(V. variations have been suggested on the theme and here. and then any time you apply the template to a chart the market facilitation index expert will automatically attach to the chart.Allan J. You can now right-click on the heading or background of any chart. Dial/Data supplies this data in two files. number and volume).$) < 0 AND ROC(V. number and volume. The tickers are NYSEI (Advances). Note: You can save a chart as a template with this expert attached. number and volume) and X. • Plot the thrust indicator formula (#2) directly on top of the plotted formula #1 in the declines chart. • Drag the plotted formula #1 from the advances in to the declines chart. in the December 1993 issue of Technical Analysis of Stocks & Commodities. 11:12 (506-511): The Cumulative Market Thrust Line by Tushar S. in which market thrust is cumulated to calculate a volumetric advance-decline line by including the effect of up and down volume. V.$) < 0 AND ROC(V. Reuters Trend Data (RTD) supplies this data in two files. PhD. by Tushar Chande. Chande offers the variation of a cumulative market thrust line. Upvolume.$) > 0 After you have entered the four highlights click OK to finish editing the expert's properties.1. Declines. The article side bar presupposes the user has these four files. CompuServe supplies this data in 4 files. number and volume and Declines. and it will highlight the four market facilitation patterns that were discussed in Hartle's article. To use these two files. Chande. Since then.$) < 0 Squat Bar (Red Bar) ROC((H-L)/V. plot formula #1." Composite securities are created from 4 separate files.1. -.ROC((H-L)/V. "STOCKS & COMMODITIES contributor Tushar Chande originally introduced the concept of market thrust in August 1992 as a method by which to overcome the limitations of the Arms index. Taken from Stocks & Commodities.1.1. NYUP (Advance volume) and NYDN (decline volume). McNichol. • Load declines.1. you must utilize two different custom formulas and the indicator buffer in MetaStock™ for DOS.NYSE-D (Declines.$) < 0 Fake Bar (Dk Gray Bar) ROC((H-L)/V.1.NYSE-A (Advances. "The Cumulative Market Thrust Line". E)*3) + (Mov(Roc(C.15. E)*2) + (Mov(Roc(C.10.13.6.%).%).S)*2) + (Mov(Roc (C. as the range narrows the Mass Index decreases.%).15.20.%).%).30.S)*2) + (Mov(Roc (C.20.15.26.%).20.10.%).%).109.E)*1) + (Mov(Roc(C.E)*4) Short-Term KST Weekly Exponential Moving Average (Mov(Roc(C.9.39.20.10.3.4.26. Pring. The KST is constructed by summing four smoothed rates of change.S)*4) ) / 4 Intermediate KST Simple Moving Average (Mov(Roc(C.%). The following formulas are MetaStock formulas for the KST.E)*2) + (Mov(Roc (C.6. (Go Top) Martin Pring's KST Formulas The KST indicator was developed by Martin J.S)*4) Long-Term Monthly KST Simple Moving Average ( (Mov(Roc(C.E)*3) + (Mov(Roc(C. • Load declines composite.6.13.S)*3) + (Mov(Roc(C.9.%). the formula is: Cum(P-C) for CompuServe data Cum(P-(C*V)) for RTD and Dial Data You now have the thrust indicator plotted exactly as the article discusses.24.10.%).E)*1) + (Mov(Roc(C.39.4.%).52.6.%). plot formula #1.E)*2) + (Mov(Roc (C.%). As the range widens the Mass Index increases. E)*1) + (Mov(Roc(C.%).%).12. • Drag the plotted formula #1 from the advances in to the declines chart.%). by Donald Dorsey. 18.S)*4) Intermediate KST Exponential Moving Average (Mov(Roc(C.10. The name KST comes from "Know Sure Thing".10. For more interpretation refer to Martin Pring's article "Summed Rate of Change (KST)" in the September 92 issue of TASC.%).20. ** To create the cumulative thrust oscillator line perform the same steps as above except change formula #2 to: Cum(100*(P-C)/(P+C)) for CompuServe data Cum(100*(P-(C*V))/(P+(C*V))) for RTD and Dial Data ** To create the cumulative market thrust line.10.#2: 100 * ( ( P .S)*1) + (Mov(Roc(C.13.10.10.15.8.%).%).S)*2) + (Mov(Roc(C . E)*4) (Go Top) Mass Index The Mass Index was designed to identify trend reversals by measuring the narrowing and widening of the range between the high and low prices.%). .15.13. Daily KST Simple Moving Average (Mov(Roc(C.S)*3) + (Mov(Roc(C.S)*1) + (Mov(Roc(C.%).C ) / ( ( P + C ) ) ) To plot it: • Create a composite of the Advances * Up Volume • Create a composite if the Declines * Down Volume • Load advances composite .15. The MASS Index appeared in the June 92 Technical Analysis of Stocks & Commodities article "The Mass Index". E)*3) + (Mov(Roc(C. • Plot the thrust indicator formula (#2) directly on top of the plotted formula #1 in the declines chart.%).E)*4) Long-Term KST Exponential Moving Average (Mov(Roc(C.26.%).3.6.S)*1) + (Mov(Roc(C.78.S)*3) + (Mov(Roc(C. (Go Top) Morris Double Momentum Indicator Mov(((ROC(C. It is updated by the CBOE. The Volatility Index (VIX) is the implied volatility of a group of Standard & Poors 100 index options. 3 for Wednesday. Telescan. The custom formula you should create is the Modified VIX: ( ( ( P . This moving average is currently a 6 week or 6 Friday moving average.2.E).30.S) (Go Top) MACD Crossover System .12. Karczewski's article.9 . V.W) (Go Top) Moving Average of Only One Day of the Week Frequently we get requests for a formula that would take only one day of the week and average them for several weeks. Mov(If(DayOfWeek( )=5. If you wanted to change it to another periodicity you would change the 30 to the number of weeks or specific days multiplied by 5.E) / Mov(Mov( ( H . 2 for Tuesday.Mov( P .19. Donald Dorsey explains.L ) .25 ) (Go Top) McGinley Dynamic Ref(Mov(C. in the April 1995 issue of TASC.Peak(1.%))).-1))) / (C/(Ref(Mov(C. The number of day you wanted would replace the two 5's already in the formula. or DBC Signal. not often covered by students of technical analysis.L ) . 3 . Jack Karczewski. You now have a plot of the Modified VIX. by S.Taken from Stocks & Commodities.Open the chart of the OEX 2 .C. Examining this pattern.12.9 . For example construct a moving average of only the Fridays. The following MetaStock formula is for a moving average of the Friday of every week.E ) ) / Mov( P .10.C.E) . such as Dial Data." The following is the MetaStock formula for Sum(Mov( ( H . 10:6 (265-267): The Mass Index by Donald Dorsey "Range oscillation.If(DayOfWeek( )=5.12.1))*125)) (Go Top) Modified VIX Indicator The interpretation for the Modified Volatility Index was taken from the article Modifying The Volatility Index.8.Plot the formula for the Modified VIX directly on top of the OEX plot. if you want it calculated on any other day you would substitute a 1 for Monday.%))+(ROC(C. This can be done in MetaStock™ for Windows by using the following formula.Open the chart of the VIX.15 .E ) ) * ( 100 * 33 * 2 ) ) * ( Sqrt( 252 ) / Sqrt( 15 ) / C ) The steps to get the actual charts are: For the Windows versions of MetaStock: 1 . In other words if you wanted a 4 day moving average of Friday you would change the 30 to 4*5 or 20.9 . allows the technician to forecast market reversals that other indicators may miss.E). This formula assumes you can get the VIX information downloaded from some data vendor.0).Drag the plot of the OEX into the chart of the VIX.15 . **For interpretation of the Modified VIX refer to Mr.E).1)). 4 . and 4 for Thursday. Dorsey proposes the use of range oscillators in his mass index.-1)+((C-(Ref(Mov(C.E ) . delves into repetitive market patterns during which the daily trading range narrows and widens.12. -leap))))))))))).1). WkDayCount:= Int((DayNr+3)/7)+ {Mon} Int((DayNr+2)/7)+ {Tue} Int((DayNr+1)/7)+ {Wed} Int((DayNr)/7)+ {Thu} . If(Month()=12.13.334.com } ChkVol:=Input("Zero-volume days = missing data days? Yes=1. Missing trading days { Plots missing daily (weekday) bars count }{ ©Copyright 2003-2004 Jose Silva }{ josesilva22@yahoo. leap:=Frac(Year()/4)=0 AND Frac(Year()/100)<>0 OR Frac(Year()/400)=0. m:= If(Month()=2.120.E) > Mov(C.0).151.13.304.Mov(C. you may just want to use the 5 cross above the 40 and forget about the 13. NoCount:=limit*365+Int(limit/4) -Int(limit/100)+Int(limit/400)-LimLeap.1.40.31-leap.13. If(Month()=10.243.E)) Now you can play with these combinations on both the enter long and close long side. If(Month()=7. keep the same Enter Long but change the Close Long to: Cross(Mov(C.5.Mov(C. If(Month()=5. VolMissing:=If(ChkVol.V=0. If(Month()=3. You may want to enter when the 5 crosses above the 13 and not wait for the 40 OR.E) .5.0. If(Month()=9.40. No=0". {do not change limit year} LimLeap:=Frac(limit/4)=0 AND Frac(limit/100)<>0 OR Frac(limit/400)=0.273. If(Month()=8. If(Month()=11. If(Month()=6. If(Month()=4. y:=Year()*365+Int(Year()/4) -Int(Year()/100)+Int(Year()/400)-NoCount.181.5. Now choose new and enter the following system test rules and options: Signal Formulas Enter Long: Mov(C. limit:=1960.212. choose System Tester from the Tools menu.E) Close Long: Cross(Mov(C. For example.E) > Mov(C.E) ) This will keep you in the trade longer. DayNr:=y+m+DayOfMonth().E) AND Mov(C.59.To create the 2/20-Day EMA Breakout System by David Landry in MetaStock for Windows.E).90. H.1 }{ ©Copyright 2003-2004 Jose Silva } {
[email protected](x=6.midpt)-Cross(midpt..H.3.2.O.2-ratio.smooth)*4. x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5 P=6".MomNorm). Cum(MoSm2)/(Cum(MoSm2>-100)+. {Fri} WkDayCount-ValueWhen(2.000001))).normalized { Normalized Momentum v3.252.Cum(MoSm)/(Cum(MoSm>-100)+.V. x:=If(x=1.1. plot:=Input("Momentum=1. Cum(MomNorm)/Cum(IsDefined(MomNorm))).L..L.Mom. ratio:=Min(x.O.y)/Max(x.1.10). midpt.If(x=2.y)/Max(x.P. MoSm:=If(smooth<2. 1.pdsN)-LLV(Mom.Int((DayNr-1)/7). If(plot=2. y:=Ref(x.C))))).P.000001)*100. y:=Ref(x.If(x=5.1. plot:=Input("Momentum=1.-pds). If(plot=1.10).V. x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5 P=6".smooth)*10. MoSm2:=If(smooth<2..MoSm2). Mom:=If(x>y. If(plot=1.MomNorm).000001).com } pds:=Input("Momentum periods".If(plot=2.MomNorm) (Go Top.6.signals.If(x=3.pdsN)+. MomNorm:=(Mom-LLV(Mom.2520.) Momentum.2. midpt:=If(pdsN=1.Cum(Mom)/(Cum(Mom>-100)+. x:=If(x=1.MoSm2)) Natenberg's Volatility .0.) Momentum . signals:= Cross(MomNorm.Mom.4). Mom:=If(x>y.2520.1.y). LRS-smoothed { LRS-smoothed normalized Momentum v2 }{ ©Copyright 2003 Jose Silva }{ josesilva22@yahoo. MoSm:=LinRegSlope(Mom. midpoint crossover Signals=2".If(x=2..If(x=5. pdsN:=Input("normalizing periods (1=none)".If(plot=2.1. 1.WkDayCount)-1 +VolMissing (Go Top.pdsN)) /(HHV(Mom.ratio)*100-100.MoSm). MomNorm:=If(pdsN=1.C))))).-pds).If(x=3.2). Smoothed=2.4).10). Double smoothed=3".If(x=6.ratio)*100-100. MoSm2:=LinRegSlope(MoSm.1).com } pds:=Input("Momentum periods".1.2-ratio.63).2520.000001). smooth:=Input("LRS smoothing periods".MoSm.6.Mom. ratio:=Min(x.y).Mom. "Option Volatility & Pricing.(High-Close)) / (High-Low)) * Volume (Go Top) Overbrought/Over Sold Col A: CLOSE Col B: Fml("ob/os summation") Filter: Fml("ob/os summation") > 450 OR Fml("ob/os summation") < -50 Filter enabled: Yes Here is the "ob/os summation" formula: RSI(25)+Stoch(25.99) Column B HIGH-LOW<Ref(LLV(H-L.5)/Std(Log(C/Ref(C.10)*sqr(365/7) (Go Top) NR4 Formula from Trading Tactics page 100 Column A Std(Log(C/Ref(C.3)." he covers volatility in detail and gives the formula for computing historical volatility. Nat's Volt Std(log(c/ref(c." by Sheldon Natenberg.-1)). In MetaStock.-1)). 01/21/97 Historical volatility is defined by Sheldon Natenberg. the equivalent formula would be: Std( Log( C / Ref( C .-1)AND LOW>Ref(LOW.-1) Column C HIGH<(Ref(HIGH.10 ) * Sqrt( 365 / 7 ) The above assumes Weekly Data.-1) ).5 AND (colB= 1 OR colC= 1) One Day Money Flow The One Day Money Flow Indicator (some also call this indicator the One Day Accumulation/Distribution Indicator) MetaStock formula is the following: (((Close-Low) .10 ) * Sqrt( 365 ) For further interpretation refer to the book "Option Volatility & Pricing.3)+Mo(25)+CCI(25) . the MetaStock formula would be: Std( Log( C / Ref( C. Natenberg's book.-1 ) ) .-1)). To utilise this with Daily Data.-1)) Column D HIGH Column E LOW Filter colA<. as the standard deviation of the logarithmic price changes measured at regular intervals of time. In Mr.rev. Split Up+Down Vt=2.ratio)-1)*100.0 }{ Enters Long on high negative OVB Volatility }{ Exits Long on high positive OVB Volatility }{ Plot on own window below price chart }{ ©Copyright 2004 Jose Silva } {
[email protected]. odd:=Cum(1)/2=Int(Cum(1)/2).100.2-ratio.OBV(C).y)/Max(x.2)) -(flag=0 AND Alert(flag.0).If(plot=3.1.y). x:=Stdev(OBV(C).pds).VtUp. plot:=Input("plot: Normal Vt=1. VtUp:=If(x>Ref(x.2520. InInit:=Cum(In)=1.com } pds:=Input("Volatility StdDev periods".2. VtDw:=-If(x<Ref(x.0).Vt. .y). ratio:=Min(x.Vt)) OBV Volatility system { On Balance Volume Volatility system v1. y:=Ref(x.0). delay:=Input("Entry and Exit delay".-1). VtUp:=If(x>Ref(x. VtAvg:=Cum(Vt)/Cum(Vt>-1).1).If(plot=3.2.0 }{ Plot on own window below price chart }{ ©Copyright 2004 Jose Silva }{
[email protected]).-delay).-1). In1:=Cum(Cum(In))=1. Init:=Cum(In+Out>-1)=1. OBV=3".com } pds:=Input("Volatility StdDev periods".Vt. Out:=Cross(VtUp.10).2) OR flag AND Alert(flag=0. flag:=Ref(BarsSince(Init OR In) < BarsSince(Init OR Out)+InInit. VtDw:=-If(x<Ref(x.Vt. x:=Stdev(If(choose=1.pds).y)/Max(x.2520.-1). In:=Cross(-level. Out1:=Cum(Cum(Out))=1.-1).2.1.VtDw). trade binary=2". Close=2".OBV(C). ratio:=Min(x.-1).3. plot:=Input("plot: entry/exit signals=1. If(plot=2.-1).0. 2.ratio)-1)*100.1). signals:=(InInit AND Alert(InInit=0. If(plot=2. choose:=Input("base Volatility on: OBV=1.0.C). level:=Input("Threshold levels".VtAvg)).252). y:=Ref(x.5.1. Vt:=Abs(If(x>y.5).Vt.level).0). Vt:=Abs(If(x>y.0).OBV(C).(Go Top) OBV Volatility { On Balance Volume Volatility v1.0.2)). Ref(If(plot=1. tho you can modify it by selecting 1 for "Pds1" if you prefer to create a 120 day cumulative money flow indicator to do what you are suggesting.1.2 Filter: enabled Periodicity: Daily Records required: 5 (Go Top) Persistance of Money Flow Chaikin's Money Flow is a built-in MetaStock indicator.0.-2) {label 2 dy %} ColF:Sub(C.-1)) / Ref(C.Ref(C. If(plot=1.percent) • ROC(CLOSE.5.120). The Chaikin Money Flow Oscillator formula default uses a 21 day money flow sum divided by the 21 day sum of daily volume.If(odd.percent) • ROC(CLOSE.-delay)).flag.flag) Panic Selling sqrt(((buyp()/sellp())/rsi(2))) > ref(((buyp()/sellp())/rsi(2)).percent) • ROC(CLOSE. Sum((cmf(Pds1)>0).3. Pds2:= Input("PMF Periods?".2. 4. Good for finding breakout stocks.4. .percent) (Go Top) Performance Intra Day and Daily ColA:C {label CLOSE} ColB:O {label OPEN} ColC:Sub(C.-delay). • CLOSE • ROC(CLOSE.21). HHP sent the correct indicator formula for persistence.100. Rank results for the selected day.Pds2)/(Pds2/100) {from HHP} Persistence or (PMF%) is the percentage of days over 6 months that the Chaikin Money Flow Oscillator is above 0.dy%} ColD:Sub(C.percent) • ROC(CLOSE.10.Ref(C. 2.-1) {label 1 dy %} ColE:Sub(C.-3)) / Ref(C.1. The cumulative money flow indicator often uses a 90SMA trigger.1000.O) / O {label Intr.3 AND C>.0). and 5 days.-3) {label 3 dy %} Filter: O>.Ref(C. -(plot=1 AND Ref(Out1 AND BarsSince(In1) >=BarsSince(Out1). as follows: cmf(periods) Persistence of Money Flow (PMF%) Pds1:= Input("CMF Periods?".-1) (Go Top) Performance Daily Stocks sorted on % gains over 1.0)).2 AND C<.In1.-2)) / Ref(C. If(plot=1. 3.signals. 9).5. crossing.2) +1). See Michael B.PREVIOUS).2.-1)<Ref(H. Botbox.1. high. "Getting Better Directions" Futures Vol.2)) / Sum( Sqr( Pwr( ROC(C.-4) AND Ref(H.100). MAP:=Input("Moving Average Period". and selling pressure down one day.$).5. (Go Top) Price Action Indicator (PAIN) If you were only given today's open.1).Periods).-3) AND Ref(H. I have stuck it in different things at different times.2) + Pwr( 10.-3) AND Ref(H.-9). Geraty (1997).-3) AND H< Ref(H.PREVIOUS).9.144.9.-3).Ref(H. (Go Top) Plotting Forward Days I want an indicator that will project an exponential moving average into the next period (i. Botbox:=If(Ref(H. The equation is based on the MetaStock manual.-4) AND Ref(H.2)+1). ValueWhen(1. PAIN ((C-O)+(C-H)+(C-L))/2 (Go Top) Price and Volume Breakout . EPX:=2/(MAP+1).$).$).-2)<Ref(H. MA2:=(TC*EPX)+(MA1*(1-EPX)). Late Selling Pressure (LSP) (C-L).Cum(1)=LastValue(Cum(1)). The formula returns a single value that weighs intra-day momentum (C-O).-Sqr( Pwr(ROC(C.0. MA1:=Mov(C.MAP. but it will not plot on the forward day. 26: Aug. how could you make heads or tails of it? The Price Action Indicator (PAIN) can help. TC:=Input("Tomorrow's close". It will just plot the point where tomorrow's EMA would be.-3)>=Ref(HHV(H. The output is shown to be consistent with the interpretation of Japanese candlestick patterns.1.4).e..2)) / Sum(Sqr(Pwr(ROC(C. draw tomorrow's line).Periods).-3).E) I use a 80.55). Topbox.9)) * 100. 35.001. page 459.2) + Pwr(10.E).-3) AND H< Ref(H.-2)<Ref(H.LLV(L.(Go Top) PFE Indicator Mov(If(C > Ref(C. Right now I have it crossing -80 with MACD 4. The formula below may be close to what you want.-3)>=Ref(HHV(H. It would be really spiffy if I could pl ug in tomorrow estimated/projected close and be able to adjust the indicator based on various projected closes. and Late Buying Pressure (LBP) (C-H).-1)<Ref(H.260.$).-3). low and close. The formula is proven by constructing ideal limit-up and limit down scenarios in bond futures.MA2) (Go Top) Presto's Magic Box (a tweaked version of the Darvis Box) Periods:=Input("periods". concerning exponential moving averages. -80 trendline.1. RSI(9) up one day. Topbox:=If(Ref(H. Sqr( Pwr( ROC(C.1000. 30.S)*2)+ (Mov(ROC(C.S)*4).EXPONENTIAL) • ((VOLUME .S) ColD: Name: KST-1 Ref( (Mov(ROC(C.%).5) (Go Top) Pring's Daily KST Buy Notes: KST BUY SIGNAL FROM BELOW ZERO ColA: Name: Close CLOSE ColB: Name: KST (Mov(ROC(C.TPH3.10.TPH2.%). PL.10.30.10.%). TPL3:=(H+L+2*C)/2-H.%).S)*4).10. TPH3:=(H+L+2*C)/2-L.%).S)*1)+(Mov(ROC(C.10.%).15.10.0))).10.S)*3)+(Mov(ROC(C.10.30.S).%).>.TPL1.1.15.%).10.-1) Filter: When(colB.10.10.10.%).colE) (Go Top) Projected Range From "Lyn Maine" This is Tom DeMark's Projected Range: TPH1:=(H+C+2*L)/2-L.S)*4) ColC: Name: KST MA Mov((Mov(ROC(C.%).15.S)*1)+(Mov(ROC(C.%). • CLOSE • Ref(CLOSE. PH:=If((C<O).15.S)*2)+ (Mov(ROC(C.15.50.10.50.If((C=O).20.10.Shows stocks where the price increased 5% and the volume is 50% above a 50-day moving average.50.S)*2)+ (Mov(ROC(C.TPH1.If((C>O).20.EXPONENTIAL)) * 100 • **When(colC> = 5) AND When(colD >= colE*1.%). TPH2:=(2*H+L+C)/2-L. PH.15. TPL2:=(2*H+L+C)/2-H. then check the volume.%).20.<.10.20.If((C>O). Rank results by % change in price.0)AND When( colD.15.10.S)*4).percent) • VOLUME • Mov(VOLUME.S)*1)+(Mov(ROC(C.-1) • ROC(CLOSE.<. This is my updated version of Tushar Chande's Vidya .S)*2)+ (Mov(ROC(C.colC)AND When(colB.S)*3)+(Mov(ROC(C.0))).S)*1)+(Mov(ROC(C.S)*3)+(Mov(ROC(C.S)*3)+(Mov(ROC(C.%).%).If((C=O). PL:=If((C<O). TPL1:=(H+C+2*L)/2-H.15.TPL3.%).EXPONENTIAL)) /Mov(VOLUME.-1) ColE: Name: MA KST-1 Ref(Mov((Mov(ROC(C.10.10.Mov(VOLUME.TPL2.30. 75)). If((ROC(C.12.9. S3:= Stdev(CMO(C. Vidya.3.Vidya: K:=Stdev(P.E). SC:=0.(((H-L)*1.If((ROC(C. S2:= Stdev(CMO(C. This is Tushar Chande's target price: A:=Mov(Abs(C-Ref(C. TPH1:=C+A. This is a CMO Composite Average: (((CMO(C.12. This is ATR Ratio to Close: ATRR:= ATR(5)/C.10). TPH2.5).1..5*K. Vidya:=SC*K*C+(1-SC*K)*Ref(C.%)>4.-1)).%)>-3).5).S).%)>-4. Vidya:=SC*K*P+(1-SC*K)*Ref(P. Vidya.((H-(H-L)*2. LowerBand:=Vidya-2*.10))+(S3*CMO(C.10). MATRR:=Mov(ATRR.%)>-1.%)>3).10. {the sc input is more responsive if you use a higher number} This is Vidya with volatility bands: K:=Stdev(C.5))+(S2*CMO(C.5)/Mov(Stdev(C.20). TPL2. TPL1:=C-A. TPL2:=C-(2*A).20))/(S1+S2+S3).5))+(CMO(C. LowerBand.33)+L)).-1).5).20.5).-1).75)+L).20)))/3) This is CMO Volatility: S1:= Stdev( CMO(C..5).(((H-L)*3.5))).S). TPL1.((H-(H-L)*3.5)+L)).((H-(H-L)*1.10))+(CMO(C. TPH2:=C+(2*A).5)/Mov(Stdev(P.12. If((ROC(C..%)>1.12.12. UpperBand:=Vidya+2*. CMOV.5).20. CMOV:=(S1*CMO(C. ATRR.5).12.20). SC:=Input("SC".1). MATRR.(((H-L)*2. This is Rule of 7 down objective: If((ROC(C.33))).(H(H-L))) This is rule of 7 up objective: If((ROC(C.S). ((H-L)+L)) .9.5*K.5). UpperBand.If((ROC(C. TPH1. 1.1. into the chart of the security and close the chart of the index.%). • Drag the price plot of the index you are comparing. HighVolatility := Input("High Volatility %".-1)+If(C>=Ref(C.-14).-1). In the Windows versions of MetaStock: To plot Alpha: • Create the custom formulas Alpha and Beta (see below for formula syntax).%))+(ROC(C.100.%))).1.1000. 100 * Sum(100 * ATR(1)/CLOSE > HighVolatility. • Drag the custom indicator Alpha from the Quick List and drop it onto the price plot of the index.-13). **Note.50).1.1.1.E).-1)+ If(C>=Ref(C.1.2.19.1.-1).-16).E).-17).5).W) This is Volatility%: Lookback := Input("Time Periods".1.1. To change the time periods replace each instance of 21 in the formula with the .-1)+((C-(Ref(Mov(C.-15).-18).12. **Maximize the security chart if needed.ROC(C. **The custom indicator named Beta is required to plot Alpha.-1))) / (C/(Ref(Mov(C.12.12.-1)+If(C>=Ref(C.-20).-1)+If(C>=Ref(C.-12). Lookback)/Lookback This is Positive Volume Indicator: Cum(If(V>Ref(V.-11)..-1)+If(C>=Ref(C.0)) This is negative volume indicator: Cum(If(V<Ref(V.%)) (Go Top) Plotting Alpha and Beta To plot Alpha and Beta in MetaStock follow the steps below.%).-1)+ If(C>=Ref(C.0)) (Go Top) Percent Above/Below Moving Average (oscp(1.-1)+ If(C>=Ref(C.1.-1))/C) This is Chande's Trendscore: If(C>=Ref(C.1.E).01.30.1))*125)) This is Morris Double Momentum Osc: Mov(((ROC(C.ROC(C. **The index plot will turn a purplish color when you are plotting on top of it.1.8. this formula is set to calculate Alpha over 21 periods.This is rule of 7 Osc: Fml("Rule of 7 UP Objective") Fml("Rule of 7 DOWN Objective") This is %f Osc: 100*((C-Ref(TSF(C.10.-19).-1)+If(C>=Ref(C.-1) This is McGinley Dynamic: Ref(Mov(C.-1)+If(C>=Ref(C. • Open a chart of the desired security.E.12.3). E) (Go Top) Price Oscillator Wave if(ref(oscp(3.1 . Here is the custom formula for creating the five-period smoothed 10-day PFE using MetaStock: Mov(If(C.$).2)) / Sum(Sqr(Pwr(Roc(C.21 ) .2) + Pwr(10. but for those with neither the time nor the inclination to master the techniques necessary to monitor every blip and sputter that the market produces may be served just as well by noting only two very important market variables: price and volume. ( Sum( ROC( CLOSE .21 )) Pwr( Sum( ROC( INDICATOR . The old adage about keeping things simple applies even to the investment world. Methods of analysis such as polarized fractal efficiency and price oscillator divergences do a great job.0) (Go Top) Price Volume Rank Taken from Stocks & Commodities.9.% ) .2 ) .1 .$). ( ( 21 * Sum( ROC( CLOSE . V.1.%).1 . 12:6 (235-239): Price-Volume Rank by Anthony J.% ) * ROC( INDICATOR .9).%) . • Drag the price plot of the index your comparing.1 .1.% ) .9))*100.1 .2)) / Sum(Sqr(Pwr(Roc(C.desired number of periods and also change the time periods in the Beta custom indicator.0. Anthony Macek explains.S.% ) . Macek "Imagine receiving a warning when the market was likely to collapse or being alerted when one of your favorite stocks was about to rally. Note.% ) .<.2)+1).2 )) **Beta is a measure of volatility of one security against another.% ) . You need to create all of the following custom formulas in order for the PV Rank to calculate properly.1 .2) + Pwr(10. this formula is set to calculate beta over 21 periods. A value greater than one indicates the stock is more volatile than the index. into the chart of the security.-9).>.Ref(C.1 .-1).21 ) . To change the time periods replace each instance of 21 in the formula with the desired number of periods.1. (Go Top) Polarized Fractual Efficiency The January 1994 issue of Stocks & Commodities featured an article by Hans Hannula on Polarized Fractual Efficiency." For interpretation refer to the June 94 issue of Technical Analysis of Stocks & Commodities.$).1.5.Sqr(Pwr(Roc(C. using just two pieces of information found in virtually any newspaper? Is this a dream? Maybe not.21 ) ) ) / 21 To plot Beta: • Open a chart of the desired security. P-V Rank: .21 ) ) ( Sum( ROC( CLOSE . • Drag this custom indicator from the Quick List and drop it onto the price plot of the index.Sqr(Pwr(Roc(C.$).( Fml( "Beta" ) * Sum( ROC( INDICATOR.15.2)+1).% ) . This is typically used to measure the volatility of a stock against an index like the S&P 500.21 ) ) ) / ( (21 * Sum( Pwr( ROC( INDICATOR .21) * Sum( ROC( INDICATOR .9. What if these signals came from analysis that was simple enough to do without a computer and took only a few minutes a day to update. 3.18.3 . For this example.4 .S) > Ref(Mov(C.10) Close Long Cross(Mov(C.-1) AND Mov(P.S)).-1 ) .Mov(C.> .25.S) AND Alert(Cross(Mov(C. The selected plot tells the MetaStock System Tester what to use for "P".3.25. choose System Tester from the Tools menu.If( V .If( V .If( C . Next.19))/ (HHV(PVT().18. You will need to select the T-bonds plot each time before running a system test. little squares appear on the price bars).Ref( C .S) < Ref(Mov(C.S)).-1 ).S). and then New to create a new system. 5.Ref( C .Ref( C .> .-1) AND Mov(P.S) < Mov(P. open two charts.Ref( V .19)-LLV(PVT().< .0 ) ) . Your currency chart should now have T-bonds plotted in the top inner window of the chart. I used the Swiss Franc.-1 ) .S).9.Mov(C.0 ) ) (Go Top) Price Volume Trend Stochastic {Fast line} Mov((PVT()-LLV(PVT(). one of the desired currency and the other of Treasury bonds.> .If( V . Click on the T-bonds plot in the currency chart so it's selected (that is.< .Ref( C .< .0 ) ) .S).6.S).18. and options and then run the test. • • Initial equity Points Only Positions: Long and short .9.6.6.0 ) ) .-1 ) .< .Ref( V .18. Enter the following system rules.3 .> .-1 ) .Ref( V .S). Drag the T-bonds price bar and drop it on the heading of the currency chart.Mov(C. Signal Formulas Enter Long: Mov(C.19))/ (HHV(PVT().S)) Stops Maximum Loss Stop: Long and short positions Maximum loss of 0.S) AND Alert(Cross(Mov(C.If( V .Ref(V .2 .-1 ) .< .0 ) PV Biggie: (This combines all formulas into one formula) If( C .1 .If( V .2 .4 .19)).If( V . stops.Ref( V .10) Close Short Cross(Mov(C. 5.Fml( "PV1" ) + Fml( "PV2" ) PV1: If( C .Ref( V .If( V . S) {Slow Line} Mov(Mov((PVT()-LLV(PVT().-1 ) .Ref( V .Mov(C.016 points.Ref( V .9.19)-LLV(PVT().If( V .6.1 .> .S)) Enter Short Mov(C. S).-1 ) .-1 ) .-1 ) .19)).S) (Go Top) Pathfinder Trading System To recreate the Pathfinder currency trading system (described in the October 1996 interview with Nelson Freeburg) in MetaStock for Windows.3.0 ) ) .9.< .-1 ) .S).-1 ) .S) > Mov(P. Choose Tile from the Window menu so both charts are visible.> .0 ) PV2: If( C . PsychIndex. dummy:=Input(" (3) Monthly.1.LookBack) / LookBack * 100.4))).0). If(m=4 OR m=5 OR m=6. LThreshold (Go Top) Periodicity detector { Chart periodicity detector }{ References indicator "Calendar Week counter" }{ ©Copyright 2003-2004 Jose Silva } {
[email protected]. 0.0). Yr:=Cum(Year()<>ValueWhen(2. ".Wk)))=0. {FortnightCount:=Int((Wk+1)/2).Mth)))=0.2. UThreshold.0. Qtr:=Cum(q<>ValueWhen(2. chart:=If(LastValue(Cum(Yr=ValueWhen(2.m)). Mth:=Cum(m<>ValueWhen(2.1.q)).032 for the British Pound and 0.0.5. chart:=If(LastValue(Cum(Qtr=ValueWhen(2. 12). (2) Weekly.48 There was an overbought/oversold indicator described in the June 2000 Futures Magazine called the Psychological Index. UThreshold:= Input("Upper threshold (%)".1. 0). Vol. 100.• Trade price: Open • Trade delay: 1 Note that the maximum stop loss amount should be changed to 0. so I wrote the MetaStock code for it: LookBack:= Input("Number of lookback periods".chart). (Go Top) Psychology Index by Glenn Wallace .com } dummy:=Input("Chart detected: (1) Daily.0.chart). 100.1). q:=If(m=1 OR m=2 OR m=3. It looked sort of interesting.29 No. P.3.0.02 for the Australian and Canadian dollars when testing these contracts.-1). 1.Futures Magazine. Wk:=Fml("Calendar Week counter"). chart:=If(LastValue(Cum(Wk=ValueWhen(2.1. 25).4. 75). If(m=7 OR m=8 OR m=9. PsychIndex:= Sum(UpDay.1.3. (4) Quarterly.Qtr)))=0. 100.1.1. UpDay:= If(CLOSE > Ref(CLOSE.1. 2. chart Periodicity detector app example {Chart periodicity detector application example}{Automatically adjusts EMA to chart periodicity}{ References indicator "Calendar Week counter" }{ ©Copyright 2003-2004 Jose Silva } {
[email protected]())).6.chart).com } Wk:=Fml("Calendar Week counter"). LThreshold:= Input("Lower threshold (%)". chart:=If(LastValue(Cum(Mth=ValueWhen(2. 0. June 2000. .} m:=Month().Yr)))=0. (5) Yearly". 1. leap:=Frac(Year()/4)=0 AND Frac(Year()/100)<>0 OR Frac(Year()/400)=0. Ema:=x*2/(pds+1)+PREV*(1-2/(pds+1)).181.Year())).0.4))).3.3. NoCount:=limit*365+Int(limit/4) -Int(limit/100)+Int(limit/400)-LimLeap.m)). Crossover signals=2".If(x=5.P.pds).L.1.1. pds:=If(chart=1. If(m=4 OR m=5 OR m=6. pds:=If(pds>Cum(IsDefined(x)). m:= If(Month()=2.O.pds).212. If(Month()=5.59.x).If(x=2.1.Qtr)))=0.1. shift:=1+Input("EMA vertical shift %".126).1.C))))).pds/63. q:=If(m=1 OR m=2 OR m=3. If(chart=3.1).100.H.120.If(chart=2. Cum(IsDefined(x)). If(Month()=8. x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5 P=6". Qtr:=Cum(q<>ValueWhen(2.5.signals. signals:=Cross(x.1).pds/252)))).chart).31-leap.com } limit:=2000. If(Month()=6.6. x:=If(x=1.25200.1.chart). chart:=If(LastValue(Cum(Qtr=ValueWhen(2.V.pds/21. If(Month()=4.Ema)-Cross(Ema. plot:=Input("EMA=1.chart). y:=Year()*365+Int(Year()/4) -Int(Year()/100)+Int(Year()/400)-NoCount. If(Month()=3.6). chart:=If(LastValue(Cum(Wk=ValueWhen(2.2. chart:=If(LastValue(Cum(Yr=ValueWhen(2.1.If(chart=4.4. -100. .1. If(plot=2. Ema:=Ema*shift.Ema) Calendar Week counter { Week counter v2. If(Month()=7.q)).2.1.0)/100.} m:=Month(). Yr:=Cum(Year()<>ValueWhen(2.1. {do not change limit year} LimLeap:=Frac(limit/4)=0 AND Frac(limit/100)<>0 OR Frac(limit/400)=0.pds. Gregorian calendar }{ Count is independent of any missing chart data }{ ©Copyright 2003-2004 Jose Silva } {
[email protected]/5.151.If(x=3. pds:=If(pds<1. chart:=If(LastValue(Cum(Mth=ValueWhen(2. Mth:=Cum(m<>ValueWhen(2.Wk)))=0.If(x=6. pds:=Input("daily EMA periods". If(m=7 OR m=8 OR m=9.Yr)))=0.2.1.{Frt:=Int((Wk+1)/2).Mth)))=0. If(Month()=9,243, If(Month()=10,273, If(Month()=11,304, If(Month()=12,334, -leap))))))))))); DayNr:=y+m+DayOfMonth(); WkCount:=Int((DayNr-1)/7)+(Year()>=limit); WkCount Rally Gap and Inside Day Finds stocks which have rallied, gapped upwards, and then had an inside day. Usually leads to a resumption of the rally. The search returns 1 for Ok and 0 for not ok. • RallyWithVol() • Inside() • GapUp() (Go Top) Range High Looks for out of range move where the close equals the high. Suggests more buying pressure. The search returns 1 for Ok and 0 for not ok. • BigWhite() • CLOSE • (Go Top) {Recursive Moving Trend Average} Lb:=Input("Look-Back Period?",3,100,21); Alpha:=2/(LB+1); Bot:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+C; RMTA:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+ (Alpha*(C+Bot-Ref(Bot,-1))); RMTA; {TOSC} Lb:=Input("Look-Back Period?",3,100,21); Alpha:=2/(LB+1); Bot:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+C; RMTA:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+ (Alpha*(C+Bot-Ref(Bot,-1))); TOSC:=RMTA-Mov(C,lb,E); TOSC; Is the name of an article in the December issue of TASC, written by Dennis Meyers. In it he describes what he calls " The Recursive Moving Trend Average" . I wont go into all the article right now, but here is my translation of his math (for Metastock 6.5) : {Recursive Moving Trend Average} Lb:=Input("Look-Back Period?",3,100,21); Alpha:=2/(LB+1); Bot:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+C; RMTA:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+ (Alpha*Abs(C+Bot-Ref(Bot,-1))); RMTA; He then explains how to make an oscillator by subtracting an Exponential MA form the Recursive MA...... again here is the code: {TOSC} Lb:=Input("Look-Back Period?",3,100,21); Alpha:=2/(LB+1); Bot:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+C; RMTA:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+ (Alpha*Abs(C+Bot-Ref(Bot,-1))); TOSC:=RMTA-Mov(C,lb,E); TOSC; Here is the code for System Testing; Buy Long: Lb:=opt1; ent:=3; Alpha:=2/(LB+1); Bot:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+C; RMTA:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+ (Alpha*Abs(C+Bot-Ref(Bot,-1))); TOSC:=RMTA-Mov(C,lb,E); Cross(tosc,(0-Abs(ent))) Sell short: Lb:=opt1; ent:=3; Alpha:=2/(LB+1); Bot:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+C; RMTA:=(1-Alpha)*(If(Cum(1)<Lb,C,PREV))+ (Alpha*Abs(C+Bot-Ref(Bot,-1))); TOSC:=RMTA-Mov(C,lb,E); Cross((0+Abs(ent)),tosc1) Opt1 is the look- back periods, of 3 to 30, and Opt2 is the entry value of the oscillator, 0 to 5. Now, after all the hours spent on figuring out the code, I have discovered that the RMTA plots very similar to the DEMA, oh well............ (Go Top) Regression Asymmetric Volatile Price Band SIGNAL FORMULAS Enter Long: Periods := 21; UpperBand := STEBandTop(CLOSE,Periods,1) ; Sum(CLOSE > UpperBand,3) = 3 AND LinRegSlope(CLOSE,21)> 0 AND ROC(Correl(CLOSE,Cum(1) ,21,0),2,$) >= .2 Close Long: Periods := 21; LowerBand := STEBandBot(CLOSE,Periods,1.5) ; SellSignal1 := Sum(CLOSE < LowerBand,3) = 3; SellSignal2 := CLOSE < (1-.18) * HHV(HIGH,Periods + 1) AND HIGH < LowerBand; SellSignal1 OR SellSignal2 STOPS Maximum Loss: LONG ONLY 10.00 Percent (Go Top) Resistance and Support LookBack := Input("Look Back Periods",1,1000,10); Resistance :=ValueWhen(1,Cross(Mov(C, LookBack, S),C),HHV(H, LookBack)); Support :=ValueWhen(1,Cross(C,Mov(C, LookBack, S)),LLV(L, LookBack)); Resistance; Support; (Go Top) Resistance and Support *F PrCnt:=Input("Percentage",0,100,10); LookBack:= Input("Look Back Periods",1,1000,10); Resistance:=ValueWhen(1,Cross(Mov(C,LookBack,S),C),HHV(H,LookBack)); Support:=ValueWhen(1,Cross(C,Mov(C,LookBack,S)),LLV(L,LookBack)); Resistance * ((100-prcnt)/100); Support * ((prcnt/100)+1); (Go Top) ROC Moving Average System Test ENTER LONG: ROC(Mov(C,12,E),1,%)>0 AND ROC(Mov(C,60,E),1,%)>0 EXIT LONG: (ROC(Mov(C,12,E),1,%)<0 AND ROC(Mov(C,60,E),1,%)>0) OR (ROC(Mov(C,12,E),1,%)>0 AND ROC(Mov(C,60,E),1,%)<0) SHORT: ROC(Mov(C,12,E),1,%)<0 AND ROC(Mov(C,60,E),1,%)<0 EXIT SHORT: (ROC(Mov(C,12,E),1,%)<0 AND ROC(Mov(C,60,E),1,%)>0) OR (ROC(Mov(C,12,E),1,%)>0 AND ROC(Mov(C,60,E),1,%)<0) {Ref(c,-1) gives yesterday's close today. So all values are shifted to the right!} (Go Top) RSI and Moving Averages {place in filter section} C>MOV(C,5,E) AND C>MOV(C,200,E) AND CROSS(RSI(14),30) (Go Top) RSI Divergence {RSI(9) DIVERGENCE BUY:} If(RSI(9) >= HHV(RSI(9),19) AND CLOSE <HHV(CLOSE,19), 1,0) OR If(CLOSE <= LLV(CLOSE,19) AND RSI(9) > LLV(RSI(9),19), 1,0) {RSI(9) DIVERGENCE SELL:} If(CLOSE >= HHV(CLOSE,19) AND RSI(9)<HHV(RSI(9),19),1,0) OR If(RSI(9) <= LLV(RSI(9),19) AND CLOSE > LLV(CLOSE,19),1,0) {You can substitute any formula for the "RSI(9)"} (Go Top) RSI Divergence Exploration {A simple exploration filter formula for finding a bullish divergence between the RSI and the price is shown below. To find a bearish divergence, replace > with <. The differences in the trough function was found through an optimization routine and they may not be the best values for your application.} Ref(RSI(14),-1)>Trough(1,RSI(14),.8) AND Ref(CLOSE,-1)<Trough(1,CLOSE,.2) (Go Top) RSI Offset RSI(13) - 50 {offset the RSI to +-50} (Go Top) Ruggerio's Trend Ruggiero's rules for trend mode quoting his table 4.9: 1. If ADX crosses above 25, then the market is trending. 2. If ADX crosses below 20, then the market is consolidating. 3. If ADX crosses below 45 from above, then the market is consolidating. 4. If ADX rises from below 10 on 3 out of 4 days, then the market will start to trend. 5. If a trend is based on rule 4, it remains in effect until the 5 day difference in ADX is less than 0. Ruggiero employs a 14 day ADX but that is based on T-Bonds data. He suggests employing the above rules as a filter. I make the indicator take the value +1 if trending, a -1 if consolidating according to the above criteria but I guess the zero is for the grey area in between. Anyway according to definition: If a market is not trending it must be consolidating. However the zero may contain additional useful information. Ruggiero suggests tweaking the threshold values. periods:=Input("Periods?",1,63,14); If((ADX(periods)>25 AND (BarsSince(Cross(45,ADX(periods))) > BarsSince(Cross(ADX(periods),25)))) OR (ADX(periods) > 10 AND Ref(ADX(periods),-4)<10 AND (ADX(periods)-Ref(ADX(periods),-5)>0)), 1, If(ADX(periods)<20 OR ((BarsSince(Cross(45,ADX(periods)))< BarsSince(Cross(ADX(periods),25))) AND ADX(periods) < 45),-1,0)) (Go Top) Random Walk Index The following formulas, for the Random Walk Index, were constructed using information from the article "Are There Persistent Cycles", by E. Michael Poulos, in the September 1992 TASC. All formulas are needed. MetaStock Windows versions: Random Walk Index: Max( ( Ref(HIGH,-1) - LOW ) / ( ( Ref(Sum (Atr ( 1 ) ,2 ),-1) / 2) * Sqrt( 2 ) ) ,Max( (Ref(HIGH,-2) -LOW) / ( ( Ref(Sum (Atr ( 1 ),3),-1) / 3) * Sqrt( 3 ) ), Max( (Ref(HIGH,-3) - LOW) / ( (Ref(Sum (Atr( 1 ) ,4) ,-1) / 4) * Sqrt( 4 ) ) , Max( ( Ref( HIGH,-4) - LOW) / ( (Ref(Sum(Atr( 1 ),5),-1) / 5) * Sqrt( 5 ) ), Max( (Ref(HIGH,-5) - LOW) / ( (Ref( Sum( Atr ( 1 ),6),-1) / 6 ) * Sqrt( 6 ) ), Max( ( Ref(HIGH,-6) -LOW) / ( (Ref( Sum( Atr( 1 ),7),-1) / 7) * Sqrt( 7 ) ), Max((Ref(HIGH,-7)-LOW) / ( (Ref(Sum (Atr( 1 ),8),-1) / 8) * Sqrt(8) ), (Ref(HIGH,-8)-LOW) / To create horizontal lines. CLOSE))/ ValueWhen(1.This will only work in MetaStock™ for Windows 95/NT version 6.63)-1) Slope/Close 10000* LinRegSlope(CLOSE.0 it’s easy to create the Regression Oscillator and the Slope/Close Indicator from Richard Goedde’s article.1. you can drag it out of the Indicator Quicklist for placement in an inner-window of your chart. Month1 := Input("Month". On the Horizontal lines page add horizontal lines at 14.5 (or higher) or in MetaStock Professional.ValueWhen(1.63)/CLOSE Next drag each of these formulas from the Indicator QuickList and drop them on the heading of a chart. and -14.1).4). giving it the name shown below in bold. 100 * (CLOSE .DayOfMonth() = Day1 AND Month() = Month1 AND Year() = Year1. click the right mouse button while the mouse pointer is positioned over the Regression Oscillator to display the shortcut menu.9).2400.CLOSE) (Go Top) Regression Oscillator and Slope/Close Indicator In MetaStock 6. You can use The Explorer to perform the screen mentioned in the article.1999).( (Ref(Sum (Atr (1). 0. All the text after "FORMULA:" and before "*END OF FORMULA*" below should be placed in the Formula field in the Indicator Builder. "Market timing with the regression oscillator".31. First choose Indicator Builder from the Tools menu and enter the following formulas: Regression Oscillator 100 * (CLOSE/ LinearReg(CLOSE. The user is prompted for the specific date. Year1 := Input("Year".12. Choose Regression Oscillator Properties. Construct the formula in the Indicator Builder. Once the indicator has been created.-1) / 9) * Sqrt( 9 ) ) ) ) ) ) ) ) ) (Go Top) Rate of Change Since a Specific Date The following formula plots a percent rate of change between a specific date and today. First choose The Explorer from the Tools menu.DayOfMonth() = Day1 AND Month() = Month1 AND Year() = Year1.1900.1. which appears in the March 97 issue of Technical Analysis Stocks and Commodities magazine. NAME: ROC Since a Date FORMULA: Day1 := Input("Day". next create a new Exploration with the following information: Column A Name: Reg Osc Formula: Fml("Regression Oscillator") Column B Name: Slp/Cls Formula: Fml("Slope/Close") Filter Formula: ColB > 50 and ColA >-15 and ColA < -5 . x users the instructions are the same except enter the following custom indicator in place the ones mentioned earlier.$).LastValue(Q)) . 100-(100/(1+RS)) (Go Top) Relative Volatility Index (RVI) The following formulas were taken from the article "The relative volatility index.LastValue(Q)).1.63)) / (63 * Sum(Pwr(Cum(1).Wil ders(If(ROC(O.63) .Wilders(If(ROC(V.63. Readings above 50 indicate that the volatility as measured by the 10day standard deviation of the closing prices is more to the upside.1.1.2)))/CLOSE (Go Top) Relative Strength Index (RSI) Custom This custom RSI will allow you to select which price data to use when you plot it. If(B=4.63)) / (63 * Sum(Pwr(Cum(1). RS:=Z/Y.63) .14).1.2).0).$)).1.1.LastValue(Q)).$)>0.Pwr(Sum(Cum(1). 11:6 (253-256): The Relative Volatility Index by Donald Dorsey "The RVI is simply the relative strength index (RSI) with the standard deviation over the past 10 days used in place of daily price change.Wilders(If(ROC(C.If(B=4. Regression Oscillator 100 * (CLOSE/ ((63 * Sum(Cum(1) * C.ROC (L.2).Sum(Cum(1). $)<0.Pwr(Sum(Cum(1).1000.0).0).63) Pwr(Sum(Cum(1).Wilders(If(ROC (O.63)) / (63 * Sum(Pwr(Cum(1).Abs(ROC(V.Choose OK and then Explore to run the Exploration.LastValue(Q)))))).0).1). B:=Input("Field: 1=Close.Abs(ROC(L.0).1.If(B=3.$ )).Mov(Cum(1).LastValue(Q)).1.Sum(Cum(1). Readings below 50 indicate that the direction of volatility is to the downside.63).$)<0. Taken from Stocks & Commodities.1.ROC(C.Wilders(If(ROC(H.$)).1.$)0.ROC(O. 3=High.63) * Sum(C. The initial testing indicates that the RVI can be used wherever .5.ROC(V. Because most indicators use price change for their calculations. Y:=If(B=1.2)) * Cum(1) + (Mov(C.$).1.1.1. 2=Open.Sum(Cum(1).Abs(ROC(O.0)LastValue(Q)).1. 4=Low.ROC(H.1.$)> 0.If(B=2.1.$).LastValue(Q)).0).1. For MetaStock for Windows 5.If(B= 2.0).Wilders(If(ROC(H.1. in the June 93 issue of Technical Analysis of STOCKS & COMMODITIES.$)>0 .1. This custom indicator will allow you to use the other price fields including volume. The standard RSI uses the close value as Welles Wilder did when he created the indicator.Wilders(If(ROC(V. Z:=If(B=1.Wilders(If(ROC(L.Abs (ROC(H.63.63) .$)). we need a confirming indicator that uses a different measurement to interpret market strength.2).63)." written by Dorsey.S) * (63 * Sum(Cum(1) * C.If(B=3.1.1.$).63) .$)>0.LastValue(Q)). V.63) .LastValue(Q)))))). Donald.0 ).$)< 0. 5=Volume".2))))-1) Slope/Close 10000* ((63 * Sum(Cum(1) * C.$).LastValue(Q)).$)).1.Abs(ROC(C.63).S) .$)>0.63) * Sum(C.Wilders(If(ROC(C. Q:=Input("Time Periods". The RVI measures the direction of volatility on a scale of zero to 100.$)<0.0).63) * Sum(C.Wilders(If(ROC(L. 12.%)>3). Change the colour of this moving average as desired. as stated above.(((H-L)*1.10).0).%)>-4.75)). If you dropped it correctly the Parameters dialog should say ‘Indicator’ for the Price Field. It calculates price strength by measuring volatility rather than price change. Continue this until you have ten moving averages.C. (Go Top) Rule of 7 Oscillator Rule of 7 Down Objective If((ROC(C. ((H-L)+L)) Rule of 7 Oscillator Fml("Rule of 7 UP Objective") Fml("Rule of 7 DOWN Objective") (Go Top) Rainbow Charts To create Rainbow Charts in MetaStock for Windows.5).5)+L)). All of the following formulas are required: @RVI Down ((PREV*13)+If(ROC(C.12.C. and drop it in the same inner windows as the price bars. Note: The r-squared indicator is built into MetaStock for Windows version 6.33)+L)).12.%)>-1.14.14.12.1. Enter two for the Periods and simple for the Method. Chande & Kroll introduce the r2 indicator.12." The RVI was designed to measure the direction of volatility.If((ROC(C.2) They also present a smoothed r2 which would be: Mov(Pwr(Corr(Cum( 1 ). If((ROC(C.0))/14 @RVI (100*Fml("@RVI Up"))/(Fml("@RVI Up")+Fml("@RVI Down")) (Go Top) R-squared. . Click OK to accept two periods and simple as the parameters.0 and later.(((H-L)*2. open any chart.(((H-L)*3.75)+L).1.10).If((ROC(C.(H(H-L))) Rule of 7 Up Objective If((ROC(C.33))). Now plot a third moving average of the second moving average by repeating these steps.Stdev(C.%)>1.5))).12.5).14.2)*100.%)>4.0))/14 @RVI Up ((PREV*13)+If(ROC(C. but the specific purpose of this study is to measure the RVI's performance as a confirming indicator.you might use the RSI and in the same way. If((ROC(C. Next plot a second moving average on the first moving average by dragging a moving average from the QuickList and dropping it on the first moving average (Note: The first moving average should turn light purple before you release the mouse button). They state that "the primary use of r2 is as a confirming indicator" and that "it is a lagging indicator that shows the strength of the trend.Stdev(C.%)>-3).5).S) For interpretation refer to Chande & Kroll's book.%)<0.5).((H-(H-L)*1. Chande and Kroll's In their book The New Technical Trader.0).((H-(H-L)*2." In MetaStock the r2 formula is: Pwr(Corr(Cum( 1 ). drop the moving average indicator from the Indicator QuickList.%)>0. Choose Yes if MetaStock prompts you about plotting a duplicate indicator.((H-(H-L)*3. 2.S). Rainbow Max Max(Mov(C.2.2.S).S). Max(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C.S).S).2.S).S).2.S).2.S).2 .S).S).2. Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C.S).2.2.2.S).S).S).S).2. Min(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C.2.2.S).2.2.2.2.2.2.S).2.2. Min(Mov(Mov(C.2 .S).S). Min(Mov(Mov(Mov(C.S).2.S).2.S).2.2.S).S).2. Download this file to the Charts folder (e.S).2.S). Max(Mov(Mov(Mov(Mov(Mov(Mov(C.S).S).2.S).2.2.2.S).S).S).S).2.2.2.S).S).S).S).2.2. S).S).S).S).2.2.2.S).S).2.2.2.((Mov(C.2.S).S).2. Max(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C. Min(Mov(Mov(Mov(Mov(Mov(Mov(C.S).2. 2.2.2.S).S).S).2.S).2.2.2.S).2.S)))))))))) Rainbow Oscillator 100 * (CLOSE . Max(Mov(Mov(Mov(Mov(C.S).S)))))))))) Rainbow Min Min(Mov(C. Max(Mov(Mov(Mov(C.2.2.2.S).g.2.S).S).S).2.2.2.S).S). Min(Mov(Mov(Mov(Mov(C.S).S). Choose Apply Template from the Chart Shortcut menu and choose the Rainbow Chart template.2.S).2.To save you time.S). Open any chart and then click on your right mouse button while the pointer is located on the chart.S).S).S).S) + Mov(Mov(Mov(Mov(Mov(Mov(C.S).S).S).S) + Mov(Mov(Mov(Mov(Mov(C.2.2.S).2 .2.S).S).S).2.2. Min(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C.2. You can download this template directly off of the Equis web site.S).2.S).S).2.2.2.S).S).S).S).S).2.S).2.S).2.2. Min(Mov(Mov(Mov(Mov(Mov(C. Next choose Indicator Builder from the Tools menu and enter the following formulas.2.2.2.S).2.2.S). S).2.S).S).S).2.2.S).2.S).2.S).S).S).S).S).2. Max(Mov(Mov(C.S). Equis have created a template that allows you to bypass these steps.2.2.2. Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C.S)+ Mov(Mov(Mov(C.S).S).2.S).2.2.2.S).S).2.2.2.2.2.2. Max(Mov(Mov(Mov(Mov(Mov(C.2.2.S).S) + Mov(Mov(Mov(Mov(C.2. You should now have a chart with ten different coloured moving averages.S).2.2.2.2.S).S).S).2.2.2. Min(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C.S).S).S).S).S).2.2. C:\Program Files\Equis\MetaStock\Charts) in your MetaStock folder. Max(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C.2.2.2.S).S).S).S).2.S).S).2.2.S)+ Mov(Mov(C.S).S) .S) + .S).2.2.2.S).2.2.2 .S).2.2.2.2. 2.S).2.34) < opt2 AND LLV(LinRegSlope(C.2. S)+ Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C.S).34) < opt1 Enter Short: Alert(RSquared(C. Now save this as a new template by choosing Save As from the File Menu and changing the File Type to template.S).2.5) = LLV(TSF(C.13) AND HHV(MFI(55).5) = HHV(LinRegSlope(C.5) = LLV(MFI(55).2. Now plot the Lower Rainbow Band and the Upper Rainbow Band in the same inner window as the Rainbow Oscillator.S).34).S).LLV(C. If the scaling dialog appears when plotting these indicators.S)+ Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C.S) .5) = LLV(LinRegSlope(C.34).34).S).15. (Go Top) Regress Slope/Money Flow Index/Time Series Forecast A series of four trading systems.55).S). Regress Slope: Signal Formulas Enter Long: Alert(RSquared(C. 1.10) .2 .S).2.2.S).2.LLV(C.55).10)) Upper Rainbow Band 100 * (Fml("Rainbow Max") .21) AND LinRegSlope(C.5) = HHV(MFI(55).S).S).2.21) < 0.S). by dropping the custom indicator from the QuickList onto the chart’s heading.10) .2.2.2.144).2.S).S).2.S)) /10))/(HHV(C. using the Regress Slope as basis and combining with other indicators.2.15.5) = HHV(TSF(C.2.S).13) AND LinRegSlope(C.2.2.2 .S).’ Change the colors of the Upper and Lower Rainbow Bands as desired.2. Right click on the Rainbow Oscillator and choose properties.2.2. so you can easily apply it to any chart.2.S).2.13) Close Long: LLV(TSF(C.2.2.S).S).144).144).13) Close Short: HHV(TSF(C.5) = HHV(TSF(C.S).S).13) AND LLV(MFI(55).2.Fml("Rainbow Min")) / (HHV(C.S).2.2.13) AND HHV(TSF(C.55).21) < 0.2.Fml("Rainbow Min")) / (HHV(C.5) = LLV(TSF(C.S).13) Optimization Variables .13) AND LinRegSlope(C.34) > opt1 AND HHV(LinRegSlope(C.10)-LLV(C.13) AND LLV(TSF(C.Mov(Mov(Mov(Mov(Mov(Mov(Mov(C.S).2.S)+ Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C.S).2. choose ‘Merge with Scale on Right.34).S). then change the Style to a histogram.144).S).10)) Lower Rainbow Band -100 * (Fml("Rainbow Max") .S).2.10)) Plot the Rainbow Oscillator in a new inner window of your chart with the ten moving averages.S).55). 00 Step = 0.34).55) > 0 AND C = HHV(C.00 Step = 0.5) = HHV(Qstick(55).13) AND LinRegSlope(C.34) < opt1 AND Qstick(55) < opt1 AND C = LLV(C.13) AND CMO(C.13) AND C=HHV(C.00 Step = 0.5) = .10 Max = 0.13) AND CMO(C.10 STOPS: ALL OFF 2.34) > opt1 AND HHV(LinRegSlope(C.55) < 0 AND C = LLV(C.15.21) < 0.10 OPT2: Min = -0.5) = LLV(LinRegSlope(C.34).10 STOPS: ALL OFF 3.34).15.5) = HHV(LinRegSlope(C. Regress Slope/CMO .20 Max = 0.34).21) AND LinRegSlope(C.5) Optimization Variables OPT1: Min = -0.10 OPT2: Min = -0.21) < 0.5) Close Long: LinRegSlope(C.34) > opt1 AND HHV(LinRegSlope(C.21) < 0.15. Regress Slope/Qstick .55) < 0 AND C = LLV(C.34).34).5) Close Long: LinRegSlope(C.OPT1: Min = -0.34) > opt2 AND CMO(C.5) Close Short: LinRegSlope(C.5) Enter Short: Alert(RSquared(C.21) < 0.34) < opt2 AND LLV(LinRegSlope(C.20 Max = 0.All: Signal Formulas Enter Long: Alert(RSquared(C.34) < opt2 AND LLV(LinRegSlope(C.15.55) > 0 AND C = HHV(C.13) AND LinRegSlope(C.21) AND LinRegSlope(C.34).34) < opt1 AND CMO(C.13) AND Qstick(55) > opt1 AND HHV(Qstick(55).(OHLC Rqd): Signal Formulas Enter Long: Alert(RSquared(C.10 Max = 0.00 Step = 0.5) = HHV(LinRegSlope(C.5) Enter Short: Alert(RSquared(C. All: Signal Formulas Enter Long: Alert(RSquared(C.55).144).10 OPT2: Min = -0.10 Max = 0.00 Step = 0.34).1 }{ Internal sine-weighted smoothing } { Automatic historically-valid RSI peak/trough boundaries}{ Boundary crossover signals: +1=Long.5) Close Long: LLV(TSF(C.10 STOPS: ALL OFF (Go Top) RSI.5) = HHV(TSF(C.21) AND LinRegSlope(C.00 Step = 0.13) AND C = HHV(C.5) Close Short: HHV(TSF(C.144).21) < 0.55).13) AND C = HHV(C.5) = HHV(TSF(C.10 OPT2: Min = -0.13) AND C = LLV(C. sine-weighted smoothed { Smoothed RSI indicator v1.com } .34).34) > opt2 AND Qstick(55) > opt2 AND C = HHV(C.10 Max = 0.10 STOPS: ALL OFF 4.55).15.5) Close Short: LinRegSlope(C.13) AND C = LLV(C.5) = HHV(CCI(55).13) AND HHV(CCI(55).144).00 Step = 0.5) Optimization Variables OPT1: Min = -0. -1=Short}{ ©Copyright 2004 Jose Silva } {
[email protected]).5) = LLV(LinRegSlope(C.34) > opt1 AND HHV(LinRegSlope(C.5) = LLV(Qstick(55).13) AND LLV(TSF(C.55).144).13) AND LinRegSlope(C.20 Max = 0.5) = LLV(TSF(C.10 Max = 0.5) = LLV(TSF(C.5) = HHV(LinRegSlope(C.34) < opt1 AND CCI(55) < 0 AND C = LLV(C. Regress Slope/CCI/TSF .13) AND LinRegSlope(C.5) Enter Short: Alert(RSquared(C.34).13) AND Qstick(55) < opt2 AND LLV(Qstick(55).13) AND CCI(55) > 0 AND HHV(TSF(C.15.5) = LLV(CCI(55).00 Step = 0.LLV(LinRegSlope(C.34) < opt2 AND LLV(LinRegSlope(C.13) AND LLV(CCI(55).5) Optimization Variables OPT1: Min = -0.34).21) < 0. -2) AND Ref(RS. S2:=Sin(60)*Ref(dw.-1)>pkAvg.-1). signals:=up-dw. S1:=Sin(30)*dw. trVal:=ValueWhen(1. pkAvg:=Cum(pkVal)/Cum(pkVal>-1). dw:=PREV*(1-pds)+y*pds.-1)-C.-1)>50}. dw:=(s1+s2+s3+s4+s5)/(Sin(30)*2+Sin(60)*2 +Sin(90)).2) {AND Ref(RS.Ref(RS.-1)<RS AND Alert(Ref(C.-2). s5:=Sin(30)*Ref(up.} .-1). { RSI up/down average components } x:=If(C>Ref(C.pk. signals:=up-dw. s3:=Sin(90)*Ref(up.-1)<Ref(C.-1)>RS AND Alert(Ref(C.-1)<C.10). y:=If(C<Ref(C.-2) AND Ref(RS.-1)<Ref(RS.1).-1). { RSI peak/trough boundary cross signals } up:=Cross(trAvg.-1)>Ref(C.{ user input } pds:=1/Input("RSI periods".1. dw:=Cross(RS.-2) AND Ref(RS.0).-1)). S5:=Sin(30)*Ref(dw.-1)).tr.-4).-1)>Ref(RS. pkVal:=ValueWhen(1. S3:=Sin(90)*Ref(dw.-1)<50}.-2) AND Ref(RS. dw:=Ref(RS. RS:=100-100/(1+up/dw).-1)>Ref(RS.1. up:=PREV*(1-pds)+x*pds.C-Ref(C.-1). { alternative RSI peak/trough signals } {up:=Ref(RS.-1)>C.2.-3).2520. S4:=Sin(60)*Ref(dw.. { RSI indicator } dw:=If(dw=0.2) {AND Ref(RS.dw).000001.-1)<Ref(RS. trAvg:=Cum(trVal)/Cum(trVal>-1). [2]-Long/Short signals".RS). up:=(s1+s2+s3+s4+s5)/(Sin(30)*2+Sin(60)*2 +Sin(90)).-2). { automatic RSI peak/trough boundaries } pk:=Ref(RS.-3).-1)>RS AND Ref(RS. { sine-weighted internal smoothing } s1:=Sin(30)*up.-2) AND Ref(C.0).Ref(RS. s2:=Sin(60)*Ref(up.Ref(C.-2) AND Ref(C.-1). tr:=Ref(RS.-1)<trAvg. s4:=Sin(60)*Ref(up.pkAvg). plot:=Input("plot: [1]-RSI.-4).-1)<RS AND Ref(RS. plot:=Input("plot Stoch-RSI=1.If(x=6. z:=(100-x)/2.0)1.traderhelp. pds2:=Input("Stochastic periods".2.3.pds2)+. none = 0". Sell signal: -1}{Smaller signals: secondary buy/sell events} {user input} x:=Input("Frequency of random trades (0-100%)".10).dll from http://www.Number".If(x=5.4).50).252.L.C))))).Rs.0).If(x=3.signals) (Go Top) RSI .1000000. 0. x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5 P=6".5 }{ ©Copyright 2001-2004 Jose Silva } {
[email protected] { Stochastic-normalized RSI v1.seed). Sell:=y<50-z. {trade organizer} Init:=Cum(Buy+Sell>-1)=1.trAvg.pds2)-LLV(Rs.0 }{
[email protected] and place in MetaStock External Function DLLs folder} {Plot indicator in its own window below price chart & refresh screen to generate new trades} {Buy signal: +1.} StochRsi:=(Rs-LLV(Rs. Buy:=y>50+z.pds1).RS. .V. If(plot=2.pds2))/ (HHV(Rs. x:=If(x=1.P. both=3".com } {Download Random.21).0.0).1).{ plot } If(plot=1.com } pds1:=Input("RSI periods".If(x=2.6.H.1.StochRsi) (Go Top) Random trade generator { Random trade generator v2.000001)*100.Rs. use:} {Rs:=RSI(pds1).2. {trade generator engine} y:=ExtFml("Random. RSI=2.pkAvg.100. If(plot=1. Rs:=RSI(x. If(plot=3. If(plot=1.2.O. BuyInit:=Cum(Buy)=1. {MetaStock versions earlier than v7. seed:=Input("Randomizer seed = 1~1000000.1.63). -2).1. Buy & Hold: +$22.25 years of data (2075 days).PREV-1. a negative descending ones and zero unchanged ones} If(C>Ref(C.-1) 0)))) AND AND AND AND Ref(C.-1)>Ref(C.2)).540 (-75. Avg test period: 8.-1)<Ref(C.(BuySm-SellSm)*. Tested on 475 ASX All Ords stocks.5%) avg profit per stock ====== Random entry (10% of max signals) set at seed 1 5% Trailing StopLoss exit Exit 4: +$647 (+6.flag:=BarsSince(Init OR Buy) <BarsSince(Init OR Sell)+BuyInit.-1) If(C<Ref(C. Ref(C.-1) If(C<Ref(C.-1)>=Ref(C. A positive number indicates ascending close prices.4%) avg profit per stock ========== Random entry (10% of max signals) set at seed 1 Random exit (10% of max signals) set at seed 1 Exit 2: -$10. $10K starting capital for each stock.-1)<=Ref(C.-1) If(C>Ref(C. SellSm:=Sell AND signals>-1. $34 brokerage each way.2)) -(flag=0 AND Alert(flag. Ref(C.794 (-107. {signals display} 0. .-2).699 (+227%) avg profit per stock Entry on Open of day one Exit on Close of last day Strategy 1: -$7.2) OR flag AND Alert(flag=0.3.PREV+1. Ref(C.-2).-1.signals Random Strategy market test report Market Trade $ Profit test for four random strategies. 1% Entry/Exit Slippage.9%) avg profit per stock ====== Random entry (10% of max signals) set at seed 1 2% Trailing StopLoss exit Exit 3: -$6. as at Close Fri 23/01/2004.5%) avg profit per stock ====== Random entry (10% of max signals) set at seed 1 10% Trailing StopLoss exit ame Direction {It returns the number of periods the close is moving in the same direction. signals:=(BuyInit AND Alert(BuyInit=0.-2).851 (-68. BuySm:=Buy AND signals<1. or moving. then release. as you say. Walter Downs The Shark exit signals don't appear to be all that good. a 3-month display. Change the left-hand chart from Daily to Weekly. (Go Top) Setting up the ADX Template This constructs the template mentioned in the ADX article of the October 1999 issue of TASC by Paul Babbitt. maybe standard CCI(13) with 200 and -150 triggers. Make sure the loaded dates range starts earlier. You could use price breaking below certain moving averages. or maybe Parabolic SAR. The levels are set by the high and low in the shark pattern. such as CCI. Set the displayed range of dates to what you want. For the right-hand chart. 1. 1996 to 1999. (Go Top) Shark-32 System. 2. say. With long trades.average crossovers. Click the Margin tab and set the margin to 1. In some cases. e. using a "Clean" template. and there's no guarantee it'll occur when the trend reverses. so that the two overlapping charts are displayed. Chart your stock/index/whatever. in the third window in the chart I sent. Drag the Bollinger Band indicator to the right-hand chart. On the menu bar. The two charts will then be displayed side-by-side. too -. but the signals appear to be too few and far between to rely on them for sell signals for long trades. From the Indicator drop-down list select Moving Average and drag it to the left-hand chart. click Windows. . Drag the Directional Movement ADX indicator to the top of the righthand chart until the cursor changes to a box. Seems like entry but no exits in Shark.g. and the close must break through them within 25 days of the signal. 7. leave it at a daily interval but set the X-Axis as in paragraph 3 above to. 6.This formula might be useful as a component of other indicators. the sell signals provide good opportunities for short-selling. A 40 period on the weekly chart corresponds to a 200 day MA. you'd have to look to other indicators. Similarly drag the RSI indicator to the bottom of the right-hand chart. were really just alerts showing that the shark pattern had occurred on those days. then Columns. then do the same again. systems or explorations. Right click on the date scale and select X-Axis. 3. 4. rather than as a stand-alone indicator. 8. 5. The shark pattern signals. The shark system is based on the close rising above levels set when the shark pattern occurs. The Shark pattern occurs too infrequently.. Set the horizontal lines as desired. " To get a buy signal.-1) AND L>Ref(L.-2))). The idea behind the system is: Look for a three-bar shark pattern.-2))=1. you can do it with the "BuyOK" part of the Metastock formula by plotting this in the Expert Adviser: Symmetry:=.25).-1)>Ref(L. If you want to plot "sharkhigh" over a chart with the price. to be honest. Sometimes the stock doesn't break above it.-1)>Ref(L. The high on the first day of the pattern sets that high point.Shark=1.-2)).} Chk:=Cum(Buyok)-ValueWhen(1. {try Buyok:=ValueWhen(1. Buy:= Buyok=1 AND Ref(Chk. which may indicate an expansion in price to come.28. based on progressively smaller ranges.Shark=1." Also.0). But the breakout doesn't always occur.0).-1)<Ref(H.Ref(H. { try Ref(L. Apex:=(H+L)/2. the price has to close above that level within 25 days. The Shark pattern shows consolidation.-2)). Shark:=If((H<Ref(H. From: Brooke For the pattern in the Indicator Builder: Symmetry:=. which is the high(-2). I didn't include sell signals in the chart I sent earlier today.-2)-Ref(L. The buy signals were shown in the second window of the chart I sent. WB:=Ref(H. so there's no signal.-2)-(WB*Symmetry)) AND Apex >= (Ref(L. In the scan.ValueWhen(1.Cum(Buyok)). in other words. the signals are marked by green arrows over the price plot in the first window of the chart.28. Buy OR Ref(Buy.-1)=0 AND ValidChk=1.-2) OR Ref(Buy. there's a sell signal. The system gives a signal if and when the stock breaks above the high point in the pattern over the next 25 days. It looks like a shark fin.Shark=1.The shark pattern. Buyok:=Cross(C.Ref(H. If the stock breaks below the low point in the pattern. The Shark system is really based on two separate events: the occurrence of the pattern and then the signal.-4) OR Ref(Buy. .-2). I call that level "Sharkhigh. In the case of MU.-3) OR Ref(Buy.1. the sell signals weren't very good. without the "=1"} If(apex <= (Ref(H.-1) AND Ref(H. isn't a buy or sell signal.-1) OR Ref(Buy. The window is labeled "Shark buy signal. a level is set by the highest point in the fin. set by the highest point in the shark fin. ValidChk:=Alert(Shark=1. The pattern isn't the signal.-2)+(WB*Symmetry)) .-5).-2) AND Ref(L. Once that pattern appears. It's like a resistance level. WB:=Ref(H.-2))=1.20. That's like a resistance level that the price has to break through.28.5. and enter "3rd Bar" in the Name field. TASC 10/1998 Equis First. Next.If(Apex <= (Ref(H.S)>Mov(C.-2)-(WB*Symmetry)) AND Apex >= (Ref(L. choose Expert Adviser from the Tools menu in MetaStock 6.S)<Mov(C.-1) AND L>Ref(L.-2) AND Ref(L. Using the same method as above.1. Bearish: Mov(C.-2)+(WB*Symmetry)) .0).Walter T. choose New and enter the following formulas: Name: Click the Name tab and enter "Shark – 32" in the Name field.S).-2) AND Ref(L.-1)>Ref(L.-1) AND L>Ref(L.0).-1) AND L>Ref(L.-1)>Ref(L. enter the following formula in the Condition field. enter the following 2 highlight formulas.28. Shark.-2)-Ref(L. Shark:=If((H<Ref(H.-2).0). Bullish: Mov(C. choose New.Apex:=(H+L)/2. Now change the color in the Color field to Blue.-2) AND Ref(L.-1) AND Ref(H. It lasts for 25 days or until a new Shark signal appears.5.-1) AND Ref(H.If(Apex <= .20. WB:=Ref(H.-2)-(WB*Symmetry)) AND Apex >= (Ref(L.-1)<Ref(H.-2).-2)-Ref(L.0).1. and then choose OK. Apex:=(H+L)/2.-1) AND Ref(H. Shark – 32 .-1)>Ref(L.-1)<Ref(H. If((H<Ref(H.-2).-1)<Ref(H.-2)-Ref(L.-2)). Finally.-2)+(WB*Symmetry)) . Trends: Click the Trends tab and enter the following formulas in the Bullish and Bearish fields. Shark:=If((H<Ref(H. Down. Symmetry:=. Name: 2nd Bar Color: Blue Condition: Symmetry:=. Apex:=(H+L)/2.-2))=1. Combining Statistical and Pattern Analysis.S). WB:=Ref(H.5. If(apex <= (Ref(H. Highlights: Click the Highlights tab. -2)+(WB*Symmetry)) .-2). You can change the number of periods by changing 25 to the number of periods you desire. .0).-2)-Ref(L.-2))=1. enter the following Symbol formula.1.+2)=1. Apex:=(H+L)/2.+1)=1.-1) AND L>Ref(L.-2)+(WB*Symmetry)) .0).0). WB:=Ref(H.Shark=1. WB:=Ref(H. Symbols: Click the Symbols tab.-2)-(WB*Symmetry)) AND Apex >= (Ref(L.-2)-(WB*Symmetry)) AND Apex >= (Ref(L. Apex:=(H+L)/2. Apex:=(H+L)/2.Ref(H.-1)>Ref(L.-2)-Ref(L. Ref(Shark.-2)+(WB*Symmetry)) . Ref(Shark.(Ref(H.-2) AND Ref(L. Now enter the following formula in the Condition field.If(Apex <= (Ref(H.1. Name: 1st Bar Color: Blue Condition: Symmetry:=.-2))=1. {Note* The above ValidChk variable makes the Shark signal valid for 25 periods. Using the Same method as above.-2) AND Ref(L.-2)-(WB*Symmetry)) AND Apex >= (Ref(L. Symmetry:=.1.0).-2). Click the Graphic tab.1.-1)<Ref(H.25).Shark=1. Shark:=If((H<Ref(H.0). choose New and enter "Shark Buy" in the Name field.-2)+(WB*Symmetry)) . Name: Shark Sell Condition: Symmetry:=.0). Buyok:=Cross(C.-1)=0 AND ValidChk=1.-1)>Ref(L.If(apex <= (Ref(H.-2)-Ref(L.28.-1) AND Ref(H.-1) AND L>Ref(L.28.-2))=1. Shark:=If((H<Ref(H.-1)<Ref(H. type "Buy" in the Label field. Shark:=If((H<Ref(H.ValueWhen(1.-2) AND Ref(L. WB:=Ref(H.If(apex <= (Ref(H. If the price does not cross above the High value of the base within 25 periods. *} Buy:= Buyok=1 AND Ref(Chk. ValidChk:=Alert(Shark=1.0).-1)>Ref(L.-1) AND L>Ref(L.-1) AND Ref(H.-1) AND Ref(H.28.-2).-2)-(WB*Symmetry)) AND Apex >= (Ref(L.-2))).0).Cum(Buyok)). Chk:=Cum(Buyok)-ValueWhen(1. and then choose OK. Now change the color in the Color field to Green. you will not receive a signal. Buy.-1)<Ref(H. Change the symbol in the Graphic field to Buy Arrow. Finally. *} Sell:= Sellok=1 AND Ref(Chk. You can change the number of periods by changing 25 to the number of periods you desire. Chk:=Cum(Sellok)-ValueWhen(1. you will not receive a signal.55).-2)). Sell.-1) AND L>Ref(L.28.15.5) = LLV(TSF(C. -1) + 2.(Vol Rqd) Enter Long: Alert(RSquared(C. If(apex <= (Ref(H.34).-2)-Ref(L.-2)+(WB*Symmetry)) .Shark=1. WB:=Ref(H. I've never used a time series moving average so I'm kind of out of my league.13) AND .0).Cum(Sellok)).13) AND HHV(TSF(C. but I guess it could look like this: TSMA:= Mov(CLOSE.21) AND LinRegSlope(C.21) < 0. {simply place the above in the filter section} (Go Top) Shifted TSMA Indicator You could use the Reference (Ref) function to shift your indicator back in time and you could add or multiply by a constant or variable to give your indicator a vertical shift.-1)<Ref(H.5) = HHV(MFI(55). ShiftedTSMA (Go Top) Signal Formulas MetaStock for Windows System Tester 01_R2/Regress Slope/MFI/TSF . ShiftedTSMA:= Ref(TSMA.TIMESERIES).15.0).-1)=0 AND ValidChk=1.-2)-(WB*Symmetry)) AND Apex >= (Ref(L.-2).55).21) < 0. If the price does not cross below the Low value of the base within 25 periods.34). If((H<Ref(H. {Note* The above ValidChk variable makes the Shark signal valid for 25 periods.-1) AND Ref(H.-2)).34) > opt1 AND HHV(LinRegSlope(C.25). Apex:=(H+L)/2.13) Close Long: LLV(TSF(C.C).-2) AND Ref(L.13) AND LinRegSlope(C.-1)>Ref(L.Ref(L.Shark=1.55). ValidChk:=Alert(Shark=1.5) = HHV(LinRegSlope(C.34) < opt1 Enter Short: Alert(RSquared(C.55).13) AND HHV(MFI(55).1. Symbol: Sell Arrow Color: Red Label: Sell (Go Top) Shark Pattern Symmetry:=.Sellok:=Cross(ValueWhen(1.5) = HHV(TSF(C.5. 21) < 0.34).5) Enter Short: Alert(RSquared(C.21) < 0.55) > 0 AND C = HHV(C.34).34) < opt2 AND LLV(LinRegSlope(C.55) > 0 AND C = HHV(C.20 Max = 0.5) = LLV(TSF(C.LinRegSlope(C.144).10 Max = 0.5) Close Short: LinRegSlope(C.144).5) Close Long: LinRegSlope(C.13) AND CMO(C.20 Max = 0.00 Step = 0.15.144).10 Max = 0.13) AND LLV(TSF(C.10 OPT2: Min = -0.21) < 0.5) = HHV(TSF(C.13) AND CMO(C.5) = HHV(LinRegSlope(C.34) > opt1 AND HHV(LinRegSlope(C.34) < opt2 AND LLV(LinRegSlope(C.5) = LLV(LinRegSlope(C.55) < 0 AND C = LLV(C.00 Step = 0.34) < opt1 AND CMO(C.13) Close Short: HHV(TSF(C.5) OPTIMIZATION VARIABLES OPT1: Min = -0.34).21) AND LinRegSlope(C.34).13) OPTIMIZATION VARIABLES OPT1: Min = -0.55) < 0 AND C = LLV(C.34).10 STOPS ALL OFF 03_R2/Regress Slope/Qstick .13) AND Qstick(55) > opt1 AND .34).(OHLC Rqd) SIGNAL FORMULAS Enter Long: Alert(RSquared(C.13) AND LinRegSlope(C.13) AND LLV(MFI(55).21) AND LinRegSlope(C.5) = LLV(LinRegSlope(C.144).34) > opt2 AND CMO(C.5) = HHV(LinRegSlope(C.5) = LLV(MFI(55).34).34) > opt1 AND HHV(LinRegSlope(C.15.15.All SIGNAL FORMULAS Enter Long: Alert(RSquared(C.10 STOPS ALL OFF 02_R2/Regress Slope/CMO .00 Step = 0.00 Step = 0.34).10 OPT2: Min = -0. 144).5) Enter Short: Alert(RSquared(C.34) > opt1 AND HHV(LinRegSlope(C.5) = HHV(TSF(C.5) = HHV(LinRegSlope(C.15.21) < 0.13) AND LLV(CCI(55).5) = LLV(LinRegSlope(C.34) < opt1 AND CCI(55) < 0 AND C = LLV(C.HHV(Qstick(55).5) Close Short: LinRegSlope(C.34).34).5) = HHV(TSF(C.13) AND C=HHV(C.13) AND C = HHV(C.34).00 Step = 0.34) > opt2 AND Qstick(55) > opt2 AND C = HHV(C.5) Close Long: LLV(TSF(C.5) = LLV(CCI(55).55).34) < opt2 AND LLV(LinRegSlope(C.13) AND C = HHV(C.55).10 OPT2: Min = -0.144).5) = LLV(TSF(C.5) .13) AND C = LLV(C.34).5) = LLV(Qstick(55).10 Max = 0.13) AND LLV(TSF(C.13) AND C = LLV(C.13) AND LinRegSlope(C.13) AND Qstick(55) < opt2 AND LLV(Qstick(55).34) < opt2 AND LLV(LinRegSlope(C.5) = LLV(TSF(C.34).5) Enter Short: Alert(RSquared(C.55).13) AND LinRegSlope(C.13) AND CCI(55) > 0 AND HHV(TSF(C.5) = LLV(LinRegSlope(C.All SIGNAL FORMULAS Enter Long: Alert(RSquared(C.5) = HHV(CCI(55).144).5) = HHV(Qstick(55).13) AND LinRegSlope(C.15.34) < opt1 AND Qstick(55) < opt1 AND C = LLV(C.15.13) AND HHV(CCI(55).5) OPTIMIZATION VARIABLES OPT1: Min = -0.21) AND LinRegSlope(C.21) < 0.34).00 Step = 0.5) Close Long: LinRegSlope(C.144).21) < 0.10 STOPS ALL OFF 04_R2/Regress Slope/CCI/TSF .5) Close Short: HHV(TSF(C.55).10 Max = 0. 45.-2).1415926.45.-45) ColumnB: Bottom Mov(Trough(1.S)-Ref(Mov(Trough(1.S).E).00 Step = 0. tp:=Input("Time Periods".21.21) < 1.10 STOPS ALL OFF (Go Top) Short term horizontal trading ranges exploration by Jim Greening HHV(C.-1). S2:=Sin(2*180/6)*Ref(C. Num:=S1+S2+S3+S4+S5.45.S) {place the formulas above in the filter section.21. .21).S)-Ref(Mov(Peak(1.1).-45) Filter: ColA < 1 AND ColA > -1 AND ColB < 1 AND ColB > -1 (Go Top) Sine Weighted Moving Average {from Equis} PI:=3.1*Mov(C. S3:=Sin(3*180/6)*Ref(C. (Go Top) SIROC Indicator From Elder ROC(Mov(C. It could also be used as a trailing stoploss method.1. S1:=Sin(1*180/6)*C. S4:=Sin(4*180/6)*Ref(C. Den:=Sin(SD)+Sin(2*SD)+Sin(3*SD)+Sin(4*SD)+Sin(5*SD). nothing else is required} (Go Top) Sideways Channels Exploration Periodicity: Daily Formulas ColumnA: Top Mov(Peak(1.L.H.200.21) > 0.%) (Go Top) Slope of a Linear Regression Line The following custom formula will return the slope of a Linear Regression Line.1).S).13.10 Max = 0.1).9*Mov(C.00 Step = 0.-3).S) AND LLV(C.L. Num/Den I use the peak and trough function in MetaStock to show support and resistance levels.20 Max = 0.10 OPT2: Min = -0. SD:=180/6.45.-4).H.21. S5:=Sin(5*180/6)*Ref(C.OPTIMIZATION VARIABLES OPT1: Min = -0.1). 5.5. If the MACD 1334-89 is above the zero line (purple line in window 2 above).5.S) (Go Top) Stochastic and RSI System Mov((RSI(8)-LLV(RSI(8).5.5.5.((tp*(Sum(Cum(1)*C.w)<75 and mov(stoch(55.5)+StochMomentum(8.in this index it had 4 out of 5 winning signals in two year period.1)+StochMomentum(4.-1)>75) enter short (mov(stoch(55.5.21). 2.21). then a "short" indication from the StochRSI may give better results.13)+StochMomentum(13.5.21). I have had much better results with this than the canned version that comes with every charting program.13)+StochMomentum(13.21).tp)))-(Sum(Cum(1). (Go Top) Stochastic MA System enter long mov(stoch(55.21).-1) and mov(stoch(55.w)*100 A formula like this works best with confirming indicators.21).-1) exit short mov(stoch(55.5.5.2)+StochMomentum(3.21).21).1)+StochMomentum(4.21).3.8))).2).w)>20 (Go Top) Stochastic Momentum SMI-Plex:= StochMomentum(2. trix(12)-ref((trix(12)).3.tp).w).5. TRIX.5.tp))))/ ((tp*Sum(Pwr(Cum(1).2.w).-1) and mov(stoch(55.2)+StochMomentum(3.21).35. it confirms and uptrend and the indicator is usually more accurate.2).8)-(LLV(RSI(8). Check this method out on your favorite issues.w)<75 and mov(stoch(55.tp))Pwr(Sum(Cum(1).2)) (Go Top) SPECIAL TRIX This is my own version of the well-known indicator.-1) (Go Top) Stix Indicator Mov((H+L)/2.2.25.3)+StochMome ntum(5.2) SMI13E-Plex:= Mov(StochMomentum(2.5.21).E) (Go Top) Stochastic Momentum Indicator .5.5.8))/(HHV(RSI(8).S)-Mov((H+L)/2.2.-1)>70) and mov(stoch(55.StochRSI 13 also gives excellent indicators. If the MACD 13-3489 is below the zero line.21).21).3) +StochMomentum (5.25.21).w).5. The time between signals is of course longer.w).5)+StochMomentum(8.1.w)<ref(mov(stoch(55.1.w).21.w)>ref(mov(stoch(55.tp)*(Sum(C.w)<75 and ref(mov(stoch(55.w)>ref(mov(stoch(55.w)<70 and ref(mov(stoch(55.w)>20 exit long (mov(stoch(55.21.13. 14))/((HHV(RSI(14).13))-LLV(RSI(21).14))) Mov((RSI(21)-LLV(RSI(21). get creative.19)-LLV(PVT().E).21))/((HHV(RSI(21). relatives. I use fast and slow "stochastic" lines to judge when either accumulation or distribution is taking place.13))/(HHV(RSI(13).E) / (.19)-LLV(PVT().2.13).19)).21))-LLV(RSI(21). I used a look back period of 19 days which fits my style. Experiment and determine which are most suitable for your style and markets.S) (Go Top) Stoch RSI Although I keep the best of the bunch as a "super secret" for friends. Signals are generated by the fast crossing above or below the slow lines. I have recently been using a volume indicator that I wrote myself in MetaStock's formula language. and clients .E)*100 (Go Top) . Price Volume Trend is similar to On Balance Volume.(. S).3.21))) ((RSI(14)-LLV(RSI(14).13))). S) {Slow Line} Mov(Mov((PVT()-LLV(PVT().13))).E))) (Go Top) StochPVT Indicators Though not directly related to the volume percent indicator.3.2.. It uses the same idea that Chande used to turn RSI into the StochRSI oscillator and the preprogrammed Price Volume Trend function.5). Formulas for the StochPVT are shown below: {Fast line} Mov((PVT()-LLV(PVT(). apply moving averages..8.E). 5.19)). I have not worked with it enough to say whether or not divergences offer signals too. These are just a few: ((RSI(21)-LLV(RSI(21).E)*100 Mov((RSI(5)-LLV(RSI(5).8)(LLV(RSI(21)+.{Appeared in the January 1993 issue of Stocks & Commodities magazine} 100 * ( Mov( Mov(C .14))-LLV(RSI(14). here is a smattering of formulae that might be useful.LLV(L.8))/((HHV(RSI(21).13))) ((RSI(21)-LLV(RSI(21).5))/(HHV(RSI(5).13) + LLV(L.13)(LLV(RSI(13). Substitute numbers.(LLV(RSI(5).13) .5*Mov( Mov( HHV(H.5 * ( HHV(H.25.5))).13))/(HHV(RSI(21). 5. except that as the volume is accumulated.3.E)*100 Mov((RSI(13)-LLV(RSI(13).25.00001. StoRSI's perform very differently when you plug in various numbers.19))/ (HHV(PVT().19))/ (HHV(PVT(). it is weighted according to the percent price change from the previous close.13))). Lb.-1).periodslong)+ATR(periodslong)..1.5).1.33) Any five day moving average will work. periodslong:=input("periods if long". October 1999.1.5. It is basically a momentum indicator and plots very similar to the "Chande Momentum Oscillator" with the main difference being the "StTO" doesn't seem to swing as far as the CMO.50.H. page 52. Mn:=If(Mov(Num.S)=0.Lb.10).{stop loss level for short positions} LLV(L..60. Den:=H-L.2) (Go Top) Support and Resistance Levels AVd:=If(CLOSE>Ref(Peak(1.1) .Mov(Den. (Go Top) Support and Resistance I wrote this MetaStock Expert for calculating the support 1& 2 and resistance 1 & 2 as per Futures magazine. I am not sure how the math is calculated for the CMO. but the (basic) math for the StTO is: (Close.10). (Mn/Md)*100 (Go Top) Starc Band STARC BAND Formula = (Mov(Typical().S)).S)) Starc Upper Band: Fml( "STARC BAND" )+ (ATR(15)*1. HHV(H.2) FIRST SUPPORT: WRITEVAL(-H+(2*(H+L+C)/3).-1).01.S)).1.50. FIRST RESISTANCE: WRITEVAL(-L+(2* (H+L+C)/3).periodsshort)-atr(periodsshort).01.2) SECOND RESISTANCE: WRITEVAL(((H+L+C)/3) +((-L+(2* (H+L+C)/3))-(-H+(2* (H+L+C)/3))).2) SECOND SUPPORT: WRITEVAL(((H+L+C)/3) -((-L+(2* (H+L+C)/3))-(-H+(2* (H+L+C)/3))).Lb.33) Starc Lower Band: Fml( "STARC BAND" )-(ATR(15)*1.S)=0.1.Yesterday's Close) /(H-L)} {Here is the MetaStock code I use:} {name: StTO} {Short-term Trend Oscillator} Lb:=Input("Smoothing Period?". Md:=If(Mov(Den. . Num:=C-Ref(C.Stop Loss Indicator periodsshort:=Input("periods if short".Mov(Num.Lb.1.1.{stop loss level for long positions} (Go Top) ST Oscillator {The StTO is really nothing unique. 5).-1).14 ) ) . SIMPLE)." EntryCondition:= {your trade entry conditions}. MA2:= Mov(CLOSE. BarsSince(EntryCondition >= 5) (Go Top) Short Volume Wave if(oscv(1.mp1).13).mp1)-LLV(CMO(c.{then}1.377. 20.50. this formula returns the slope of a 14 day run of the security's closing prices.1. Mov(Sum((CMO(c.14 ) * (Sum( C .0) (Go Top) Slope of a Line The following custom formula returns the slope of a line.14 ) ) ) .mp3).H.mp1).13)." MA1:= Mov(CLOSE.mp3)/Sum((. mp2)-(LLV(CMO(c. For example.%).-1).1).0). For example the slope of a 25 period simple moving average would be: .377. {then}-1. {else}0)).2 ) .377.1.14 ) . {else}If(CLOSE<Ref(Trough(1. mp3:=Input("Slowing Periods". SIMPLE). Ref(Cross(MA1.377.0000001+ (HHV(CMO(c. MA2).>.E)*100 (Go Top) System Test Examples from Glen Wallace "Buy at the open plus half the average true range of the last ten days?" HIGH >= OPEN + 0.0.1)).L.>.1.mp2)).L. SuRe. -1) (with System Testing Options | Testing tab | Entry Price set to "Open" and delay set to zero) "Exit five bars after entry. {else}Trough(1. buy on tomorrow's open.AVd<>0.1.mp1). -1) "If these two moving averages cross today. mp2:=Input("Stoch Periods".mp2)))).mp4.S. {StochCMO} mp1:=Input("RSI Periods". if(V.1. 14) ) ) ) / ( (14 * Sum(Pwr (Cum( 1 ) . SuRe:=If(ANv=-1.Pwr(Sum(Cum( 1 ) .1). {then}Peak(1. ANv:=ValueWhen(1. 10.1).2 ) ) To apply this to different lines you would replace C with the desired syntax for the line.AVd).5*Ref(ATR(10).(Sum(Cum( 1 ) . mp4:=Input("EMA Periods". ( (14 * (Sum(Cum( 1 ) * C .ref(V. Sum(Cum(1).21).21)).2).14) ) .21) * Sum(C.21))-(Power(Sum(Cum(1).Pwr(Sum(Cum(1). You could then plot the formula on top of any line.21).21)/21)))) /19)).21.21) .21)*Sum(C.2).Sum(Cum(1).2).21).21)*Sum(C.21)*Sum(C. 2 ).21)Pwr(Sum(Cum(1).Mov(Cum(1).14) * Sum(Mov(C.21)/21)))) /19)).(Sum(Cum(1).21)/21)) )/ ((Sum(Power(Cum(1).S) .14) / 14) ) / ( (Sum(Power(Cum(1).14 ) )-Pwr(Sum(Cum(1). 21)-(Power(Sum(C.21)) / (21 * Sum(Pwr(Cum(1).S) .S) * (21 * Sum(Cum(1) * C.14)*(Sum(P.2).21.((Sum(Cum(1).21)-Sum(Cum(1).21).S) 21 period R2 (smoothed): Mov((Pwr(Corr(Cum(1).21)) .21))-(Power(Sum(Cum(1).Sum(Cum(1).14 ) ) ) / ( (14*Sum(Pwr(Cum(1).21) .21)) / (21 * Sum(Pwr(Cum(1).S) 21 period Regression Slope: (((Sum(Cum(1)*C.2)/21)) *((Sum(Cum(1) *C.14).S).2).21)*Sum(C.2))) +2*(Sqrt(((Sum(Power(C.21) * Sum(C.21.14) ) ) .21) .2) .0).2)) * Cum(1) + (Mov(C.3.Mov(Cum(1).21))(Power(Sum(Cum(1).21) .25.21.3.21).2).21)/21) )) / ((Sum(Power(Cum (1). written by Jon Anderson.21).Pwr(Sum(Cum(1).( ( Sum(Cum(1) * Mov(C.2) .21.21).2))) 2*(Sqrt(((Sum(Power(C.S).21) .21) .21) * Sum(C.2)/21)) -((Sum(Cum(1)*C.21))-((Sum(Cum(1).3.21))/ (21 * Sum(Pwr(Cum(1).S) 21 period Lower Band (smoothed): Mov((21 * Sum(Cum(1) * C.21) .Pwr(Sum(Cum(1).21).21)-(Power(Sum(C.21) .((Sum(Cum(1). ( (14*(Sum(Cum(1)*P.C.2) / 14) ) You could also make this a universal formula by using the P variable.2).S) .21))/ (21*Sum(Pwr(Cum(1).Pwr(Sum(Cum(1).2)/21))) 21 period %A: ((C-Fml("21 period lower band (smoothed)")) / (Fml("21 period upper band(smoothed) ") -Fml("21 period lower band (smoothed)"))) 21 period Regression (smoothed): Mov((21*Sum(Cum(1)*C.S) * (21 * Sum(Cum(1) * C.2 ) ) (Go Top) Standard Error Bands for MetaStock for Windows For interpretation refer to the article "Standard Error Bands".21) * Sum(C.2)/21)) -((Sum(Cum(1)*C.21)*Sum(C. .21) .21.(Power(Sum(Cum(1).2))*Cum(1) +(Mov(C. in the September 96 issue of TASC.2).21))((Sum(Cum(1).Sum(Cum(1).2)). 21 period Upper Band (smoothed): Mov((21 * Sum(Cum(1) * C.21)/21)) / ((Sum(Power(Cum(1).Sum(Cum(1).2)/21))*((Sum(Cum(1)*C.21).21))/ (21 * Sum(Pwr(Cum(1).21) * Sum(C.S) * (21*Sum(Cum(1) * C.2)) * Cum(1) + (Mov(C.21).14).21.21))/(21*Sum(Pwr(Cum(1).25.Sum(Cum(1).2).21))-(Sum(Cum(1).2).21)*Sum(C.14) ) .Mov(Cum(1). 1.2))). Resistance :=ValueWhen(1.3. LookBack.5.hhv(stoch(14. if(stoch(14. First.21) -Pwr(Sum(Cum(1). The direction prices actually move reveals who is winning the battle. S). LookBack. To create the Support and Resistance indicator in MetaStock use the following custom formula: LookBack := Input("Look Back Periods".2.3).S) (Go Top) Stochastic %D The following formula is a three day moving average of a 14 day Stochastic. S)).1.HHV(H.C). . S). Resistance.Mov(C.21). if(stoch(14.3). S)). Resistance.3).Mov(C.1.=.10). LookBack. In MetaStock for Windows.0)) (Go Top) Stochastic Wave Short if(ref(stoch(14.3).3). In MetaStock for Windows this would be the indicator line that is plotted with the built in Stochastic indicator Mov( ( ( ( C . Support levels indicate the price where the majority of investors believe that prices will move higher.Tilley uses support and resistance to confirm price and SMA crossover signals in his article "Simple Moving Average with Resistance and Support". Support :=ValueWhen(1.3). Next.-1).=. LookBack)).1.3). LookBack)).LLV(L.C).3). Support :=ValueWhen(1. LookBack)).S ) (Go Top) Stochastic Wave Long if(ref(stoch(14.1000.3).0)) (Go Top) Support and Resistance Think of security prices as the result of a head-to-head battle between a bull (the buyer) and a bear (the seller).3).llv(stoch(14.Cross(C.=. (Go Top) Simple Moving Average with Resistance and Support In this issue.14 ) .LLV( L.llv(stoch(14. Support. The bulls push prices higher and the bears push prices lower. LookBack. and resistance levels indicate the price at which a majority of investors feel prices will move lower.Cross(C. you can easily recreate the SMARS Indicators discussed in Tilley's article.14 ) ) /( HHV( H.hhv(stoch(14.HHV(H.-1). choose New and enter the following formulas: Resistance and Support LookBack := Input("Look Back Periods".1000.LLV(L.=.2. To use this formula most effectively.14 ) ) ) * 100 ) . LookBack)). choose Indicator Builder from the Tools menu in MetaStock 6.Cross(Mov(C. use the parameters dialogue to change the style to a dotted line while increasing the line weighting. Resistance :=ValueWhen(1.3 . Dennis L. Support.LLV( L.Cross(Mov(C.10).3).3). LookBack.. Finally.1.5 Drag the "Moving Average" indicator from the Indicator QuickList into the price window.1.Cross(Mov(C. You will be prompted to enter the "Percentage" and the "Look Back" periods.5). e2:=Mov(e1. T3 Periods:=Input("Periods?". drag the "Resistance and Support" indicator from the QuickList into the price window. e3:=Mov(e2.Periods.100.Periods))+Start.LookBack)).E). LookBack:= Input("Look Back Periods". c1:=-a*a*a.S)). If you would like the indicator to be a 10% difference from the "Resistance and Support" line.Periods.LookBack.11).S). (Go Top) Smoothing Techniques for More Accurate Signals The following MetaStock formulas are from the 1998 January TASC article "Smoothing Techniques for more Accurate Signals". To Display the Indicators in MetaStock 6. you would enter 10.HHV(H. a:=Input("Hot?".2.Periods. Better trend recognition can be lead to more accurate trading signals. Resistance:=ValueWhen(1. drag the "Resistance and Support * F" indicator into the price window.10).C). e4:=Mov(e3. You should select the same time periods you used with the "Moving Average".Periods. Start:=LastValue(Ref(Mov(P. Refer to his article for interpretation. c3:=-6*a*a-3*a-3*a*a*a.Periods.63. Cum(LinRegSlope(P.E). *Note: It is much easier to see the difference between the actual "Resistance and Support" lines and the "Resistance and Support * F " lines if you change the color and/or style of one of them. Resistance * ((100-prcnt)/100).Mov(C. Now.S).Periods-Size)). e6:=Mov(e5. Size:=LastValue(Cum(1)).10). You will be prompted to enter the "Look Back" periods. enter the time periods and then click OK.LookBack)).E).Cross(C.E).Resistance and Support * F PrCnt:=Input("Percentage"." ILRS Periods:=Input("Periods?". . You should select the same time periods you used with the "Moving Average".LLV(L.63.E). Support * ((prcnt/100)+1). e1:=Mov(P. "More sophisticated smoothing techniques can be used to determine market trend.2. Choose Simple as the method. e5:=Mov(e4.E).Periods.Periods.0.0.1000. Support:=ValueWhen(1. c2:=3*a*a+3*a*a*a. by Tim Tillson.7). pdsCy)-LLV(MCD. you can easily create this system.10 After entering the formulas click OK.20). On the Testing page set the Trade Delay to 0.pdsCy/2). set Positions to Both. click on the New button and enter the following formulas: Signal Formulas Enter Long thresh:= 4.Long and Short Method . When(Value2 <-thresh*Value1) Stops Inactivity Positions .pdsSh)-Wilders(MP().c4:=1+3*a+a*a*a+3*a*a. pdsSh:=Input("Short periods". With MetaStock running choose "System Tester" from the Tools menu. k:= 3. k:= 3.0 }{ Automatic trigger levels }{ Also see: "MACD oscillator .$).2520.252. Value1:= Stdev(Ref(ROC(C.10).10). Stock Rhythm System In Jeffrey Owen Katz's article "Trading stocks with a cyclical system" he introduces the Stock Rhythm System.21).-m). ST:=(MCD-LLV(MCD. In MetaStock 6.-1).0).k. pkVal:=If(pk.k. Value1:= Stdev(Ref(ROC(C.Points Minimum Change 15000 Periods .k.Schaff Trend Cycle" }{
[email protected]. . pdsLg:=Input("Long periods".$). then open a chart and run the system.-1)>STC AND Ref(STC. When(Value2 > thresh*Value1) Close Long thresh:= 4. or higher.com } { With thanks to Tim Straiton.ch } { variables input } pdsCy:=Input("Schaff cycle periods". c1*e6+c2*e5+c3*e4+c4*e3.-1)>Ref(STC. (Go Top.-m).) Schaff Trend Cycle Oscillator { Schaff Trend Cycle Oscillator v1. Value2:= Ref(ROC(C. www.$).1. { Schaff Trend Cycle } MCD:=Wilders(MP(). m:= 63.-m).2.-m).stoploss.pdsLg).5.. then click on Options. Value2:= Ref(ROC(C.252.-2).k.pdsCy))*100. then set any other desired options Click OK to save the changes..20). { automatic trigger levels } pk:=Ref(STC.$). STC:=Wilders(ST.Ref(STC.pdsCy)) /(HHV(MCD. m:= 63. pdsCy))*100.2520.stoploss.0 }{ Automatic trigger levels }{ Also see: "MACD oscillator .10). pkAvg:=Cum(pkVal)/(Cum(pk)+.0).2)) -(flag=0 AND Alert(flag. www.000001).000001). { Schaff Trend Cycle } MCD:=Wilders(MP().0)/100. trVal:=If(tr. pdsCy:=Input("Schaff cycle periods".-1)<STC AND Ref(STC.252. trVal:=If(tr.2) OR flag AND Alert(flag=0. pdsSh:=Input("Short periods".pdsCy)) /(HHV(MCD.trAvg). InInit:=Cum(In)=1. Out:=Cross(STC. { STC crossover signals } In:=Cross(pkAvg.com } { With thanks to Tim Straiton. pdsLg:=Input("Long periods".-1)>STC AND Ref(STC.-2).pdsSh)-Wilders(MP(). STC:=Wilders(ST. pkVal:=If(pk. ST:=(MCD-LLV(MCD.10).pdsCy)) /(HHV(MCD. 0. trAvg:=Cum(trVal)/(Cum(tr)+.100.1.pdsSh)-Wilders(MP().trAvg. flag:=BarsSince(Init OR In) < BarsSince(Init OR Out)+InInit.pdsLg).2.2)). pkAvg:=If(pkAvg=0.pdsCy/2). tr:=Ref(STC.pkAvg).0).Ref(STC.pdsCy)-LLV(MCD.Schaff Trend Cycle" }{
[email protected]).pdsCy))*100.-2).21). pkAvg:=If(pkAvg=0.000001).0).pdsCy)-LLV(MCD.Ref(STC.100. signals:=(InInit AND Alert(InInit=0.Ref(STC.-1). { automatic trigger levels } pk:=Ref(STC.252.-1). STC:=Wilders(ST.100.000001).ch } { variables input } buffer:=Input("Long/Short buffer zone %". tr:=Ref(STC. ST:=(MCD-LLV(MCD.pkAvg:=Cum(pkVal)/(Cum(pk)+.-2). { trend support/resistance levels } .-1)<STC AND Ref(STC.STC). { plot on own window } pkAvg.pkAvg). trAvg:=Cum(trVal)/(Cum(tr)+.STC Schaff Trend Cycle Indicator { Schaff Trend Cycle Indicator v1.-1)<Ref(STC.-1)>Ref(STC. Init:=Cum(In+Out>-1)=1.pdsLg). { Schaff Trend Cycle } MCD:=Wilders(MP().-1)<Ref(STC.2.pdsCy/2). V. EnDay:=Input("End Day". x:=Input("use Open=1 High=2 Low=3 Close=4 MP=5 P=6".ValueWhen(1. If(period.5). EnYear:=Input("end Year". ts:=ValueWhen(1. ValueWhen(1.10). [3]System3".signals.-V.-1).0) (Go Top.252.prd1.2.E).E).1).O.2060.2.Cum(If(period. .} { plot on price chart } STCI (Go Top.OBV} x:=If(C>Ref(C.STC).1.E)) /Ref(Mov(x..If(x=5.31.C))))).10).3.} StDay:=Input("Start Day".1.1.0 }{ System1: trigger crossovers }{ System2: auto overbought/sold crossovers }{ ©Copyright 2002-2004 Jose Silva } {
[email protected](C<Ref(C. Src:=Mov((x-Mov(x.L*(1-buffer)).com } prd1:=Input("first period".L.5).ts). bs:=BarsSince(Cross(pkAvg. prdCrs:=Input("crossover periods". period:=start AND end. end:=Year()<EnYear OR (Year()=EnYear AND (Month()<EnMnth OR Month()=EnMnth AND DayOfMonth()<=EnDay)).) Signal accumulator { Accumulates OBV/Volume (or any other signals) between & including two user-input dates } {signal to accumulate .31).-1).31.2060.trAvg)).) Siroc { Siroc v2.H*(1+buffer)).x.trAvg).Cross(pkAvg.0)).1.1). [2]System1.252.1. start:=Year()>StYear OR (Year()=StYear AND (Month()>StMnth OR Month()=StMnth AND DayOfMonth()>=StDay)).1960.10)..H*(1+buffer))).tb. EnMnth:=Input("end Month".6.Volume} {x:=V. STCI:=If(bb<bs.STCI:=If(flag.prd1.12.252. StMnth:=Input("start Month". {signal to accumulate .H. x:=If(x=1..Cross(STC. prd2:=Input("second period".STC)).1960..If(x=2. StYear:=Input("start Year".If(x=6.1.V.If(x=3.2003).2003). prd2:=prd2*2-1.21).0)). tb:=ValueWhen(1.P. { alternative STC crossover signals method} {bb:=BarsSince(Cross(STC.-prd1).signals=-1 OR Init.12.2.L*(1-buffer)). plot:=Input("[1]Siroc. 0).-1). plot:=Input("[1]Siroc.prd2.1. trVal:=ValueWhen(1.0). pkVal:=ValueWhen(1.-y. z:=Mov((x-y)/Ref(y.Siroc.oSold.2. prd3:=Input("crossover periods". System2:= Cross(Siroc.If(x=2.252.MP().0).If(x=6.-1)).H.oBought).2.dTrigger)-Cross(dTrigger.5). SirocAvg:=Cum(Siroc)/Cum(Siroc>-1).P.252.E) /(Mov(If(z>Ref(z.y.-y.-1)<Siroc AND Ref(Siroc.-1).tr.0). [2]System1.0).-2) AND Ref(Siroc.-2) AND Ref(Siroc.-1).0).C))))).-1)>Ref(Siroc. Siroc:=100 *Mov(If(z>Ref(z.E).E).If(x=5.000001))).oSold)-Cross(Siroc.E) +.z-Ref(z.-1)-z.0 }{ System1: trigger crossovers }{ System2: auto overbought/sold crossovers }{ ©Copyright 2002-2004 Jose Silva } {
[email protected]. oBought:=Cum(pkVal)/Cum(pkVal>-1).E).21).-1).E) +Mov(If(z<Ref(z.0). { System signals } dTrigger:=Mov(Siroc.Siroc). y:=Mov(x.L.O.0). Mov(If(Src>Ref(Src.E)=0.252.3.-1)>Siroc AND Ref(Siroc.prd2.y:=Src-Ref(Src.System1. tr:=Ref(Siroc.2.1.z-Ref(z.1).prd2.0). System1:= Cross(Siroc.-1)>SirocAvg.prdCrs.signals) Siroc II { Siroc II v2.E) /(Mov(If(Src<Ref(Src.dTrigger.-1). x:=If(x=1. [3]System3".5).prd3.prd2. If(plot=1. If(plot=1. oSold:=Cum(trVal)/Cum(trVal>-1). If(plot=1.Ref(Siroc. prd2:=Input("second period".6.E) .prd3.-1).prd3.-1)<SirocAvg.com } prd1:=Input("first period".-1). Siroc:=100-100/(1+If(Mov( If(Src<Ref(Src.Ref(Siroc. signals:=If(plot=2.-prd1).If(x=3.-1).prd1. { Automatic peak/trough historical boundaries } pk:=Ref(Siroc.-1)). x:=Input("use Open=1 High=2 Low=3 Close=4 MP=5 P=6". If(plot=1.oBought.10).System2).-1)<Ref(Siroc.Ref(z.pk.-1). { Automatic peak/trough historical boundaries } pk:=Ref(Siroc. If(plot=1.System1.pds.System2).-2) AND Ref(Siroc.-2) AND Ref(Siroc. signals:=If(plot=2.1). If(plot=1. -1 on exit signals }{ Warning: this trading system is a design example only . ExitCond3:=C<HHV(C.oSold)-Cross(Siroc.oSold.signals) (Go Top.Siroc.5. System2:= Cross(Siroc.. Ex1:=Input("enable EMA exit". oSold:=Cum(trVal)/Cum(trVal>-1).pds.com } {*** user input section ***} delay:=1. ExitCond1:=C<Mov(C.-1)).) Smart System design .0.-1)>Ref(Siroc.Siroc).-1)<SirocAvg.do not trade! }{ ©Copyright 2003 Jose Silva }{ josesilva22@yahoo. {*** place your entry/exit conditions here ***} EntryCond1:=Cross(C. Ex2:=Input("enable LLV exit".0.-1)). If(plot=1.pk. If(plot=1.252.0.1).1.+. trVal:=ValueWhen(1.1.1).dTrigger)-Cross(dTrigger.E).Long { Simple combined Entry & Exit system }{ Plots +1 spike on entry. En2:=Input("enable HHV entry".E).000001).oBought. { System signals } dTrigger:=Mov(Siroc.1.1.0). SirocAvg:=Cum(Siroc)/Cum(Siroc>-1).-1).1). System1:= Cross(Siroc.1).dTrigger.0).-1)).Ref(Siroc.21).Ref(Siroc. ExitCond2:=C<Ref(LLV(C.tr. {delay entry/exit x periods} pds:=Input("global entry/exit periods".pds)-ATR(pds)*2.0).1.-1)>SirocAvg.oBought).E)*1.prd3.. En1:=Input("enable EMA entry". 1.-1)>Siroc AND Ref(Siroc. pkVal:=ValueWhen(1. {*** system logic section ***} .0.-1)<Ref(Siroc.Ref(HHV(C. Ex3:=Input("enable ATR exit".05).-1)<Siroc AND Ref(Siroc.Mov(C. oBought:=Cum(pkVal)/Cum(pkVal>-1).pds). EntryCond2:=Cross(C. tr:=Ref(Siroc.0.pds). Ex3:=If(Ex3.pds.0).-1)).E)*1.0.com } {*** user input section ***} pds:=Input("global entry periods".Mov(C.En1:=If(En1.5*ATR(pds).0).Entry1. Entry4:=Cross(WillR(pds). {*** system logic section ***} En1:=If(En1.0).1.0). {*** place your entry Long conditions here ***} Entry1:=Cross(C.do not trade! } ©Copyright 2003 Jose Silva }
[email protected]).2)).1).-delay)Ref((Flag=0 AND Alert(Flag.Entry4. En5:=Input("enable CMF entry".EntryCond2. En4:=Input("enable WR% entry". Init:=Cum(In+Out>-1)=1.05). En3:=Input("enable ATR entry".2).0).Entry3.ExitCond2. entry:=En1 OR En2 OR En3 OR En4 OR En5. En5:=If(En5.0.1. Entry2:=Cross(C. En4:=If(En4.1.0).0).0.1.1.1). {*** system signals display section ***} Ref(Flag AND Alert(Flag=0. En2:=Input("enable HHV entry".Entry5.pds)).Ref(HHV(C. . En2:=If(En2.-50).0).ExitCond3.0.1).-delay) More advanced system developers: Smart System Long Entry developer { { { { Plots +1 spike on Long entry signal } Warning: this trading system is a design example only .0). Entry3:=Cross(C.252. Flag:=BarsSince(Init OR In) < BarsSince(Init OR Out)+(Cum(In)=1). Ex1:=If(Ex1. En3:=If(En3. {*** system signals logic section ***} In:=En1 OR En2.0.EntryCond1.21). Entry5:=Cross(CMF(pds). Ex2:=If(Ex2. En1:=Input("enable EMA entry".HHV(C-2.0). En2:=If(En2. Out:=Ex1 OR Ex2 OR Ex3.1).1).0). Exit5. -1 spike on exit signals }{ Change user-input default settings within code in referenced indicators: "Smart System Long Entry developer" & "Smart System Long Exit developer" } { Warning: this trading system is a design example only .10).Exit4. Exit2:=C<Ref(LLV(C. {*** system exit output section ***} exit Smart System Long trade signals { Plots +1 on entry.com } delay:=Input("Entry and Exit delay".E).0). Ex2:=If(Ex2.0.0.2.0.0).252.0).pds. Ex1:=Input("enable EMA exit".do not trade!} {©Copyright 2003 Jose Silva} {josesilva22@yahoo. Ex2:=Input("enable LLV exit".1).1.pds). exit:=-(Ex1 OR Ex2 OR Ex3 OR Ex4 OR Ex5).0).0. Ex4:=Input("enable WR% exit".Exit2.1).0).0.5. Ex4:=If(Ex4. In:=Fml("Smart System Long Entry developer").1).1.Exit1.1).1).1. Ex3:=If(Ex3. {*** system logic section ***} Ex1:=If(Ex1. trade binary=2".1.5*ATR(pds).1.1.-1).do not trade! } { ©Copyright 2003 Jose Silva }{
[email protected]. plot:=Input("plot: entry/exit signals=1. Ex5:=If(Ex5.0. Ex3:=Input("enable ATR exit".{*** system entry output section ***} entry Smart System Long Exit developer {Plots -1 spike on Long exit signal} {Warning: this trading system is a design example only . {*** place your exit Long conditions here ***} Exit1:=C<Mov(C.1).Exit3.com} {*** user input section ***} pds:=Input("global exit periods". .0). Exit4:=WillR(pds)<-50. Ex5:=Input("enable CMF exit". Exit3:=C<LLV(C+2.pds). Exit5:=CMF(pds)<0. -delay). Ref(If(plot=1. but can be read as bullish or bearish in same way as the Binary Wave. or to buy on a zero cross over to the upside and sell on a zero crossover to the downside.2)) -(flag=0 AND Alert(flag.2)).flag.-delay).5 Volatility% Lookback := Input("Time Periods". I don't make my buy an sell decisions from the indicators or the system test. 100 * Sum(100 * ATR(1)/CLOSE > HighVolatility.0)). InInit:=Cum(In)=1. 0. The two traditional ways to play them are to buy on a rise from a negative peak and sell on a fall from a positive peak.flag) TASC Trader's Tip: Volatility % Indicator (Dec '97) You can easily create the Volatility% Indicator from William Brower’s article in MetaStock for Windows. 0 when neutral and -1 when negative. Of course you can optimize and find various buy and sell levels as long as you understand what is bearish and what is bullish.signals. from "JimG" There are really two different ways to use these formulas. I do use the system .-delay). In1:=Cum(Cum(In))=1. If(plot=1. Having said that.Out:=Fml("Smart System Long Exit developer")=-1.1. The QStick is really a candlestick type indicator. Lookback)/Lookback (Go Top) Tema PV Binary Wave Use of Tema PV Binary Wave and Tema QStick Formulas in MetaStock. Out1:=Cum(Cum(Out))=1.2) OR flag AND Alert(flag=0.1000.3).01. First choose Indicator Builder from the Tools menu in MetaStock. My own MetaStock system tests alerts on the BW crossing a moving average of itself and buys or sells on a confirmation of Qstick turning positive or negative respectively. signals:=(InInit AND Alert(InInit=0..In1.100. Init:=Cum(In+Out>-1)=1. Since the Binary Wave is a smoothed addition of several technical indicators that each give +1 when bullish.0.-Ref(Out1 AND BarsSince(In1) >=BarsSince(Out1). it makes sense that a positive number is bullish and rising numbers are bullish. If(plot=1.0).50). HighVolatility := Input("High Volatility %".If(odd. If(plot=1. odd:=Cum(1)/2=Int(Cum(1)/2).0). Next choose New and enter one of the following formulas: Formula for MetaStock 6. Similarly negative numbers and falling numbers are bearish. flag:=Ref(BarsSince(Init OR In) < BarsSince(Init OR Out)+InInit. Mov( ( Mov( C.17.E ) ) .5 so I can plot it as a histogram.13.test as an initial screen and use a buy signal as a flag to move the stock to my watch list.Mov( C.0001+HHV(RSI(Periods).Mov( ( Mov( C. I do use the system test as an initial screen and use a buy signal as a flag to move the stock to my watch list. Over the years.-2) filter colA > colB AND colB > colC {General Purpose Intermediate Term MACD Indicator} ( Mov( C.34.34.5.E ) ).LLV(RSI(Periods).Mov( C. It's:} Periods := Input("Enter Tema Smoothing Periods".8. I don't make my buy an sell decisions from the indicators or the system test. Over the years.Periods)) .E ) .E ) Mov( C.9. Similarly negative numbers and falling numbers are bearish.E ) (Go Top) Tema StochRSI Formula I use is Tema smoothed and I subtract 0. Since the Binary Wave is a smoothed addition of several technical indicators that each give +1 when bullish.5. from "JimG" There are really two different ways to use these formulas. Having said that.233.LLV(RSI(Periods). The HIGHER CLOSES MetaStock exploration should be entered as follows: colA CLOSE colB ref(C.E ) ).Mov( C. The QStick is really a candlestick type indicator.E ) {General Purpose Short Term MACD Indicator} ( Mov( C. Of course you can optimize and find various buy and sell levels as long as you understand what is bearish and what is bullish. I make all buying and selling decisions based on the trend channels. 0 when neutral and -1 when negative.89. (Go Top) Tema PV Binary Wave and Tema QStick Formulas--use of in MetaStock. but can be read as bullish or bearish in same way as the Binary Wave. My own MetaStock system tests alerts on the BW crossing a moving average of itself and buys or sells on a confirmation of Qstick turning positive or negative respectively.Periods))) -0.13).E ) . or to buy on a zero cross over to the upside and sell on a zero crossover to the downside. I've found that works best for me.-1) colC ref(C.E ) ) .17. The two traditional ways to play them are to buy on a rise from a negative peak and sell on a fall from a positive peak.Periods) (Go Top) . it makes sense that a positive number is bullish and rising numbers are bullish. I make all buying and selling decisions based on the trend channels. I've found that works best for me. Tema(((RSI(Periods) .Periods)) / ((0.E ) .13.8. or.Andrew Abraham Could have been called: • STOP LOSS Indicator • SUPPORT& RESISTANCE Indicator • DYNAMIC SUPPORT & RESISTANCE Indicator • BUY/SELL TRIGGER Indicator • INVESTORS DREAM Indicator • TRADING Indicator fml("VOLAInd"): Mov(ATR(21).W)*3.) .-21) AND C>fml("VOLAInd").1.1. was about one form of stoploss exit: subtract some manipulation of the true range from the highest high (or add it to the lowest low) and exit when the close crosses that. TD5:= If((TD3) + (TD4)>=1. and red for downward price changes} (Go Top) Trading the Trend 2 Trading the Trend (TTT) -.-1)+LLV(L.21)) {CHANGE BAR COLORS: double click on the price plot in the chart.by Andrew Abraham.21)-Ref(VOLAInd. from the Color/Style page click the UP drop-list and choose darkblue for upwards.-2) + Ref(TD7.1. TASC Magazine 9/1998. HHV(H.-1). TD4:= If((Ref(H.-2).-8)). TD6:= (TD1) + (TD2).-4))/ (TD7) + Ref(TD7.-2).-6)) AND (L<=Ref(H.-4)*100. TD3:= If((H>=Ref(L. (Members of Chuck LeBeau's Traders Club will recognise the "Chandelier Exit". TDREI:=((TD5) + Ref(TD5. If(C>Ref(C.21)) .-1) + Ref(TD5. (Go Top) Trading the Trend 1 TTT--TREND TRAILING Indicator -.-21) AND C>VOLAInd.-5) OR H>=Ref(L. Ref(VOLAInd. VOLAInd :=Mov(ATR(21).-2)>=Ref(C.-8)) AND (Ref(L.-3) + Ref(TD5. 0).2)<=Ref(C. TD7:= Abs(TD1) + Abs(TD2).0).-6)).-2) + Ref(TD5.0). TD2:= L-Ref(L. Ref(fml("VOLAInd").-2)<=Ref(C.Three inside Days Inside days suggest a volatility compression and often preceede strong breakouts.-7) OR Ref(H.-3) + Ref(TD7.-2)>=Ref(C.-1) + Ref(TD7.1.-1).-7) OR Ref(L.-1)+LLV(L.W)*3. TDREI. HHV(H. Search returns 1 for ok and 0 for not ok • Inside() • Inside()-1 • Inside()-2 (Go Top) Tom Demark's Range Expansion Index TDREI TD1:= H-Ref(H.-5) OR L<=Ref(H.21)-Ref(fml("VOLAInd"). If(C>Ref(C. (TD6). After closing the Indicator Builder click on the Expert Advisor (the guy in the bowler/derby hat). type in C<=FmlVar("Trading the Trend". and then click OK again. This is too rudimentary to be traded as a system . select Colour Blue. and dispensing with the Expert. 4. HiLimit:=HHV(H. TruRan:=Mov(ATR(1). A very similar stoploss is given in Chande & Kroll "The New Technical Trader". select Trading the Trend. or right-click the indicator on the chart.Pds."HiLimit"). one question comes to mind. Mult:=3. To experiment with variations in the lookback periods and the multiplier you can do so in either the Indicator Builder. 3.HiLimit. 5. dispensing with the switch between them. LoLimit:=LLV(L. click OK. select Condition.5 as a variable or custom indicator : DaysinTrade:= Barssince(previous composite entry criteria = 1) THE YO YO EXIT: This exit is very similar to the Chandelier Exit except that the ATR stop is always pegged to the most recent close instead of the highest high. select the first line so that it is highlighted.but the exits should help to limit drawdowns. Assuming you entered everything exactly in both the Indicator Builder and the Expert Advisor. then the Formula tab. then the Name tab. Still on the Highlights tab.the whipsaws would chop you to pieces . select the second line. click on the Expert Advisor. Click on New. type in the name Uptrend.THE CHANDELIER EXIT: The exit stop is placed at a multiple of average true ranges from the highest high or highest close since the entry of the trade. As implemented above.Pds)+TruRan. If anyone wants help with the code. This shows the trade-offs that have to be made between near and distant stops. Did you decide to adapt .169. type in Trading the Trend. If(C>HiLimit. If you have a chart open that you want to use this on. Since the closes move higher and lower. I've given the Expert steps in detail for any who may not be familiar with its use. type in C>FmlVar("Trading the Trend". In MS 6.167 . when you open a chart and plot the trendline.W)*Mult. and click OK. As the highs get higher the stop moves up but it never moves downward.g. try a lookback period of 10. click Edit. click Attach. otherwise click Close.5). pp. "Volatility-Based Trailing Stops". select Condition.LoLimit) 1. the Expert should change accordingly. In the latter case. My preference is to plot both the high and the low exit lines in contrasting colours. and make the changes (e. Name: Trading the Trend Pds:=21. the stop also moves up and down (hence the Yo Yo name). select Color Red. just say so. Click on the Highlights tab."HiLimit"). and a multiplier of 2. type in the name Downtrend. and click on Attach. 2. click Edit.Pds)-TruRan. select Properties. L. you could try different entry levels from the oscillator. {then}(C*1. I hard-coded the Pds and Mult parameters for that reason.21).20) and then when you applied it you changed the periods to 15. RMTA:=(1-Alpha)*(If(Cum(1)<Lb. the Expert Advisor will still read 20.100. If you wish to try "tuning" it in MetaStock.5 and use an Input function for Pds and Mult? It seems like a logical thing to do. {else} PREV)). Thus if you used something like: Pds:=Input("Lookback Periods?".60).H.PREV))+ (Alpha*(Tv+Bot-Ref(Bot. or go short when TOSC crosses from above +2.6. } {TOSC} Lb:=Input("Look-Back Period?".1. {else} If((C*1. TOSC.1).If(Ty=2. For example. {from Adam Hefner} {Regarding the Recursive Moving Trendline System. Tv:=If(Ty=1.1. {NOTE: this code will work slowly because of all of the "PREV" functions.1000. I ended up making an oscillator out of it (subtracting the ema from the rta).S)> Mov(Mov(C. Ty:=Input("1=C 2=H 3=L 4= Median Price".PREV))+Tv.S) AND .2.MP()))).E).2.S).1) <= PREV. The problem is that the Expert Advisor always reverts to the default value (the System Tester does the same thing).1). from Adam Hefner. -1). Alpha:=2/(LB+1). SSDPBOS:= (ACol>BCol) AND (Ref(C. (Go Top) Trailing Stop Loss Indicator If(cum(1)=1. go long when TOSC crosses from below -2.If(Ty=3.2.Tv. CCol:= HHV(H.C.3.4. and in fact I coded it that way at first. SSDPBOS (Go Top) Trending Bandini Mov(C. TOSC:=RMTA-Mov(Tv.Tv.lb.} {Single 60 Day Period BreakOut Signal Indicator} ACol:= C.59).-1))).-1)<BCol) AND (H=CCol). BCol:= Ref(HHV(H.the formula to MS v. {then} Close. Bot:=(1-Alpha)*(If(Cum(1)<Lb. S).S).2.S).S).S).S).opt2) Close short: Cross(opt1.S). It makes no sense to limit your outside limits to -2 and +2 if the TSF oscillates between -8 and +8.S).S) AND Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C.S).2.S).S) AND Mov(Mov(Mov(C.2.S).S).S)> Mov(Mov(Mov(Mov(Mov(C.S).$)).2.S).S).S).2.opt3).S).2.Ref(C.S).2. So do a little .2.S).2.E).S).2.S) AND Mov(Mov(Mov(Mov(Mov(Mov(C.-1)) )/2 (Go Top) True Strength Index {Appeared in the January 1993 issue of Stocks & Commodities magazine} 100 * ( Mov( Mov( ROC(C.2.2.S).opt2) Enter short: Cross(((CLOSE-Ref(TSF(C.2.E).S).S).2.2 .opt3).2.S).2.E)) (Go Top) TSF Optimised Trading System for Metastock Enter long: Cross(opt1.2.((CLOSE-Ref(TSF(C.S).S).2.2 .2.2.2.-1))/CLOSE*100)) Close long: Cross(((CLOSE-Ref(TSF(C.2.2.13.1. S) AND Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C.S).S).S).S).S).2.2.L + Abs(H .S).2.S).2.S)> Mov(Mov(Mov(Mov(C.2.S).S).2.2.S).S).2. If you are applying it to equities (or commodities).S)> Mov(Mov(Mov(Mov(Mov(Mov(C.2.2.2.S).S)> Mov(Mov(Mov(C.$).S).2.2.S).-1)) + Abs(L .2.S).S).2.2.S).2.S) AND Mov(Mov(Mov(Mov(Mov(C.1.S).2.S).opt3).2.S).2.S) (Go Top) True Range Formula TR = (H .S).S).S).2.2.2.2. it always makes sense to look at the indicator and understand the outside parameters for each of its "steps".2.2.-1))/CLOSE*100)) opt 1: zero to -2 (with .S)> Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C.S).2.S).2.S).2.2 .2.13.2.1 step) opt 2: zero to +2 (with .2.2.2.25.2.2.S).2.S).opt3).2.S).2.2.2.2.2.2.S).S) AND Mov(Mov(Mov(Mov(C.2.S).2.2.2.2.2.2.2.S). S)> Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C.2.S).2.S).2.S).2.((CLOSE-Ref(TSF(C.S).S).2.S).S).S).S).E) / Mov( Mov( Abs(ROC(C.S).1 step) opt 3: 2 to 8 (with 1 step) {I use this for futures and the above parameters (optimized settings) keep it in the ballpark.S).S).2.Mov(Mov(C.2.S).2.S).25.S).S).S).2.2.2.2.2.S).2.S)> Mov(Mov(Mov(Mov(Mov(Mov(Mov(C.Ref(C.S).S) AND Mov(Mov(Mov(Mov(Mov(Mov(Mov(C.S)> Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(Mov(C.2.2.S).-1))/CLOSE*100).2.2.S).S).-1))/CLOSE*100). the net difference of the numbers of stocks last traded on an uptick from those last traded on a downtick .0 ) ) ) (Go Top) Tick Line Momentum Oscillator In his article "Using The Tick In A Short-Term Indicator". just as only a finite amount of selling waves can take place before the sellers are out of supplies. which is based on the closing value for the New York Stock Exchange (NYSE) tick indicator. then. V. perhaps too volatile for some. in the January 94 issue of TASC.E) (Go Top) The New Advance Decline Line The formulas and steps necessary to do the New Advance -Decline Line from the September 1994 Technical Analysis of Stocks & Commodities. is a well-known indicator. watched with fascination during periods of turmoil and periods of enthusiasm.1000 .E). In addition.E)/Mov(Mov(Abs(Roc(c.20.25.If(C .-1 .E).0 ) .13.1.>= .13.1000 .$). Taken from Stocks & Commodities. the tick line momentum oscillator. 12:1 (42-44): Using The Tick In A Short-Term Indicator by Daniel E.homework on the "outside" limits of the indicator and then optimize accordingly.25. 12:9 (363-365): A New AdvanceDecline Line by Daniel E. Let me present. Cum( If( P . from Steve Karnish.1000 . It gives many good short-term trading signals and excellent but infrequent longer-term signals… The philosophy behind this tool is that the short-term trader's capital is finite and that traders have to reliquify their holdings after a period. Traders can buy and try to push the equities higher only so many times before they need to reliquify.$)). then.< . Downing "Here's a trading tool that uses a unique version of the daily advancedecline line of the New York Stock Exchange (NYSE). Downing presents the Tick Line Momentum Oscillator. It is quoted throughout the day on most quote services. V.1. + 1 . The tick is a basic unit for the markets.If( C .>= . What to do? here. but it's got a problem. The oscillator has been shown to have a good track record of determining when the NYSE is overbought or .} (Go Top) TSI and TSI Moving Average 100*(Mov(Mov(Roc(C. the closing tick value can be found on the market statistics pages of financial newspapers such as Barron's and The Wall Street Journal." For the Windows versions of MetaStock: • Load the advances • Load the declines • Drag the plot of the advances into the chart of the declines • Plot the following custom formula directly on the plot of advances. page 14 by Daniel Downing are: Taken from Stocks & Commodities. Daniel E.and long-term trading of index options and stock index futures. Downing "The tick index. A tool that points to when short-term traders need to reliquify their positions will also spot when the markets will soon reverse their trends. The raw number result is volatile. This version helps in our short. is a way to smooth out the noise to identify short-term trading opportunities.E) ) Mov(Fml("TSI"). 5). TPH1:=C+A.20.If( C .10))) *TroughBars(1.E ) (Go Top) Trading Channel Index The Trading Channel Index comes from an early version of AIQ's Stock Expert program.L.21 .< .-1). The formula for the tick line momentum oscillator is simple and can be easily calculated without a computer.9. TPL2.E ) .-1 ) .E ) + ( Mov( Ref( Fml( "CI+" ) . LowerBand:=Vidya-2*.10)+((((Trough(1.S).Fml( "ESA+" ) ) .Ref( Mov(C .10))) This formula will draw a trendline from the most recent bottom.5 . TPL1.10.1 .E ) .+1 . You will also need to change the line style to the last one in thedrop down list.E ) + ( Mov( Ref( Fml( "AP+" ) .10 .oversold on a short-term basis." The MetaStock formula for the Tick Line Momentum Oscillator is: Mov( ROC( Cum( If( C ." To create the Trading Channel Index in MetaStock create the following custom formula's: AP+: Average price (H+L+C)/3 ESA+: Smoothed price average Mov( Fml( "AP+" ) .E ) ) (Go Top) Trendline Formula Trough(1.E ) ) D+: Price range estimate Mov( ( Fml( "AP+" ) . The L (low) can be changed to C (close) and the 10 can be changed to a different percent value. UpperBand:=Vidya+2*. "The Trading Channel Index measures the location of average daily price relative to a smoothed average of average daily price.10 .10 . SC:=0. "Tick line momentum.L.E ) ) CI+: Channel index ( ( Fml( "AP+" ) ." Finally.Fml( "ESA+" ) ) / ( 0.5*K. .E ) + ( Mov( Ref( Fml( "AP+" ) Fml( "ESA+" ) . TPH2.-1 ) .L. (Go Top) Tushar Chande's Target Price A:=Mov(Abs(C-Ref(C.> . TPH2:=C+(2*A).L.10 . TPL2:=C-(2*A).10 .-1 ) .$ ) .L.-1 ) .S).21 .Ref( Mov( C .-1 ) . Vidya:=SC*K*C+(1-SC*K)*Ref(C. the oscillator is straightforward and simple to apply.10)TroughBars(1. although a spreadsheet version can be found in the sidebar. It is derived from the average difference between these two values.L.0 ) ) ) . TPL1:=C-A.015 * Fml( "D+" ) ) ) TRADING CHANEL INDEX: Mov( Fml( "CI+" ) .-1))..5*K.5 .10))/(TroughBars(2.10 . TPH1.5)/Mov(Stdev(C. (Go Top) Tushar Chande's Vidya with Volatility Bands K:=Stdev(C.10)-Trough(2. stopLong.-delay). UpSideDiff:=If(UpSidePen.10).stopLong.1.com } coefficient:=Input("SafeZone coefficient".252.Ref(StopShort.bkpds)+.0). DwPenAvg:=Sum(DwSideDiff.2.pds. Long+Short=2.E)>Ref(Mov(C.3. If(plot=1.Ref(stopLong.1).Ref(stopShort.0).bkpds) /(Sum(DwSidePen. LowerBand. UpSidePen:=Mov(C.-1).StShort.252. signals=3".5. 0.If(plot=2.MetaStock { Triggers: Long (+1) & Short (-1) signals at crossover of user-defined trailing stops }{ x23 slower than TradeSim's version }{ ©Copyright 20032004 Jose Silva }{
[email protected]).-1).1.-1).C).-1) AND H>Ref(H. DwSidePen:=Mov(C.0).-1)-L.com } .-1+adv). StopLong:=If(C<PREV. StopShort:=If(C>PREV. -1+adv).-1).-1). signals:=Ref((Cum(In)=1 AND Alert((Cum(In)=1)=0.10. signals)) (Go Top) Trailing Stop .-1+adv).-1)).stopShort).If(plot=2.stopShort).UpperBand.E). tomorrow's stop=1". StShort:=Ref(H+UpPenAvg*coefficient.PREV)).0).pds.-1) AND L<Ref(L.pds.Min(StShort.-1).2) OR flag AND Alert(flag=0. UpPenAvg:=Sum(UpSideDiff. plot:=Input("plot: trailing stop=1.Ref(L.H-Ref(H. If(plot=1. pds:=Input("Trend EMA periods". DwSideDiff:=If(DwSidePen.0)).Ref(If(flag=1.000001). In:=Cross(C. adv:=Input("plot: today's SafeZone=0. bkpds:=Input("Lookback periods".pds.bkpds) /(Sum(UpSidePen.bkpds)+.5).E)<Ref(Mov(C.1.0.2)). flag:=BarsSince(Cum(In+Out>-1)=1 OR In) < BarsSince(Cum(In+Out>-1)=1 OR Out) +(Cum(In)=1).Max(StLong.PREV)). Vidya. Out:=Cross(Ref(StopLong. 0.21).Ref(If(flag=1. delay:=Input("Entry and Exit signal delay". StLong:=Ref(L-DwPenAvg*coefficient.Elder's SafeZone { Dr Alexander Elder's SafeZone trailing stop v2 }{ Triggers: Long (+1) & Short (-1) signals at crossover of user-defined trailing stops }{ ©Copyright 2003 Jose Silva }{ josesilva22@yahoo. (Go Top) Trailing Stop .2.E).2)) -(flag=0 AND Alert(flag.StLong. -1+adv). 0). InInit:=Cum(In)=1.2)).5.PREV)).3.-1)). {mode: band or trigger} LONG. adv:=Input("plot: today's trailing stop=0.C).Volatility.stop breached} stopShort:=ExtFml("TradeSim.. stopLong:=ExtFml("TradeSim.8).StLong. If(plot=1. BAND.C). 0.Ref(stopShort.PREV)). If(plot=2. If(plot=2. signals=3". plot:=Input("plot: trailing stop=1.1). tomorrow's stop=1". BAND. Out:=Cross(Ref(stopLong.5.stop.0)). flag:=BarsSince(Init OR In) < BarsSince(Init OR Out)+InInit.Ref(stopLong. tomorrow's stop=1".-1+adv).0.stopShort).0).TradeSim { Triggers: Long (+1) & Short (-1) signals at crossover of user-defined trailing stops }{ x23 faster than MetaStock's 4-PREV version } { TradeSim.-1).TrailingStop". Long+Short=2.Ref(stopShort. {user defined see variable above} CLOSE.0.0..C).-1). delay:=Input("Entry and Exit signal delay". .8).TrailingStop".100.1. signals:=Ref((InInit AND Alert(InInit=0.0.2)) -(flag=0 AND Alert(flag.Min(StShort. stop:=Ref(If(flag=1. stopShort:=If(C>PREV.Max(StLong. {RefPoint for stop calc} CLOSE). StShort:=C+C*buffer/100.SHORT. Init:=Cum(In+Out>-1)=1. Out:=Cross(Ref(stopLong.StShort.stopLong.Ref(stopShort.dll must be in .100.\MetaStock\External Function DLLs\ folder }{ ©Copyright 2003-2004 Jose Silva }{ josesilva22@yahoo. In:=Cross(C. Volatility:=C*buffer/100. {long or short} Volatility. stopLong:=If(C<PREV.1. delay:=Input("Entry and Exit signal delay". In:=Cross(C. adv:=Input("plot: today's trailing stop=0.0).-1+adv).-1)).1.1).-1+adv). StLong:=C-C*buffer/100.C.1. {threshold .signals)) Trailing Stop .stop.3. Long+Short=2.-delay). If(plot=1.com } buffer:=Input("buffer % trailing stop".2) OR flag AND Alert(flag=0. 0. signals=3".0).buffer:=Input("buffer % trailing stop". plot:=Input("plot: trailing stop=1. 0. Out:=Cross(Ref(stopLong.0).tradernexus.C).100.-delay). If(plot=2.stopLong.0.Ref(stopLong.initialStopLong.0)).html } buffer1:= Input("initial stop % buffer".StopLong".AdvTrailStop plug-in { Plot on price chart }{ Triggers: Long (+1) & Short (-1) signals at crossover of user-defined trailing stops }{ Much faster than MetaStock's 4PREV version }{ ©Copyright 2004 Jose Silva }{ josesilva22@yahoo. If(plot=1.8)/100.0.1). In:=Cross(C. signals:=Ref((InInit AND Alert(InInit=0.C).dll must be in . tomorrow's stop=1". exitSignal:=Cross(stopLong. free from: http://www.0.2) OR flag AND Alert(flag=0. 0.1.dll by Richard Dale. 0. If(plot=1. . stopLong:=ExtFml("AdvancedStop.0).5)/100.3.initialStopLong.0. entrySignal. trailStopLong:=C*(1-buffer2). initialStopLong:=C*(1-buffer1).\MetaStock\External Function DLLs\ folder }{ AdvancedStop. entrySignal:=Cross(C.Ref(stopShort.trailStopLong. buffer2:= Input("trailing stop % buffer". stopShort:=ExtFml("AdvancedStop. exitSignal.0).Ref(stopShort.100. trailStopShort:=C*(1+buffer2).-1+adv).trailStopLong.Init:=Cum(In+Out>-1)=1.0. InInit:=Cum(In)=1.2)) -(flag=0 AND Alert(flag. stopLong:=ExtFml("AdvancedStop.0.stop. adv:=Input("plot: today's trailing stop=0.StopLong".-1+adv).com/advancedstop/advancedstop.1. 0.0).0. Long+Short=2. plot:=Input("plot: trailing stop=1..5.-1).2)). stop:=Ref(If(flag=1..stop.signals)) Trailing Stop . signals=3". flag:=BarsSince(Init OR In) < BarsSince(Init OR Out)+InInit. 0.com } { AdvancedStop.stopShort).trailStopShort. delay:=Input("Entry and Exit signal delay".initialStopShort.0).0.0.-1)).StopShort".-1+adv). entrySignal.stopShort). entrySignal:=C=C. initialStopShort:=C*(1+buffer1). If(plot=2.0.0. If(pr=3.signals)) (Go Top) Trendline . y1:=If(t1pds>=t2pds.If(pr=5.V.y2)).y1).P. If(plot=2.2)).stopLong.2.stop.1).com } pds:= Input("average trend length periods". price2:=pr.pds).If(pr=2.stop.-1+adv).pds).If(pr=7.7. If(plot=2. t2pds:=LastValue(BarsSince(time2)).time1).L. If(pr=6.plot. price1:=pr. {fix coordinates} y1:=ValueWhen(1. If(display=1.x1.Ref(stopLong.time1. stop:=Ref(If(flag=1.Init:=Cum(In+Out>-1)=1. P=7".2) OR flag AND Alert(flag=0.price1. b2:=LastValue(BarsSince(x2)). x2:=If(t1pds>=t2pds.x2. y2:=If(t1pds>=t2pds.C)))))). {restrict to last events} time1:=time1 AND Cum(time1)=LastValue(Cum(time1)).price1). time1:=price1>Ref(HHV(price1.time1+time2) Up 20% on Double Average Volume . flag:=BarsSince(Init OR In) < BarsSince(Init OR Out)+(Cum(In)=1). Trend points = 2".price2. time2:=time2 AND Cum(time2)=LastValue(Cum(time2)). If(plot=1.252.2.1.-1). y2:=LastValue(ValueWhen(1. pr:=Input("Open=1 High=2 Low=3 Close=4 Vol=5 MP=6. plot:=y1+BarsSince(x1)*(y2-y1)/(b1-b2).-1+adv). display:=Input("plot Trend line = 1. x1:=If(t1pds>=t2pds.4).-delay).stopShort).O. signals:=Ref(((Cum(In)=1) AND Alert((Cum(In)=1)=0.MP(). b1:=LastValue(BarsSince(x1)).Ref(stopShort.2)) -(flag=0 AND Alert(flag. time2:=price2<Ref(LLV(price2.time2).time2. If(plot=1.H.21). {define events} pr:=If(pr=1.1. {sort events} t1pds:=LastValue(BarsSince(time1)).-1+adv).0)).-1).adjustable { ©Copyright 2003 Jose Silva }{
[email protected]). Length:=Input("Length". Unlike the present version.E).Updated periods:=Input("periods". Smooth:=Input("Smoothing".5). If you refer to the MetaStock manual.200.S)>=(2*Ref(Mov(V.5)/Mov(Stdev(P. VIDYA (Go Top) Vidya with P variable.-1).34.1.C.26. 5 This is the MetaStock code for VIDYA 21.89). VIDYA:=If(Cum(1)<=(Length+1). AbsCMO:=(Abs(CMO(C. choose not to identify it by name.1.244. SC:=2/(Smooth+1).E))))/42) Tar(SZ)an Short (C-(((325*Mov(C. this is better.(SC*AbsCMO*CLOSE)+(1(SC*AbsCMO))*PREV).20).E))+(351*Mov(Mov(C.1.Length)))/100.E)Mov(C. for their own inscrutable reasons. Vidya.5).%) Filter ROC(C.5.60. It uses VHF rather than CMO.200. It's actually available in MetaStock as the Variable Moving Average (Mov(C.100.5 which applies to the article "Breaking Out Of Price Channels" by Gerald Marisch in the TASC January 1998 edition.n. periods) Equis put this function in for me.12.21). Vidya:=A*K*(P)+(1-A*K)*Ref(P.26.E)Mov(C.13.E).20.S). be aware that there is a typo in the .13.5.V) but Equis.-5)) Filter enabled Yes Periodicity Daily Records required 1300 Variable MA Formula. VariableMA511( mp() .E))-(420*Mov(C.%)>=20 AND Mov(V.Col A: CLOSE Col B:ROC(C. K:=Stdev(P.9.5. version II My version of Tushar Chande's Vidya.E))+(490*(Mov(Mov(C.E))))/28)*2 (Go Top) Vidya Explanation Vidya is a subject that comes up with some regularity. using the P variable Vidya{P} Periods:=Input("length of MA".89. Tar(SZ)an Long C-(((462*Mov(C.13.34.5. A:=(2/(Periods+1)).E))-(297*Mov(C.S). (Go Top) Vidya 21. except that at the time the MetaStock version was not correctly initialised -. (Go Top) Vidya using P variable.78). rise rapidly at first. {Chande Momentum Oscillator} {UD = Up day} {DD = Down day} UD:= Sum((C-Ref(C. Vidya:= (Cum(1) < Pds) * C + (Cum(1)>=Pds) * ((Alpha * k * C) + (1-Alpha * k) * PREV). Two or three years ago I coded the version given in TAS&C and it overlaid the MetaStock version precisely. Alpha:= 2/(Pds+1)... after which they are identical. Then at day N the indicator uses the (N-1) close for yesterday's data and takes much less time to stabilise. such as the Exponential Moving Average.1000. period N. Next choose New and enter one of the following formulas: Formula for MetaStock 6. DD:= Sum((Ref(C. For a Vidya of the close. Equis acknowledged the typo at the time.1.this has since been corrected.078 should read 0. k:= Abs(CMOsc). you can initialise with something like "If(Cum(1) < N. CMOsc:= (UD-DD)/(UD+DD). Vidya (Go Top) Volatility % Indicator You can easily create the Volatility% Indicator from William Brower’s article in MetaStock for Windows.-1)). then usually the indicator will start with a value of zero.5 Volatility% . You can overlay them in different colours on the same chart to satisfy yourself that they are indeed the same (but remember to use the same number of periods).9).formula (0. or the Abs(CMOsc) can be replaced with a different volatility index that ranges between 0 and 1.-1)-C)*(C<Ref(C. or made universal by replacing each C with a P. First choose Indicator Builder from the Tools menu in MetaStock. One answer is to initialise it. If no provision is made. It can be adapted by adding a variable input for the CMO length (9).)" with the Vidya formula as the 'else'.9). version I Here is a version of Vidya using a P variable that matches MetaStock's built-in Variable Moving Average. As far as the 'circular reference' is concerned.-1)). you are right that eventually you run out of data. However adding a portion of yesterday's value to a portion of today's value is common to several indicators. C. but have done nothing about it. There is a small difference at the start due to different initialisation. {Vidya (Chande)} Pds:= Input("Number of Periods?".{else} .-1))*(C>Ref(C. The coding is spelled out for the benefit of anyone studying the book.20). then take some time to stabilise. (Go Top) Volatility Trade in Gold "A Volatility Trade In Gold" by David S. HighVolatility := Input("High Volatility %".100). Technical Analysis of Stocks & Commodities.1000.100.100). M. The formulas as given will work in all versions of MetaStock.Num)/Std(Log(C/Ref(C. by Ahmet Tezel.01.50).Den) David Landry Average Historical Volatility Den:=Input("Number Of Periods For Denominator". However. EMA:=Input("Number Of Periods For EMA".E) Note: Standard deviation information was not included here because the way these formulas are being used.-1)).1.1)).1000.1)).LastValue(EMA).4)/Std(Log(C/Ref(C. ((Std(Log(C/Ref(C.12.2. Mov(((Std(Log(C/Ref(C.-1)).Den))+(Std(Log(C/Ref(C.1)). and Suzan Koknar-Tezel.Lookback := Input("Time Periods".Den))+(Std(Log(C/Ref(C. David Landry Historical Volatility Num:=Input("Number Of Periods For Numerator".1)).1000.Den))+(Std(Log(C/Ref(C. page 87.2.10)/Std(Log(C/Ref(C.-1)).12).1)).4)/Std(Log(C/Ref(C.-1)).5 and higher of MetaStock for Windows.-1)).-1)).-1)).100.1000. (Go Top) Volatility Bands as a Long Term Strategy This article "Volatility Bands As A Long Term Strategy". Den:=Input("Number Of Periods For Denominator". In this article the author gives formulas for three indicators MetaStock. (Log(C/Ref(C. Lookback)/Lookback Formula for earlier versions of MetaStock for Windows Volatility% 100 * Sum(100 * ATR(1)/CLOSE > 3. 50)/50 Now drag the Volatility% from the Indicator QuickList and drop it on the desired chart.4).10)/Std(Log(C/Ref(C.. These formulas use Inputs which allow you to select the time periods when you plot the formulas.Den)))/3 David Landry EMA of Historical Volatility Den:=Input("Number Of Periods For Denominator".2.1.1)). there is an error in the formula the author names Volatility 12 EMA.S.100.6)/Std(Log(C/Ref(C.e) Here are formulas for version 6. Landry.. which appears in this issue introduces two different volatility band trading systems. any standard deviation being used would return an identical value as 1 standard deviation.3)..Den))+ (Std(Log(C/Ref(C. One system uses bands .2.100). CTA.Den)))/3.D. 100 * Sum(100 * ATR(1)/CLOSE > HighVolatility. Ph.-1)).6)/Std(Log(C/Ref(C. The formula should be: Mov((Fml("CONHV4") + Fml("CONHV6") + Fml("CONHV10"))/3. Then click your right-mouse button while the cursor is over the lower band and choose properties.1.5 enter the first set of formulas. Stocks with volume > 10x the previous day's volume 2. VA (Go Top) Volume Based Exploration 1.Periods).-1). I've programmed them in MetaStock as follows: VOLUME ACCUMULATION PERCENTAGE Periods:=Input("Time Periods". To plot the Regression Asymmetric Volatility Price Bands in Metastock for Windows. 1 for standard errors.80)>200 Filter enabled: Yes (Go Top) Volume Accumulation Percentage I contacted David Vomund by e-mail and he was kind enough to mail me the equations required to calculate the VAP. Change the standard errors to 1. To recreate the systems in MetaStock for Windows.80) Filter: Vol(10. Change the standard deviations to 2. (Go Top) Volatility Over 16 Weeks Col A: CLOSE Col B: Vol(10. X:=(2*C-H-L)/(H-L). choose System Tester from the Tools menu. TVA:=Sum(V*x.based on moving averages and the other is based on bands which use regression. If you have MetaStock 6.60. Next choose New and enter the following trading rules and stop conditions. Then click your rightmouse button while the cursor is over the lower band and choose properties.-1) Filter: ColA=1 and ColB>60 (Go Top) .0) ColB = ref(barssince(V>10*ref(V. ColA = if(V > 10*ref(V.7 standard deviations. and 1 for the smoothing periods. After entering this information. This plot will now appear exactly as the bands discussed in the article. simply plot Bollinger Bands using 11 periods and 1.21).5. simply plot Standard Error Bands using 21 periods.5 allows variables which will allow you to change the periods when testing much more easily. TV:=Sum(V. To plot the Moving Average Asymmetric Volatility Price Bands in MetaStock for Windows.Periods).-1)). Stocks where the above situation hasn't occurred during the previous 60 days. choose Options and change the trade delay to 1. then change the Trade Price to Open. MetaStock 6. VA:=100*TVA/TV.1. and that value remains constant throughout that week. but double check them. but when you do this the %D always calculates using the default value of the %K slowing.. 21.1.0) Weakness In A Strong Trend In an up trend. -1) Rig this up with an OB/OS oscillator and you've got an entry that is. giving . These are designed for backtesting. -3) AND Mov(C. -4) AND Mov(C. (Go Top) Weekly Indicators MetaStock Weekly Indicators I had basically put the weekly indicators on daily charts thing on the back burner for the time being. well.. E). They look right to me. -1) <= Ref(C. -2) >= Ref(C. at least worth considering. -1) SimpleX SHORT: C >= Ref(C. simply look a weekly chart. -2) AND Ref(C. 21. E) < Ref(Mov(C. and I decided that maybe I should post these two indicators. 21. SimpleX LONG: C <= Ref(C. -3) AND Ref(C.. -3) >= Ref(C. E). -2) >= Ref(C. E). 21. 21.S) (Go Top) Volume Oscillator Wave if(oscv(1. -4) AND Mov(C..>. -1) OR C >= Ref(C. Stochastic: The %K and %K slowing can be coded to accommodate more parameters by using the user Input function. -3) AND Mov(C. 21. -2) AND Ref(C. -2) <= Ref(C. but someone mentioned the subject in an off list e-mail.50. -1) OR C <= Ref(C. -3) <= Ref(C. E). -1) >= Ref(C.so if you just gotta know on this Friday evening what the weekly value of the indicator is going to be for the following week. -2) AND Ref(C. they plot the previous weeks value beginning the first trading day of the following week. E) > Ref(Mov(C.-1) AND Ref(C. -2) AND Ref(C.%). three or four successive lower CLOSES and the EMA(21) is rising. Remember.-1) AND Ref(C. -2) <= Ref(C.1. 21.Volatility Difference mov(H-L. -1) >= Ref(C.S)/mov(H-L.-1) AND Ref(C. E) < Ref(Mov(C. -3) AND Ref(C. -1) <= Ref(C.S.50.20. 21. E) > Ref(Mov(C.-1) AND Ref(C. 0).HHigh)+ ValueWhen(2.HHigh)+ ValueWhen(3.-1))).HHigh))(ValueWhen(1. {highest high last 5 weeks} HHigh:=(ValueWhen(1.-1).Ref(C.-1).Ref(C. y.(yestClo-LLow))+ ValueWhen(3. I made the %K D as two separate indicators so that you can plot the %D a different color and/or dashed.sw>0.sw>0.sw>0.0). no %D} {start week} sw:=If(DayOfWeek()<=Ref(DayOfWeek(). {lowest low last 5 weeks} LLow:=(ValueWhen(1. slowing=3} {start week} sw:=If(DayOfWeek()<=Ref(DayOfWeek().sw>0. Ref(LowestSince(5. yestClo:=If(sw>0.sw>0.L).erroneous values.H). Ref(HighestSince(5. {`Wkly Stoch 3 per %D of a 5 per %K.sw>0.sw>0.(yestClo-LLow)))/ .0).1.0).sw>0.(yestClo-LLow))+ ValueWhen(2. yestClo:=If(sw>0.sw>0. {5 per %K.I just used the MetaStock default values as a starting point. Ref(LowestSince(5.sw>0.sw>0=1.sw>0.-1). {highest high last 5 weeks} HHigh:=(ValueWhen(1. So I just left it as is.(yestClo-LLow)))/ ((ValueWhen(1. Ref(HighestSince(5.sw>0.L).sw>0.1. slowing=3.. The Momentum indicator uses the Input function just fine.sw>0.-1))).LLow)+ ValueWhen(2.sw>0.(yestClo-LLow))+ ValueWhen(3. {`Wkly Stoch 5 per %K. {5 per %K.LLow)+ ValueWhen(3. slowing=3} y:=(ValueWhen(1.H).sw>0.sw>0.LLow)))*100.-1))).-1)))..sw>0. Youcan plug in your own values.(yestClo-LLow))+ ValueWhen(2. {lowest low last 5 weeks} LLow:=(ValueWhen(1.-1).sw>0. slowing=3} y:=(ValueWhen(1. Dw=1.10). {then}(Ref(HighestSince(1.sw>0.H).y)+ ValueWhen(3. {This plots the 3 period %D (ma) of the above.Ref(C.sw>0. . Wl:=ValueWhen(1.LLow)+ ValueWhen(2.sw>0.L).-1))/ ValueWhen(n+1.Wl1>0.-1).L).Dw=1.1.LLow)))*100. {Resistance 1} R1:=(2*PP)-Wl.PP1>0.Wh1). Wh:=ValueWhen(1.sw>0.-1). {Weekly High} Wh1:=If(Dw=1. {then}Ref(HighestSince(1. -Ken 4/16/99} n:=Input("Periods". {Support 1} S1:=(2*PP)-Wh.sw>0. PP:=ValueWhen(1.1.-1).0). Ref(C.HHigh)+ ValueWhen(3.Wl1).Dw=1.20.y))/3.-1).y)+ValueWhen(2. {start week} sw:=If(DayOfWeek()<=Ref(DayOfWeek(). {else}0).PP1).HHigh))(ValueWhen(1.H).-1) + Ref(C. (ValueWhen(1.sw>0.sw>0.0).-1)))*100 (Go Top) Weekly Pivot Point {Weekly Pivot Point Projection 8/4/99} Dw:=If(DayOfWeek()<=Ref(DayOfWeek().Wh1>0. {Weekly Low} Wl1:=If(Dw=1. {Resistance 2} R2:=(PP-S1)+R1. {Support 2} S2:=PP-(R1-S1).-1)+ Ref(LowestSince(1.sw>0.sw>0. {Weekly Typical Price} PP1:=If(Dw=1. {else}0).LLow)+ ValueWhen(3.1. z {`Wkly Momentum for DAILY Chart } {This plots WEEKLY Momentum on DAILY charts.Dw=1. {then}Ref(LowestSince(1.sw>0.} z:=(ValueWhen(1.sw>0.HHigh)+ ValueWhen(2. {else}0).-1))/3.((ValueWhen(1. -1) < L.>.-1) > H.-2) (Go Top) Wilders ATR From Equis {The actual ATR does not use a simple moving average.8. • Drag the Price Oscillator from the indicator quick list and drop it on the SPREAD plot. I recommend you plot this in a new inner window. • Select either Tbonds or Tbills as the security to use to spread. Welles Wilder uses his own smoothing (a modified exponential average) which is the function named "Wilders" in MetaStock.5 of MetaStock for Windows. R1. • Drag the Spread Indicator from the indicator quick list to this commodity chart.TIMESERIES). or perhaps move the WillSpread indicator to a separate inner window. Using version 6. perhaps named WillSpread. TH:=If(Ref(C.periods) (Go Top) WillSpread by Larry Williams The Larry Wiliams' indicator named WillSpread is quite easy to plot in MetaStock for Windows version 6.H). S2. TR:=TH-TL. This plot is the WillSpread indicator.5.R2.10). TL:=If(Ref(C. You also want to use "points" as the method.cold)and when(cola. (Go Top) Weekly Trix Moving Average Test COLA: TRIX(3) COLB: REF(TRIX(3). If you apply this template to the first commodity in your futures folder.-1) COLC: MOV(TRIX(3). Wilders(TR.0)and when(cola. The parameters Mr.<.Ref(C. If you save this first effort as a template.colc)and when(colb. you may change the Spread Indicator plot's color to match the background of the chart.Ref(C.100. you may then use the right arrow to move down the folder contents.-1). please follow these steps. Try your formula this way:} periods:=Input("ATR Periods?".<.-1). you are able to apply this template to any commodity you wish and the indicator will be automatically calculated against that commodity.TIMESERIES) COLD: REF(MOV(TRIX(3). not the price plot. You may also use the "Next Security" function within MetaStock for Windows to view each of your commodities by setting the options for next security to "Keep line studies". S1. (Go Top) Working with DMI . • At this point. Each new commodity will have the WillSpread calculated as it is loaded.>.1.8.L). Williams' uses are 7 and 11 time period exponential moving averages. • Plot the underlying commodity.-1) COLE: C Filter enabled:yes when(cola. 3. What you've just entered under MetaStock Explorer's Filter is a much more simple formula than you realise! It means only "Crossover A over B" or "Crossover 3 over 10" in ordinary English. Mov(c. Look instead at the list of options to the right. 4. and within a minute or two (depending on your computer's speed!) generate a list of all stocks meeting this particular criteria.20. Click on its tab and you're ready to write a MetaStock formula in this column. we're putting two different moving averages in the place of A and B. any formulas you like. Here's a step by step guide for beginners: 1. 6. step by step. Open up your Explorer tool in MetaStock by clicking on the little "binoculars" symbol in the upper right field of your screen. it's easy and fun." plus "Filter.s) )" but don't worry about the *spaces* between letters and punctuations marks. Here's a quick explanation to ponder. 3.s) . Click "OK" in the lower left of the Explorer field to save it and you will quickly find your own "Moving Average Crossover" Exploration added to those already on MetaStock's ready-made list.3. Choose the "New" button and click.21) CLOSE LONG: close<llv(high. B )" where A and B are other MetaStock formulas. with tabs. 2. More about these later. MetaStock writes the English language phrase "Moving Average of the past 3 days" as "mov(c. if you take it slowly. before we go further. Your first MetaStock Exploration is now finished." For now we're just going to work with the "Filter" column. Enter the following without the quotation marks: "Cross( Mov(c. seven columns.{Smoothed DMI Index (20 Period Moving Average)} Mov(PDI(14)-MDI(14). In reality. You will be presented with the Explorer screen showing a list of readymade Equis Explorations plus various options to view or edit them.S) OPEN LONG: close>hhv(low. Let's consider a common trader's question: "How can MetaStock help me find all the stocks where the 3 day moving average has just crossed above the 10 day moving average?" MetaStock's Explorer tool allows you to search all the stocks in the ASX. or find it under Tools in the drop-down menu.21) (Go Top) Writing Metastock Explorations MetaStock is a marvellous program for traders. just below. nor about capitalisation. Note that the Explorer screen has an upper section labelled "Notes" and then.s)" and the second moving average is exactly the same. 5. but can appear complicated and intimidating at first. . MetaStock writes this as "Cross( A . labelled "A" to "F. You've just starting writing your own MetaStock Exploration! MetaStock gives it the name "<New Exploration>" but let's rename it "Moving Average Crossover" for the sake of this exercise. with the numeral 10 substituted for the 3.10. In this case. 7. Ref(L.-4)) S5 Indicator: ValueWhen(5. MetaStock will quickly verify that your stocks are where you say they are. "Automated Support And Resistance. and prompt you for an "OK". the formulas provided were a bit confusing and could use some clarification. While the method was well received. Ref(H.-4) = LLV(L. Ref(L.-4)) S2 Indicator: ValueWhen(2. click on the "Explore" button and MetaStock will prompt you for the path to the place on your computer where you have all your ASX (or other) data.8. MetaStock allows you to open each or all of these stocks in full screen pages for further analysis. and each should be entered using the custom indicator option in the indicator builder. Ref(L.-4)) . Since then." also in that issue.-4)) S4 Indicator: ValueWhen(4.9). and save this as a "List" named "All" so that when you make more Explorations you won't have to go through this step again. Ref(L.-4) = LLV(L. Ref(L.-4)) R1 Indicator: ValueWhen(1. Ref(H. You can just choose the "All" list whenever you want to scan stocks. the support levels S1 through S6 and the resistance levels R1 through R6 are separate indicators (12 in all). execution was slow and screening of large numbers of stocks was difficult.-4) = LLV(L. Next. Ref(L.-4) = HHV(H.-4)) S3 Indicator: ValueWhen(3.9). Ref(L. I've received many E-mail messages from STOCKS & COMMODITIES readers about it. Ref(L. To begin. Since then. The Traders' Tip was based on my article. (Go Top) WRO and WSO Indicators In the May 1998 issue of STOCKS & COMMODITIES. you can watch a nifty screen where MetaStock outlines its search for all the stocks that match your search (Filter) criteria. a Traders' Tip provided MetaStock formulas for calculating support and resistance levels and the WRO and WSO support and resistance oscillators. Ref(L. I suggest that you choose them all to start with.-4) = LLV(L.-4)) S6 Indicator: ValueWhen(6.9).9). (Take note at this point that MetaStock has excellent assistance for you under its "Help" tab as well as one of the best software manuals ever written. Choose which securities you want to scan. When Explorer is finished you should choose the "Report" option to find a filtered list of all the stocks which *today* have their 3 day moving average rising above their 10 day moving average.9). Ref(L. Once you do this.9). How long this process takes depends once again on the speed of your computer! 10.-4) = LLV(L.-4) = LLV(L. Ref(L. S1 Indicator: ValueWhen(1. Further. Ref(L. I have developed a faster and improved method for computing these indicators.9).) 9. Ref(H. WSO Indicator: L1:=ValueWhen(1.-4)=LLV(L. they can be saved as a template and easily applied to anotherstock.-4)=LLV(L. L3:=ValueWhen(3.-4)=HHV(H.Min(1.Min(1.-4)).9).9).-4)).9).-4)).Min(1.9). L1M:= Max(0.9).Ref(H.9).-4) = HHV(H. This avoids a rare but occasional error when the price change is very large over a short period. since the new formulas are now self-contained.-4)) These 12 indicators should be individually plotted with the price data as points.9). The color red is recommended for the support levels S1 through S6 and the color blue for the resistance levels R1 through R6.Ref(H.-4)) R6 Indicator: ValueWhen(6.9).Min(1.-4) = HHV(H.Min(1.-4) = HHV(H.Int(L2/C))). but once done.-4)).9).Ref(L.Ref(H.Ref(L.Ref(L. L6:=ValueWhen(6. L4:=ValueWhen(4.Ref(L. L3:=ValueWhen(3.-4) = HHV(H.-4)) R3 Indicator: ValueWhen(3.Ref(H.Ref(L.9).9).-4)=LLV(L. L2:=ValueWhen(2.Int(L5/C))). Ref(H. 100*(1-(L1M+L2M+L3M+L4M+L5M+L6M)/6) WRO Indicator: L1:=ValueWhen(1.-4)=LLV(L.-4)). Ref(H.Ref(L.-4)).9).9).Ref(H.-4)=HHV(H.-4)).Ref(L.9). Ref(H.-4)).9).Ref(L.-4)).Ref(H.Int(L3/C))).Int(L4/C))).-4)=HHV(H.Ref(H.-4)=LLV(L.9). L5:=ValueWhen(5. If you are interested only in computing the WRO and WSO indicators.Ref(H.-4)).Int(L6/C))). It is not necessary to compute S1 through S6 or R1 through R6. Ref(H. Ref(H.Ref(H. Entering these formulas and changing the style takes a bit of time.Ref(L.-4)) R5 Indicator: ValueWhen(5. Ref(H. L5:=ValueWhen(5.Int(L1/C))). L5M:= Max(0.-4) = HHV(H. L4:=ValueWhen(4. L4M:= Max(0.Ref(L. Ref(H.Ref(L.Ref(H. L2:=ValueWhen(2. Ref(H.-4)=HHV(H. L3M:= Max(0. L6:=ValueWhen(6. L6M:= Max(0. L2M:= Max(0. . The new WRO and WSO formulas also contain max and min functions to ensure that the change for each level is either zero or 1.Ref(L. not lines (click on each and change the style to the one on the bottom of the style menu).-4)=HHV(H.-4)). then these formulas can be entered as shown here.-4)=LLV(L. Ref(H.Ref(H.R2 Indicator: ValueWhen(2.-4)) R4 Indicator: ValueWhen(4. Ref(H.-4)=HHV(H.-4)).9).Min(1. 40).Min(1.-1)*3)) Enter Short Cross(Ref(HHV(C.51. 100*(1-(L1M+L2M+L3M+L4M+L5M+L6M)/6) The WRO and WSO oscillators are generally plotted together on a separate scale from the price plot. VI Today = ATR(14) The Volatility System is: Enter Long Cross(C. The distance from yesterday's close to today's high.1.S.Min(1.Int(L1/C))).-1)*3). or 3.S.C) Zero Lag EMA Here's my Metastock 6.-1).ref(hhv(H.Int(L6/C))). issue of Technical Analysis of Stocks and Commodities.S) (Go Top) Wilder's Volatility In his book New Concepts in Technical Trading Systems.Int(L2/C))).Int(L5/C))). if(L.>. This document describes how to construct both the index and the system. as described in the April. EMA2:= Mov(EMA1.E).0 or higher you would use the following function.E). The distance from yesterday's close to today's low.Min(1.<.1. L6M:= Max(0. The Volatility Index (VI) is described by Wilder as: VI Today = (13 * VI Prev + TR1) / 14 *where TR1 is today's true range.86. EMA1:= Mov(CLOSE. talks about volatility and describes his Volatility Index and Volatility System.20. J.Min(1.Period.7). He defines the true range as the greatest of the following: 1. L3M:= Max(0. L5M:= Max(0.Int(L3/C))).Min(1.7).10.40). The distance from today's high to today's low 2.0)) (Go Top) Weekly Oscillator Segment mov(oscp(43.43.-1)+(Ref(ATR(7). L2M:= Max(0.S) (Go Top) Weekly Price Oscillator mov(oscp(10. . I've also used it to construct a Zero Lag MACD and a Zero Lag MACD trigger signal.250. It is helpful to add horizontal lines at zero and 100 on this same scale.L1M:= Max(0.2 coded version of the Zero Lag Moving Average. -1.%).10). L4M:= Max(0.-1)-(Ref(ATR(7). Horizontal lines can be added by clicking on the indicator and selecting "horizontal lines" from the Indicator Properties menu. and theyÐ¥ve been tested successfully with both end-of-day data and real-time data using MetaStock Professional Version 6. Welles Wilder Jr. (Go Top) Weekly High Low Wave if(H.-1).Int(L4/C))).%). In MetaStock version 5. These formulas run much faster (by 40 times) than the earlier formulas. Period:= Input("What Period".Ref(LLV(C.Period.Min(1.ref(llv(L. 2000. Both of these can be performed in MetaStock™ for Windows. Difference:= EMA1 .8.21.res). EMA1:= Mov(ZeroLagMACD.perc.100.E).%).-2) ) OR ( Z < Ref(Z. pc:= Abs(pc). ZeroLagEMA21:= EMA1 + Difference. -1=invalid last leg of zig. (Go Top) Zigzag Validity Indicator Spyros Raftopoulos 1=valid last leg of zig.-1) AND Ref(z. Difference:= EMA1 . Difference:= EMA1 . pc:=(C-last) * 100 / last.13.0).-1)>Ref(z. res:=If(pc>=perc .ZeroLagEMA21. SD:=(z>Ref(z. ZeroLagMACD:=ZeroLagEMA13 .-2)). ZeroLagEMA21:= EMA1 + Difference. EMA1:= Mov(CLOSE. ZeroLagMACD:=ZeroLagEMA13 . Difference:= EMA1 . Difference:= EMA1 .-1) < Ref(Z. EMA2:= Mov(EMA1. EMA2:= Mov(EMA1.13.E).E).E). ZeroLagMACD (Go Top) Zero Lag MACD Trigger Signal (To be used with the ZeroLag MACD above) EMA1:= Mov(CLOSE.EMA2.E). ZeroLagEMA13:= EMA1 + Difference. ZeroLagEMA:= EMA1 + Difference. ZeroLagEMA13:= EMA1 + Difference. DO NOT use this indicator in systems} .13.EMA2. EMA2:= Mov(EMA1.1. If(Alert(res.E).10).E). Z:=Zig(C. EMA1:= Mov(CLOSE.1.E).EMA2. ZeroLagEMA (Go Top) Zero Lag MACD EMA1:= Mov(CLOSE.-2)) OR (z<Ref(z.-1) AND Ref(Z. ZeroLagTRIG (Go Top) Zig Zag Validity perc:=Input("Percent".13.-1) AND Ref(z.EMA2. ( Z > Ref(Z.ZeroLagEMA21.-1) > Ref(Z.2.-1)<Ref(z.EMA2. EMA2:= Mov(EMA1.-1)).21.E).-1) AND Ref(Z. Ref(Z.2) AND SD. Difference:= EMA1 .E).8.21. last:=ValueWhen(1.-2) ).21. EMA2:= Mov(EMA1. ZeroLagTRIG:= EMA1 + Difference.EMA2. 10).-1) < Ref(Z.1. avg:=(zzHi+zzLo)/2.-1) AND Ref(Z.0).Hi/Lo { High/Low ZigZag v1.pr.res). res:= If(Alert(res. If(choose=1.001.-1). ( Z > Ref(Z. Z:=Zig(C.pr)=0.3. pc:=(C-last) * 100 / last.L))).100000. zzHiLo:=Zig(x.pr. res (Go Top) ZigZag .-2)) OR (z<Ref(z.%). SD:=(z>Ref(z. choose:=Input("[1]Hi/Lo ZigZag. [2]Close ZZ.zzHiLo.pr.-1)<Ref(z. [3]Peaks/Troughs". pk:=PeakBars(1.1). last:=ValueWhen(1.-1) AND Ref(Z.%). x:= If(pk. tr:=TroughBars(1.pr. Ref(Z.5). zz:=Zig(C.-1)>Ref(z. res:=If(pc>=perc .%).pktr)) Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest .-1) > Ref(Z.-2) ) OR ( Z < Ref(Z.-2) ).H.2.com } pr:=Input("ZigZag reversal amount". pc:= Abs(pc).perc:=Input("Percent".-1) AND Ref(z.100.zzLo.perc.1. zzHi:=Zig(H.zzHi.-1) AND Ref(z.If(tr.%). pktr:=pk-tr.%).If(choose=2.H.zz.2) AND SD. zzLo:=Zig(L.0. 0.pr)=0.-2)).0 }{ Plot on price chart }{ ©Copyright 2004 Jose Silva }{
[email protected](avg>Ref(avg.1.-1)). a The Butterfly.for catching trends with effective stoploss Supertrend Indicator on 5 min Nifty futures chart Copyright Suresh Gundappa 2012 SuperTrend was developed by Olivier Seban . Top 5 performing NSE charts YTD using Metastock "SURE" Indicator... Some of the variations of this pattern off. There are many uses for RSI (Relative Strength Index).k. CNX Bank Nifty .. read this through. . Nifty 10 min charts March 2013 with Metastock SURE indicator..250 points gain!! . The way we are go. then it`s a good sign to do STBT or BTST kind of trades. BTST or STBT:Intraday low or high is taken out during the last hour of trading If an Intraday low or high is taken out during the last hour of trading ..NSE Futures chart and performance : June 2013 to August 2013 using Metastock "SURE" indicator. Gartley Pattern Trading Made Easy by RAMI One of my favorite trading setups is the Gartley Pattern a. This ind.. The Secret Weapon For Trend Trading Before you go jumping to any conclusions.. 15 Basic Rules for Using Bollinger Bands Guest Author: B Y J O H N B O L L I N G E R Bollinger Bands are available on MetaStock and most charting software...No comments: Post a Comment Home Subscribe to: Posts (Atom) Translate Επ ιλογή γλώσσας Με την υποστήριξη της Μετάφραση Google Rank Popular Posts Supertrend Indicator ... An example of multi time frame NIfty trade . They have become popu.. I got lot of mails last week to show an .. 7 out o.. year 2013 has been eventful and is being heralded as "traders graveyard" y. RSI. copyright Suresh Gundappa. As we approach March as well as the first quarter end. Kotak Securities Every investment that we make. Five uses of the RSI in analyzing Equity/commodity charts In Mr.. I can say that Bank Nifty has delivered "single trade" best performance over last four years. Wilder’s book-" New Concepts in Technical Trading Systems" . ...Derivatives. AVP...As we approach September start... is made on solid reason. he discusses five uses of the RSI in analyzing commodity c. How to interpret futures price and open interest By Sahaj Agrawal. ..as players or as investors.