You visit formular pages no : since July, 1, 2002

<A> <B> <C> <D> <E> <F> <G> <H> <I> <J> <K> <L> <M> <N> <O> <P> <Q> <R> <S> <T> <U> <V> <W> <X> <Y> <Z>

((Mov(CLOSE,3,E)+Mov(CLOSE,5,E)+ This is a custom - made Formula based on Candlesticks called
This problem can be easily solved by using the following two Formulas
in Metastock's Indicator Builder. After Opening the "Indicator Builder",
choose "New" and name the Formula : "CandleShadow Resistance ", enter the
following
: Now let's build the second Formula: After Opening the "Indicator Builder", choose "New" and name the Formula : "CandleShadow Support", enter the following : ShadowSupport:=If(CLOSE>OPEN,(OPEN-LOW),(CLOSE-LOW)); Mov(ShadowSupport,3,S); {for not so short-term results, use: Mov(ShadowSupport,10,w)} and press "ok". So far we have built two Formulas, who, after measuring the shadows of the candles in our chart, they "draw" a 3-Day Mov.Average of the size of the shadows (or alternatively a 10day weighted Mov.Average). The first Formula "CandleShadow Resistance" measures the upper shadow and the second Formula "CandleShadow Support" measures the lower shadow. You can always experiment with the type of Mov.Averages (simple, weighted, exponential etc) and the periods used so as to achieve the best "optical" results. Now let's see these Formulas at work. In an UPTREND : Higher Tops in "CandleShadow Resistance " and simultaneously lower tops in "CandleShadow Support" , state a weakness of the uptrend.(bearish signal). Lower Tops in "CandleShadow Resistance " and simultaneously higher tops in "CandleShadow Support" , state a strength of the uptrend. (bullish signal). In a DOWNTREND : Higher Tops in "CandleShadow Resistance " and simultaneously lower tops in "CandleShadow Support" , state a strength of the downtrend. (bearish signal). Lower Tops in "CandleShadow Resistance " and simultaneously higher tops in "CandleShadow Support" , state a weakness of the downtrend. (bullish signal). At your disposal for any questions or comments. John D.
http://users.otenet.gr/~kontesis
Common Metastock Bar Patterns BAR - 3 Higher Highs H>Ref(H,-1) AND Ref(H,-1)>Ref(H,-2) AND Ref(H,-2)>Ref(H,-3) BAR - 3 Lower Lows & Reversal H L>Ref(L,-1) AND Ref(L,-1)<Ref(L,-2) AND Ref(L,-2)<Ref(L,-3) AND Ref(L,-3)<Ref(L,-4) BAR - 3 Lower Lows L<Ref(L,-1) AND Ref(L,-1)<Ref(L,-2) AND Ref(L,-2)<Ref(L,-3) BAR - 5 Lower Lows L<Ref(L,-1) AND Ref(L,-1)<Ref(L,-2) AND Ref(L,-2)<Ref(L,-3) AND Ref(L,-3)<Ref(L,-4) AND Ref(L,-4)<Ref(L,-5) BAR - Expansion Buy If(C > Ref(HHV(C,42),-1) AND H-L >= Ref(HHV((H-L),9),-1),1,0) BAR - Expansion Sell If(C < Ref(LLV(C,42),-1) AND (H-L) >= Ref(HHV((H-L),9),-1),1,0) BAR - Fractal-down If(LOW < Ref(LOW, -1),1,0) AND If(LOW < Ref(LOW, -2),1,0) AND If(LOW < Ref(LOW,+1),1,0) AND If(LOW < Ref(LOW,+2),1,0) BAR - Fractal-up (If(HIGH > Ref(HIGH, -1),1,0) AND If(HIGH > Ref(HIGH, -2),1,0) AND If(HIGH > Ref(HIGH, +1),1 ,0)AND If(HIGH > Ref(HIGH,+2),1,0)) BAR - Gap Down GapDown() BAR - Gap Up GapUp() BAR - H > Yesterday's H H>Ref(H,-1) BAR - Highest Bars Ago HighestBars(CLOSE) BAR - Highest High Value Bars Ago HHVBars(CLOSE,50) BAR - Inside Day + Day 3 Ref(Fml("BAR - Inside Day"),-3) BAR - Inside Day HIGH < Ref(HIGH,-1) AND LOW > Ref(LOW,-1) BAR - Lizard Buy If(O >= L + ((H-L) * .75) AND C >= L + ((H-L) * .75) AND L < Ref(LLV(L,9),-1),1,0) BAR - Lizard Sell If(O <= L + ((H-L) * .25) AND C <= L + ((H-L) * .25) AND H > Ref(HHV(H,9),-1),1,0) BAR - Narrow Range 4 HIGH - LOW < Ref(LLV(H-L,3),-1) BAR - Narrow Range 7 HIGH - LOW < Ref(LLV(H-L,6),-1) BAR - O > Yesterday's C O>Ref(C,-1) BAR - Outside Day & > C Outside() AND C>Ref(C,-1) BAR - Outside Day HIGH > Ref(HIGH,-1) AND LOW < Ref(LOW,-1) BAR - Pivot Buy If(H-L > Ref(HHV((H-L),9),-1) AND ((L <= Mov(C,50,S)) OR Ref(L,-1) <= Ref(Mov(C,50,S),-1)) AND C > Mov(C,50,S),1,0) BAR - Pivot Sell If(H-L > Ref(HHV((H-L),9),-1) AND ((H >= Mov(C,50,S)) OR Ref(H,-1) >= Ref(Mov(C,50,S),-1)) AND C < Mov(C,50,S),1,0) BAR - Reaction Day with Volume ReactionWithVol() BAR - Reaction Day Reaction() BAR - Surprise Day Down O<Ref(C,-1) AND C>O AND C<Ref(C,-1) BAR - Surprise Day Up O>Ref(C,-1) AND C<O AND C>Ref(C,-1) BAR - Trough Value - 5 Trough(1,CLOSE,5) BAR - Typical Price Typical() (from Walter Lake}
"It's a short term timing tool. It's not worth using for long term investors. Some have also suggested using periods of 25 or 50 days, though I use only 10 days. Others have suggested it's very useful when used in conjunction with Welles Wilder's RSI." Sum(If(C > Ref(C,-1), +1, If(C < Ref(C,-1), -1, 0)),10) Entry/Exit signal buy: Fml("CCIF-P")>Ref(Fml("CCIF-P"),-1) AND Cross(Fml("CCIF-P"),-100) OR Cross(Fml("CCIF-P"),100) sell: Fml("CCIF-P")<Ref(Fml("CCIF-P"),-1) AND Cross(100,Fml("CCIF-P")) OR Cross(-100,Fml("CCIF-P")) {horizontal lines @ -100 & +100} where: {"CCIF-P" is} (CCI(8)+CCI(13)+CCI(21))/3 {from Mike Arnoldi}
name: MTF-Fixed Balance Point {Multiple Time Frame "Fixed Balance Point" 4/23/99} Dw:=If(DayOfWeek()<=Ref(DayOfWeek(),-1),1,0); Wt:=If(Dw=1, {then}(Ref(HighestSince(1,Dw=1,H),-1)+ Ref(LowestSince(1,Dw=1,L),-1) + Ref(C,-1))/3, {else}0); DwP:=ValueWhen(1,Wt>0,Wt); Dwp name: MTF-Fixed Balance Point Step {Multiple Time Frame "Fixed Balance Point Step" 4/23/99} Dw:=If(DayOfWeek()<=Ref(DayOfWeek(),-1),1,0); Wt:=If(Dw=1, {then}(Ref(HighestSince(1,Dw=1,H),-1)+ Ref(LowestSince(1,Dw=1,L),-1) + Ref(C,-1))/3, {else}0); DwPs:=(ValueWhen(1,Wt>0,Wt)+ ValueWhen(2,Wt>0,Wt)+ ValueWhen(3,Wt>0,Wt)+ ValueWhen(4,Wt>0,Wt)+ ValueWhen(5,Wt>0,Wt))/5; Dwps ------------------------------------------------ name: MTF-Dynamic Balance Point {Multiple Time Frame Dynamic Balance Point 4/23/99} dt:=DayOfWeek(); dc:=If(Dt=1,BarsSince(Ref(dt,-1)=1)+1, If(Dt=2,BarsSince(Ref(dt,-1)=2)+1, If(Dt=3,BarsSince(Ref(dt,-1)=3)+1, If(Dt=4,BarsSince(Ref(dt,-1)=4)+1, BarsSince(Ref(dt,-1)=5)+1)))); DBC:=If(dc=5, {then}(Ref(HighestSince(5,dt,H),-1)+ Ref(LowestSince(5,dt,L),-1)+ Ref(CLOSE,-1))/3, {else}(Ref(HighestSince(4,dt,H),-1)+ Ref(LowestSince(4,dt,L),-1)+ Ref(CLOSE,-1))/3); DBC ------------------------------------------------ name: MTF-Dynamic Balance Point Step {Multiple Time Frame Dynamic Balance Point Step 4/23/99} Dr:= FmlVar("MTF-Dynamic Balance Point","DBC"); Dsc:=(ValueWhen(1,Dr,Dr)+ ValueWhen(5,Dr,Dr)+ ValueWhen(10,Dr,Dr)+ ValueWhen(15,Dr,Dr)+ ValueWhen(20,Dr,Dr))/5; Dsc -------------------------------------------------- name: MTF-S&R {Multiple Time Frame "Weekly Support & Resistance" 4/23/99} Dw:=If(DayOfWeek()<=Ref(DayOfWeek(),-1),1,0); Wt:=If(Dw=1, {then}(Ref(HighestSince(1,Dw=1,H),-1)+ Ref(LowestSince(1,Dw=1,L),-1) + Ref(C,-1))/3, {else}0); Wh:=If(Dw=1, {then}Ref(HighestSince(1,Dw=1,H),-1), {else}0); Wl:=If(Dw=1, {then}Ref(LowestSince(1,Dw=1,L),-1), {else}0); Wr:=ValueWhen(1,Wh>0,Wh)-ValueWhen(1,Wl>0,Wl); DwP:=ValueWhen(1,Wt>0,Wt); RR1:=DwP+(Wr*.5); RR2:=DwP+(Wr*.618); SR1:=DwP-(Wr*.5); SR2:=DwP-(Wr*.618); SR2; SR1; RR1; RR2; --------------------------------------- name: MTF-Tendency Mt:=If(DayOfWeek()=1, Ref(C,-1)- FmlVar("MTF-Fixed Balance Point","DWP"), 0); If(Mt>0,1,If(Mt<0,-1,0)) --------------------------------------- Weekly
IndicatorsMetaStock Weekly Indicators I had basically put the weekly indicators on daily charts thing on the back burner for the time being, but someone mentioned the subject in an off list e-mail, and I decided that maybe I should post these two indicators. They look right to me, but double check them. Remember, they plot the previous weeks value beginning the first trading day of the following week, and that value remains constant throughout that week. These are designed for backtesting.....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, simply look a weekly chart. Stochastic: The %K and %K slowing can be coded to accommodate more parameters by using the user Input function, but when you do this the %D always calculates using the default value of the %K slowing, giving erroneous values. So I just left it as is. Youcan plug in your own values...I just used the MetaStock default values as a starting point. I made the %K D as two separate indicators so that you can plot the %D a different color and/or dashed. The Momentum indicator uses the Input function just fine. {`Wkly Stoch 5 per %K, slowing=3, no %D} {start week} sw:=If(DayOfWeek()<=Ref(DayOfWeek(),-1),1,0); yestClo:=If(sw>0,Ref(C,-1),0); {lowest low last 5 weeks} LLow:=(ValueWhen(1,sw>0, Ref(LowestSince(5,sw>0,L),-1))); {highest high last 5 weeks} HHigh:=(ValueWhen(1,sw>0, Ref(HighestSince(5,sw>0,H),-1))); {5 per %K, lowing=3} y:=(ValueWhen(1,sw>0,(yestClo-LLow))+ ValueWhen(2,sw>0,(yestClo-LLow))+ ValueWhen(3,sw>0,(yestClo-LLow)))/ ((ValueWhen(1,sw>0,HHigh)+ ValueWhen(2,sw>0,HHigh)+ ValueWhen(3,sw>0,HHigh))- (ValueWhen(1,sw>0,LLow)+ ValueWhen(2,sw>0,LLow)+ ValueWhen(3,sw>0,LLow)))*100; y; ===================== {`Wkly Stoch 3 per %D of a 5 per %K, slowing=3} {start week} sw:=If(DayOfWeek()<=Ref(DayOfWeek(),-1),1,0); yestClo:=If(sw>0,Ref(C,-1),0); {lowest low last 5 weeks} LLow:=(ValueWhen(1,sw>0, Ref(LowestSince(5,sw>0=1,L),-1))); {highest high last 5 weeks} HHigh:=(ValueWhen(1,sw>0, Ref(HighestSince(5,sw>0,H),-1))); {5 per %K, slowing=3} y:=(ValueWhen(1,sw>0,(yestClo-LLow))+ ValueWhen(2,sw>0,(yestClo-LLow))+ ValueWhen(3,sw>0,(yestClo-LLow)))/ ((ValueWhen(1,sw>0,HHigh)+ ValueWhen(2,sw>0,HHigh)+ ValueWhen(3,sw>0,HHigh))- (ValueWhen(1,sw>0,LLow)+ ValueWhen(2,sw>0,LLow)+ ValueWhen(3,sw>0,LLow)))*100; {This plots the 3 period %D (ma) of the above.} z:=(ValueWhen(1,sw>0,y)+ValueWhen(2,sw>0,y)+ ValueWhen(3,sw>0,y))/3; z ======================== {`Wkly Momentum for DAILY Chart } {This plots WEEKLY Momentum on DAILY charts. -Ken 4/16/99} n:=Input("Periods",1,20,10); {start week} sw:=If(DayOfWeek()<=Ref(DayOfWeek(),-1),1,0); (ValueWhen(1,sw>0,Ref(C,-1))/ ValueWhen(n+1,sw>0, Ref(C,-1)))*100 from Ken
M
odified Williams %R Metastock Indicatorby Rajat BosePeriods := Input("Time Period", 3,50,5); NumDev := Input("No. of Standard Deviations", 1,5,2); (100*(C-BBandBot(C, Periods, S, NumDev))/((( BBandTop(C, Periods, S, NumDev))-(BBandBot(C, Periods, S, 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. I have tested it on various time periods (for Bollinger Bands) using 2 standard deviations. It sometimes gives an early indication of reversals than the Williams %R of the same period. Divergences have also been somewhat better. However, the structure shows that most of its properties are similar to those of the Williams %R or, for that matter, of any other overbought-oversold indicator.}
(Note this is not the same as the formula given in Trading Tactics. Daryl Guppy) Try MMA (Multiple Moving Averages). The shorter ones are closer to the action and the longer ones tell you about the trend. I use two indicators like this: Name: MMA Long Term -------- Mov(C,40,E); Mov(C,45,E); Mov(C,50,E); Mov(C,55,E); Name: MMA Short Term -------- Mov(C,5,E); Mov(C,8,E); Mov(C,11,E); Mov(C,14,E); In the current market I like taking short momentum trades where the MMA Short is bouncing up off a slowly rising MMA Long Term. The exit at the top of the bubble is indicated by MMA Short turning down after a good separation from the underlying MMA Long. from Jeff Lederman. {Suggestion: Create a single TEMPLATE with all the above indicators, giving SHORT and LONG MMAs separate colours; e.g., RED for the SHORTs and BLUE for the LONGs.}
Stop Loss
Indicatorperiodsshort:=Input("periods if short",1,50,10); periodslong:=input("periods if long",1,50,10); HHV(H,periodsshort)-atr(periodsshort);{stop loss level for short positions} LLV(L,periodslong)+ATR(periodslong);{stop loss level for long positions} {by Eric
Kendall}
Enter Long: Mov(C,5,E) > Mov(C,13,E) AND Mov(C,13,E) > Mov(C,40,E) Close Long: Cross(Mov(C,13,E),Mov(C,5,E)) Now you can play with these combinations on both the enter long and close long side. For example, keep the same Enter Long but change the Close Long to = Cross(Mov(C,40,E) ,Mov(C,5,E) ) This will keep you in the trade longer. You may want to enter when the 5 crosses above the 13 and not wait for the 40 OR, you may just want to use the 5 cross above the 40 and forget about the 13. (created by
David Evans)
Mov(C,2,S)>
This is a long formula so I broke it up into four pieces. GRII is
derived from formulas 1, 2, and 3.
I was only able to implement Krausz's Gann Swing HiLow Activator in Metastock, 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,3,S),-1) or Ref(Mov(H,3,S),-1)
Use of Tema PV Binary Wave and Tema QStick Formulas in MetaStock, from "JimG" There are really two different ways to use these formulas. Since the Binary Wave is a smoothed addition of several technical indicators that each give +1 when bullish, 0 when neutral and -1 when negative, it makes sense that a positive number is bullish and rising numbers are bullish. Similarly negative numbers and falling numbers are bearish. The QStick is really a candlestick type indicator, but can be read as bullish or bearish in same way as the Binary Wave. 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, or to buy on a zero cross over to the upside and sell on a zero crossover to the downside. Of course you can optimize and find various buy and sell levels as long as you understand what is bearish and what is bullish. 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. Having said that, I don't make my buy an sell decisions from the indicators or the system test. 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. I make all buying and selling decisions based on the trend channels. Over the years, I've found that works best for me.
Trough(1,L,10)+ ((((Trough(1,L,10)-Trough(2,L,10)) / (TroughBars(2,L,10)-TroughBars(1,L,10))) *TroughBars(1,L,10))) This formula will draw a trendline from the most recent bottom. The L (low) can be changed to C (close) and the 10 can be changed to a different percent value. You will also need to change the line style to the last one in the drop down list.
Those who know me have found out I vacillate between the VERY complicated and the very simple. I have been following a few stocks (medium volatility, 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. I wanted to track those that did best and those that were not as effective. I also tracked those formulas that were late in showing turns in momentum vs those that caught the turn close on. In this regard, I was looking for finding stocks at intermediate term lows and highs, NOT for indicators that identified stocks that had begun their run in any direction and were destined to continue. As a result, I came up with a very simple indicator that showed a HIGH degree of accuracy in "turn-calling", but it did NOT give me indication of the strength or duration of the new move, only that it probably would occur. 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, and that only signals that identify stocks WITHIN a momentum trend (ie..already established) are able to do that. My momentum trend change indicator is derived from an intermediate trend indicator I've used for some time in MSWIN 6.0... PDI(34) - MDI(34) My new formula is........... ((PDI(8) - MDI(8)) - (PDI(21) - MDI(21))) + (PDI(13) - MDI(13)) Try it......I think you'll like it......and it's the same coding in WOW, I believe..........BW Chan I have posted an update to the RMTA and TOSC formula's, the first formulas had an "Absolute Value" that wasn't called for in the article ( I had mistaken the "[" "]" to mean "|" "|"). The new formulas seem to plot exactly as the old......but I wanted the code to match the math in the article. Thanks go out to William Golson for the help.
{ 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} He then explains how to make an oscillator by subtracting an Exponential MA form the Recursive MA...... again here is the code: {TOSC} Here is the code for System Testing; Lb:=opt1; Sell short: Lb:=opt1; Opt1 is the look- back periods, of 3 to 30, and Opt2 is
the entry value of the oscillator, 0 to 5.
Inside days suggest a volatility compression and often preceede strong breakouts. Search returns 1 for ok and 0 for not ok - Inside()
- Inside()-1
- Inside()-2
Column
A Shows stocks where the price increased 5% and the volume is 50% above a 50-day moving average. Rank results by % change in price, then check the volume.
These are a collection of bottom signals. The search returns 1 for Ok and 0 for not ok.
Shows stocks which have gapped up or down on the open compared to yesterdays price. The search returns 1 for Ok and 0 for not ok.
Shows stocks which have closed higher on successive days.
This is a10 and 30 day moving average crossover search. Results close to 0 pinpoint the crossover.
Shows those stocks where an MACD crossover has been signalled.The search returns 1 for Ok and 0 for not ok.
Stocks sorted on % gains over 1, 2, 3, 4, and 5 days. Rank results for the selected day. Good for finding breakout stocks.
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.
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.
Displays those where volume is above the 100 day moving average. The search returns 1 for Ok and 0 for not ok. - VOLUME
- Mov(VOLUME,100,EXPONENTIAL)
- ((VOLUME - Mov(VOLUME,100,EXPONENTIAL))
- /Mov(VOLUME,100,EXPONENTIAL)) * 100
- When(colA,>,colB)
They are contributed by Patrick who notes
"my limited Spanish suggests that they are simply a random
collection made by the web owner, 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, the complete
formula that particular number represents. In this way, each becomes
independent." We have included all 80 of them, complete with the orginal
Spanish cover note.
In the Oct issue of "Futures" there is an article written by Dennis
McNicholl called "Better Bollinger Bands". In his
This formula is for version 6.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.
"This indicator, a long - term stock market investment tool, compares the performance of the S&P 500 to the New York Stock Exchange index to measure sentiment. The theory is that investors have a preference for certain types of investments, blue chips versus mid-cap, during phases of a bull market." To plot this in MetaStock for Windows, follow these instructions. When complete, if you save this as a chart, you will simply need to load the chart and it will recalculate using the newest data. - Open a chart of the S&P 500.
- Open a chart of the New York Stock Exchange index.
- Drag the S&P 500 price plot into the NYSE chart.
- Drop the indicator listed below on the plot of the S&P 500. The plot will turn a different color when you are pointing at it.
- The resultant plot is the Investor Preference Index.
Formula: Investor Preference Index: (Sum(Mov(ROC(Log(C),24,%)-ROC(Log(P),24,%),15,S)-Mov(ROC(Log(C),24,%)-ROC(Log(P),24,%),38,S),54)+1)*100 System test: Enter Long C=HHV(C,26) Close Long Fml("Investor Preference Index")<97.6 AND ROC(Fml("Investor Preference Index"),2,$)<=(-.04)
((tp*(Sum(Cum(1)*C,tp)))-(Sum(Cum(1),tp)*(Sum(C,tp))))/((tp*Sum(Pwr(Cum(1),2),tp))-Pwr(Sum(Cum(1),tp),2)) The Larry Wiliams' indicator named WillSpread
is quite easy to plot in MetaStock for Windows version 6.5. -
- Plot the underlying commodity.
- Drag the Spread Indicator from the indicator quick list to this commodity chart.
- Select either Tbonds or Tbills as the security to use to spread. I recommend you plot this in a new inner window.
- Drag the Price Oscillator from the indicator quick list and drop it on the SPREAD plot, not the price plot. The parameters Mr. Williams' uses are 7 and 11 time period exponential moving averages. You also want to use "points" as the method. This plot is the WillSpread indicator.
- At this point, you may change the Spread Indicator plot's color to match the background of the chart, or perhaps move the WillSpread indicator to a separate inner window.
If you save this first effort as a template, perhaps named WillSpread, you are able to apply this template to any commodity you wish and the indicator will be automatically calculated against that commodity. 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". If you apply this template to the first commodity in your futures folder, you may then use the right arrow to move down the folder contents. Each new commodity will have the WillSpread calculated as it is loaded.
The following collection of formulas are taken from Stocks and
Commodities magazine. A subscription soon pays for itself. This is a
selection of those more useful for Australian conditions. Others are
available from
http://www.equis.com/customer/support/1996 August TASC Trader's Tips
Here is the Connors and Raschke's historical volatility system exploration in August 1996 TASC Trader's Tips translated for MetaStock. COLUMN FORMULAS Column A : Vol ratio std(log(C/ref(C,-1)),5)/std(log(C/ref(C,-1)),99) Column B : NR4 day if(HIGH-LOW,<,ref(llv(H-L,3),-1),1,0) Column C : Inside if(HIGH,<,ref(HIGH,-1),if(LOW,>,ref(LOW,-1),1,0),0) Column D : High HIGH Column E : Low LOW FILTER FORMULA Formula: when(colA,<,0.5) AND (when(colB,=,1) OR when(colC,=,1)) 1997 October TASC Traders Tip
This article "Volatility Bands As A Long Term
Strategy", To plot the Regression Asymmetric Volatility Price Bands in Metastock for Windows, simply plot Standard Error Bands using 21 periods, 1 for standard errors, and 1 for the smoothing periods. Then click your right-mouse button while the cursor is over the lower band and choose properties. Change the standard errors to 1.5. To recreate the systems in MetaStock for Windows, choose System Tester from the Tools menu. Next choose New and enter the following trading rules and stop conditions. After entering this information, choose Options and change the trade delay to 1, then change the Trade Price to Open. If you have MetaStock 6.5 enter the first set of formulas. MetaStock 6.5 allows variables which will allow you to change the periods when testing much more easily.
SIGNAL FORMULAS
BuySignal1 := Sum(CLOSE > UpperBand,3) = 3; BuySignal2 := CLOSE > UpperBand AND Ref(LOW,-1) > Ref(upperband,-1); BuySignal3 := LOW > UpperBand AND Ref(CLOSE,-1) > Ref(upperband,-1); BuySignal4 := CLOSE > UpperBand AND CLOSE > 1.4 * LLV(LOW,Periods + 1) AND Mov(VOLUME,3,S) > 2000 {assuming volume in 100's otherwise use 200000} AND Mov(HIGH,3,S) > UpperBand AND Mov(HIGH - LOW,3,S) > Mov(HIGH - LOW,Periods,S); BuySignal1 OR BuySignal2 OR BuySignal3 OR BuySignal4
SellSignal1 := Sum(CLOSE < LowerBand,3) = 3; SellSignal2 := CLOSE < (1-.18) * HHV(HIGH,Periods + 1) AND Sum(CLOSE < LowerBand,2) = 2; SellSignal3 := CLOSE < (1-.18) * HHV(HIGH,Periods + 1) AND HIGH < LowerBand; SellSignal1 OR SellSignal2 OR SellSignal3
10.00 Percent
SIGNAL FORMULAS
Sum(CLOSE > UpperBand,3) = 3 AND LinRegSlope(CLOSE,21) > 0 AND ROC(Correl(CLOSE,Cum(1) ,21,0),2,$) >= .2
SellSignal1 := Sum(CLOSE < LowerBand,3) = 3; SellSignal2 := CLOSE < (1-.18) * HHV(HIGH,Periods + 1) AND HIGH < LowerBand; SellSignal1 OR SellSignal2
Maximum Loss: LONG ONLY 10.00 Percent 1997 November TASC Traders Tip In MetaStock for Windows, 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. To do this, choose Expert Advisor from the Tools menu and then choose New. Enter the following Expert Highlights and Expert Symbols into your Expert.
Name: RSI > 50 Condition: RSI(14) > 50 Color: Dk Green Name: RSI < 50 Condition: RSI(14) < 50 Color: Red
Name: Isolated Low Condition: LOW < Ref(LOW,-1) AND LOW < Ref(LOW,1) Graphic: Buy Arrow Color: Black Label: Isolated Low Name: Isolated High Condition: HIGH > Ref(HIGH,-1) AND HIGH > Ref(HIGH,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.g. change Isolated High to IH). Next, close the Expert Advisor, open any chart, and then click the right-mouse button on the chart’s heading. Choose Expert Advisor and then Attach from the Chart Shortcut Menu. You can now choose Fibonacci Retracement from the Insert menu, and then drag from one isolated extreme to another. In MetaStock 6.5 you should right-click on the Fibonacci Retracement lines and choose properties. Check the Snap to Price checkbox so the Retracement lines will automatically snap to the high and low prices. 1997 December TASC Trader's Tip You can easily create the Volatility% Indicator from William Brower’s article in MetaStock for Windows. First choose Indicator Builder from the Tools menu in MetaStock. Next choose New and enter one of the following formulas:
Lookback := Input("Time Periods",1,1000,50); HighVolatility := Input("High Volatility %",.01,100,3); 100 * Sum(100 * ATR(1)/CLOSE > HighVolatility, Lookback)/Lookback
100 * Sum(100 * ATR(1)/CLOSE > 3, 50)/50 Now drag the Volatility% from the Indicator QuickList and drop it on the desired chart.
1998 February TASC
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:=Zig(C,10,%)<Ref(Zig(C,10,%),-1) AND Ref(Zig(C,10,%),-1)>Ref(Zig(C,10,%),-2); TR:=Zig(C,10,%)>Ref(Zig(C,10,%),-1) AND Ref(Zig(C,10,%),-1)<Ref(Zig(C,10,%),-2); PK1:=PeakBars(1,C,10); PK2:=PeakBars(2,C,10); (ValueWhen(1,PK,Ref(C,-1))/ValueWhen(2,PK,Ref(C,-1))>.96 AND ValueWhen(1,PK,Ref(C,-1)) / ValueWhen(2,PK,Ref(C,-1))<1.04) AND PK2-PK1>=10 AND Cross(ValueWhen(1,TR,Ref(C,-1)),C) Double Bottoms PK:=Zig(C,10,%)<Ref(Zig(C,10,%),-1) AND Ref(Zig(C,10,%),-1)>Ref(Zig(C,10,%),-2); TR:=Zig(C,10,%)>Ref(Zig(C,10,%),-1) AND Ref(Zig(C,10,%),-1)<Ref(Zig(C,10,%),-2); TR1:=TroughBars(1,C,10); TR2:=TroughBars(2,C,10); (ValueWhen(1,TR,Ref(C,-1))/ValueWhen(2,TR,Ref(C,-1))>.96 AND ValueWhen(1,TR,Ref(C,-1)) / ValueWhen(2,TR,Ref(C,-1))<1.04) AND TR2-TR1>=10 AND Cross(C,ValueWhen(1,PK,Ref(C,-1)))
1998 May TASC Trader's Tip
Copied from Technical Analysis of Stocks and
Commodities Magazine. This is in regards to an article on page 51 of the
May 1998 issue.
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))
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))
The indicators S1 through S6 and R1 through R6 should be plotted as points and not as a continuous line.
1998 June TASC Traders' Tip
Mutated Variables, Volatility and a New Market Paradigm by Walter T. Downs, Ph.D. In MetaStock for Windows 6.0 or higher, use the Expert Advisor to create highlights, which will show when contraction and expansion phases are present. First, choose Expert Advisor from the tools menu in MetaStock. Create a new Expert with the following highlights: Expert name:
Name: Contraction Condition: BBandTop(CLOSE,28,SIMPLE,2)< Ref(BBandTop(CLOSE,28,SIMPLE,2),-1) AND BBandBot(CLOSE,28,SIMPLE,2)>Ref(BBandBot(CLOSE,28,SIMPLE,2),-1) Color: Blue Name: Expansion Condition: BBandTop(CLOSE,28,SIMPLE,2)> Ref(BBandTop(CLOSE,28,SIMPLE,2),-1) AND BBandBot(CLOSE,28,SIMPLE,2)<Ref(BBandBot(CLOSE,28,SIMPLE,2),-1) Color: Red Click OK to save the changes to the Expert. Open a chart and then click your right-mouse button while pointing at the chart heading. Choose Expert Advisor and then choose Attach from the chart shortcut menu. Choose the New Market Paradigm Expert and then click the OK button. The price bars in the chart will be highlighted blue during a contraction phase and red in an expansion phase. 1998 July Trader's Tip 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. After opening a chart, you may want to zoom in a little to make it easier to draw the Trend Channels more precisely. You can do this by clicking on the "+" button located on the Chart Toolbar at the bottom of the chart. Next you may want to identify the bars for the support or resistant points by drawing circles on the bars as Mr. Hartle did in the article, or you can use symbols from the symbol pallete. Both can be chosen from the Drawing Toolbar which is on left side of the chart. After identifying the points to draw the trendline, click on the Trendline button, also located on the Drawing Toolbar, and draw the trendline between the closing prices of the two bars. If you are using MetaStock 6.5, you may want to right-click on the trendline, choose properties, and then check the Snap to Price checkbox. This will make the trendline line up exactly with the closing prices. To create the second trendline of the Trend Channel, right-click on the first trendline and choose Create Parallel Line. Drag this parallel line so it aligns with the highest high between the two support points or the lowest low between two resistance points. If desired, you can go to the properties of each of these trendlines and choose to extend the lines to the right.
Many moons ago, I posted a little linear regression system that featured the Forecast Oscillator. The response was surprising (lots of it) and today, I still communicate with many of the original respondents. I've continued to use the same "framework" for my testing. In an earlier post today (a private email that made it to the list...I'm a little dingy tonight...had to get up a 5 am to trade cocoa), I alluded to using the CMO. I've used many indicators in these tests (i.e., Forecast Oscillator, a modified Time Series Forecast, MACD Histogram, Bollinger Band Histogram, CMO, & others). Before I explain the method to my madness, please read the following sentences carefully. Backtesting systems is very dangerous. The act of backtesting is not the dangerous part...believing that the results can be duplicated in the future is very dangerous. Let's face it, we are "best fitting" circumstances to static prices etched in stone. So please, I'd prefer not to hear the lectures about the folly I pursue. I've been system testing since 1975 and I've made a bazillion mistakes (and a little chump change) over the years. I'm still looking for the holy grail. So, here's the outline: 1. The basic formula: Enter Long: Cross(opt1,ForecastOsc(CLOSE,opt3)) Close Long: Cross(ForecastOsc(CLOSE,opt3),opt2) Enter Short: Cross(ForecastOsc(CLOSE,opt3),opt2) Close Short: Cross(opt1,ForecastOsc(CLOSE,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. 2. opt3: In this search "opt3" represents the number of days inserted into the forecast oscillator. I usually use three (3) to ten (10) for the forecast oscillator, but if I'm using a custom formula, sometimes I don't even need opt3, because I using a fixed set of parameters within the custom formula. 3. opt1: Opt1 is the numeric value below a zero basis line that will trigger a long position and close out the short. Yes Virginia, in my secular little world, I prefer stop and reverse trading. The parameters for this option depends on the commodity (and yes, it does work on stocks) you're trading. One must eyeball the forecast oscillator to see how far it swings above and below zero. For the forecast oscillator, I usually use 0 to -3. 4. opt2: Opt2 is the numeric value above a zero basis line that will trigger a short sale. Zero to 3 seems to work for this formula. 5. Steps: I step opt3 using whole numbers to represent days. With Opt1 and Opt2, I use: .1 steps. 6. Other indicators: When substituting the CMO (or any indicator) for the Forecast Oscillator, one must be aware of the terrain the indicator travels over. 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). The overall theory behind this test is that many indicator oscillate from positive to negative and back again (duh). The trick is not to trigger action when the indicator turns in a new direction (if you're interested, I've been down that road and I'm still wearing a neck brace from the whiplash). The theory is that once an indicator extends to a certain level, the market is either overbought or oversold. In downtrending markets (can you spell deflation?), the short sale trigger (opt2) is going to be closer to the zero basis line than opt1. Please see the attachment. What will happen when the grains, cocoa, crude, 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. In a perfectly sideways market, one would assume that the trigger points would be equal distance from zero. As in many markets, this system works better when things trend indefinitely. I hope this post will help others who have inquired about the linear regression system. Attached is the original system, using the Forecast Oscillator, for March Crude Oil. In this example, opt3 is set to 8 (number of days in the forecast oscillator); opt2 is .1 (sell signal); opt1 is -2.3 (buy signal). To quote R.N. Elliot: "Even though we many not understand the cause underlying a particular phenomenon, we can, by observation, predict the phenomenon's recurrence." To qoute Karnack (my alter ego): "I got knocked down seven times and got up eight". Finally, from a trader on the realtraders forum: "Futures trading involves financial risk, lots of it". Sweet dreams, Steve Karnish CCT Following are the Bill William's Alligator indicators I put together.
{from Richard Estes}
MetaStock for Windows System Tester 01_R2/Regress Slope/MFI/TSF - (Vol Rqd) --------------- Enter Long: Alert(RSquared(C,21) < 0.15,21) AND LinRegSlope(C,34) > opt1 AND HHV(LinRegSlope(C,34),5) = HHV(LinRegSlope(C,34),13) AND HHV(MFI(55),5) = HHV(MFI(55),13) AND HHV(TSF(C,55),5) = HHV(TSF(C,55),13) Close Long: LLV(TSF(C,55),5) = LLV(TSF(C,55),13) AND LinRegSlope(C,34) < opt1 Enter Short: Alert(RSquared(C,21) < 0.15,13) AND LinRegSlope(C,34) < opt2 AND LLV(LinRegSlope(C,34),5) = LLV(LinRegSlope(C,34),13) AND LLV(MFI(55),5) = LLV(MFI(55),13) AND LLV(TSF(C,144),5) = LLV(TSF(C,144),13) Close Short: HHV(TSF(C,144),5) = HHV(TSF(C,144),13) OPTIMIZATION VARIABLES ---------------------- OPT1: Min = -0.10 Max = 0.00 Step = 0.10 OPT2: Min = -0.20 Max = 0.00 Step = 0.10 STOPS ALL OFF ------------------------------------------------------------ 02_R2/Regress Slope/CMO - All SIGNAL FORMULAS --------------- Enter Long: Alert(RSquared(C,21) < 0.15,21) AND LinRegSlope(C,34) > opt1 AND HHV(LinRegSlope(C,34),5) = HHV(LinRegSlope(C,34),13) AND CMO(C,55) > 0 AND C = HHV(C,5) Close Long: LinRegSlope(C,34) < opt1 AND CMO(C,55) < 0 AND C = LLV(C,5) Enter Short: Alert(RSquared(C,21) < 0.15,13) AND LinRegSlope(C,34) < opt2 AND LLV(LinRegSlope(C,34),5) = LLV(LinRegSlope(C,34),13) AND CMO(C,55) < 0 AND C = LLV(C,5) Close Short: LinRegSlope(C,34) > opt2 AND CMO(C,55) > 0 AND C = HHV(C,5) OPTIMIZATION VARIABLES ---------------------- OPT1: Min = -0.10 Max = 0.00 Step = 0.10 OPT2: Min = -0.20 Max = 0.00 Step = 0.10 STOPS ALL OFF ------------------------------------------------------------ 03_R2/Regress Slope/Qstick - (OHLC Rqd) SIGNAL FORMULAS --------------- Enter Long: Alert(RSquared(C,21) < 0.15,21) AND LinRegSlope(C,34) > opt1 AND HHV(LinRegSlope(C,34),5) = HHV(LinRegSlope(C,34),13) AND Qstick(55) > opt1 AND HHV(Qstick(55),5) = HHV(Qstick(55),13) AND C=HHV(C,5) Close Long: LinRegSlope(C,34) < opt1 AND Qstick(55) < opt1 AND C = LLV(C,5) Enter Short: Alert(RSquared(C,21) < 0.15,13) AND LinRegSlope(C,34) < opt2 AND LLV(LinRegSlope(C,34),5) = LLV(LinRegSlope(C,34),13) AND Qstick(55) < opt2 AND LLV(Qstick(55),5) = LLV(Qstick(55),13) AND C = LLV(C,5) Close Short: LinRegSlope(C,34) > opt2 AND Qstick(55) > opt2 AND C = HHV(C,5) OPTIMIZATION VARIABLES ---------------------- OPT1: Min = -0.10 Max = 0.00 Step = 0.10 OPT2: Min = -0.10 Max = 0.00 Step = 0.10 STOPS ALL OFF ------------------------------------------------------------ 04_R2/Regress Slope/CCI/TSF - All SIGNAL FORMULAS --------------- Enter Long: Alert(RSquared(C,21) < 0.15,21) AND LinRegSlope(C,34) > opt1 AND HHV(LinRegSlope(C,34),5) = HHV(LinRegSlope(C,34),13) AND HHV(CCI(55),5) = HHV(CCI(55),13) AND CCI(55) > 0 AND HHV(TSF(C,55),5) = HHV(TSF(C,55),13) AND C = HHV(C,5) Close Long: LLV(TSF(C,55),5) = LLV(TSF(C,55),13) AND LinRegSlope(C,34) < opt1 AND CCI(55) < 0 AND C = LLV(C,5) Enter Short: Alert(RSquared(C,21) < 0.15,13) AND LinRegSlope(C,34) < opt2 AND LLV(LinRegSlope(C,34),5) = LLV(LinRegSlope(C,34),13) AND LLV(CCI(55),5) = LLV(CCI(55),13) AND LLV(TSF(C,144),5) = LLV(TSF(C,144),13) AND C = LLV(C,5) Close Short: HHV(TSF(C,144),5) = HHV(TSF(C,144),13) AND C = HHV(C,5) OPTIMIZATION VARIABLES ---------------------- OPT1: Min = -0.10 Max = 0.00 Step = 0.10 OPT2: Min = -0.20 Max = 0.00 Step = 0.10 STOPS ALL OFF {from "Jim Greening" JimGinVA@msn.com}
Symmetry:=.28;
exploration by Jim Greening
Notes: KST BUY SIGNAL FROM BELOW ZERO ColA: Name: Close CLOSE ColB: Name: KST (Mov(ROC(C,10,%),10,S)*1)+(Mov(ROC(C,15,%),10,S)*2)+ (Mov(ROC(C,20,%),10,S)*3)+(Mov(ROC(C,30,%),15,S)*4) ColC: Name: KST MA Mov((Mov(ROC(C,10,%),10,S)*1)+(Mov(ROC(C,15,%),10,S)*2)+ (Mov(ROC(C,20,%),10,S)*3)+(Mov(ROC(C,30,%),15,S)*4),10,S) ColD: Name: KST-1 Ref( (Mov(ROC(C,10,%),10,S)*1)+(Mov(ROC(C,15,%),10,S)*2)+ (Mov(ROC(C,20,%),10,S)*3)+(Mov(ROC(C,30,%),15,S)*4),-1) ColE: Name: MA KST-1 Ref(Mov((Mov(ROC(C,10,%),10,S)*1)+(Mov(ROC(C,15,%),10,S)*2)+ (Mov(ROC(C,20,%),10,S)*3)+(Mov(ROC(C,30,%),15,S)*4),10,S),-1) Filter: When(colB,>,colC)AND When(colB,<,0)AND When( colD,<,colE)
Place in FILTER section of Exploration. No other information need be entered in the Exploration columns.} When(C-Mov(C,25,S),>,0) AND When(Ref(C-Mov(C,25,S),-1),<=,0) AND When(HHV(Mov(Ref(C-Mov(C,25,S),-1),3,S),19),<=,0) AND When(C,<,0.8*HHV(C,260)) {This means: when today's (close - moving average) > 0, when yesterday's (close - moving average) <= 0, when highest value of 3 day moving average of yesterday's (close - moving average) over past 19 days <= 0, and finally, when today's close < 80% of highest value of all closes for past year. (The third test is to eliminate past false breakouts.)} Dunn-Type 1{Market swing is defined as: Up = higher highs and higher lows, Down = lower highs and lower lows.} TD1:=If(BarsSince(H>Ref(H,-1) AND L>Ref(L,-1)) < BarsSince(L<Ref(L,-1) AND H<Ref(H,-1)), {then}1, {else}-1); TD1 Dunn-Type 2{Market swing is defined as: Up = 2 higher highs and 2 higher lows, Down = 2 lower highs and 2 lower lows.} TD1:=If(BarsSince((H>Ref(H,-1) AND L>Ref(L,-1)) AND (Ref(H,-1)>Ref(H,-2) AND Ref(L,-1)>Ref(L,-2))) < BarsSince((L<Ref(L,-1) AND H<Ref(H,-1)) AND (Ref(L,-1)<Ref(L,-2) AND Ref(H,-1)<Ref(H,-2))), {then}1, {else}-1); TD1
Explanation of the Dynamic Multiple Time Frame Indicator by the author,
Adam Hefner:
I was only able to implement Krausz's Gann Swing HiLow Activator in
Metastock,
in MetaStock, from Is a binary consisting of 8
indicators.}
{NOTE: under Color/Style options, change plot to last "style" option} {revised 1 Jan 99} Mc1:=BarsSince(DayOfWeek()=1); Fc1:=BarsSince(DayOfWeek()=5); Fc2:=Ref(BarsSince(DayOfWeek()=5),-1)-1; {Fixed Balance Point Calculation} FBC:=If(Mc1=0 AND Fc1>2, {then}(Ref(HHV(H,LastValue(mc1)),-1)+ Ref(LLV(L,LastValue(Mc1)),-1)+ Ref(C,-1))/3, {else}If(Fc1=0 AND Mc1>5, {then}(HHV(H,LastValue(Fc2))+ LLV(L,LastValue(Fc2))+C)/3, {else}If(Fc1=0, {then}(HHV(H,LastValue(Mc1))+ LLV(L,LastValue(Mc1))+C)/3, {else}0))); {Fixed Balance Point Plot} FBP:=ValueWhen(1,FBC>0,FBC); FBP;
{NOTE: under Color/Style options, change plot to last "style" option} {Weekly Price Range Calculation} Mc1:=BarsSince(DayOfWeek()=1); Fc1:=BarsSince(DayOfWeek()=5); Fc2:=Ref(BarsSince(DayOfWeek()=5),-1)-1; WRC:=If(Mc1=0 AND Fc1>2, {then}Ref(HHV(H,LastValue(mc1)),-1)- Ref(LLV(L,LastValue(Mc1)),-1), {else}If(Fc1=0 AND Mc1>5, {then}HHV(H,LastValue(Fc2))- LLV(L,LastValue(Fc2)), {else}If(Fc1=0, {then}HHV(H,LastValue(Mc1))- LLV(L,LastValue(Mc1)), {else}0))); WRP:=ValueWhen(1,WRC>0,WRC); {Resistance Range} RR1:= FmlVar("FT-FBP","FBP")+(WRP*.5); RR2:= FmlVar("FT-FBP","FBP")+(WRP*.618); {Support Range} SR1:= FmlVar("FT-FBP","FBP")-(WRP*.5); SR2:= FmlVar("FT-FBP","FBP")-(WRP*.618); {Plot Ranges} RR1; RR2; SR1; SR2;
FPS:=(ValueWhen(1,FmlVar("FT-FBP","FBC")>0, FmlVar("FT-FBP","FBC")) + ValueWhen(2,FmlVar("FT-FBP","FBC")>0, FmlVar("FT-FBP","FBC")) + ValueWhen(3,FmlVar("FT-FBP","FBC")>0, FmlVar("FT-FBP","FBC")) + ValueWhen(4,FmlVar("FT-FBP","FBC")>0, FmlVar("FT-FBP","FBC")) + ValueWhen(5,FmlVar("FT-FBP","FBC")>0, FmlVar("FT-FBP","FBC")))/5; FPS
dt:=DayOfWeek(); DBC:=(HighestSince(5,DayOfWeek()=dt,H)+ LowestSince(5,DayOfWeek()=dt,L)+CLOSE)/3; DBC
periods1:=Input("Periods of ROC",2,50,12); periods2:=Input("Smoothing Period",1,50,1); Input("horizontal line 1",-50,50,5); Input("horizontal line 2",-50,50,-5); Mov(ROC(C,periods1,%),periods2,S);
{cola:BUY: this means: label column A as "BUY" and then enter the following formula:} Cross(L,(SAR(.02,.2))) {colb:SELL: this means: label colum B as "SELL" and then enter the following formula:} Cross(SAR(.02,.2),H) {enter the following in the filter section:} cola=1 or colb=1 {where the AF=0.02 which you can change. try doing a sys test by replacing the numbers with opt1 & opt2}
"The MetaStock moving average function has an option for displacing the mov both vertically and horizontally. most of the time, I prefer to use a mov channel in place of Bollinger Bands."
"I use moving average, instead of Bollinger Bands, creating three indicators in the following way, and saving them in a template: Mov(C, 28,S) displaced +10% Mov(C, 28,S) displaced - 10% Mov(C, 28,S) 28 days is the basic span of time. Like the 10% +/-, this should be adjusted for each security and for the particular condition you are waiting for (buy/sell). When I see a buying opportunity ahead, I just draw another trio of faster MAs (keeping the slow on the chart) and use them, with other indicators/oscillators, to time the entry. Same process to exit the market."
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)
QUESTION: As you know, MACD is always bottoming or topping before crossing its trigger line. However, the MACD signal comes always a bit late compared to price movement. Is there any way to calculate the MACD first derivative function to identify MACD tops/bottoms, that could be use by the Explorer or the System Tester? -- Augustin Bataille, Belgium ANSWER: One way to do what you want would be using the 'Rate of Change' function. For example: RocPeriods:=1; ROC(MACD(),RocPeriods,$) or for the MACD histogram you would have RocPeriods:=1; ROC(MACD() - Mov(MACD(),9,E),RocPeriods,$) If that is to noisy, you could smooth it a bit with: RocPeriods := 1; MovAvePeriod :=1; ; Mov(3 * ROC(MACD(),RocPeriods,$) , MovAvePeriod,E) {the 3 just 'magnifies' the line on the plot but doesn't affect the calculation} or for the MACD histogram: RocPeriods := 1; MovAvePeriod :=1; ; Mov(3 * ROC(MACD() - Mov(MACD(),9,E),RocPeriods,$) , MovAvePeriod,E) Another way to do what you want would be to look for peaks and troughs using the 'Peak' and 'Trough' functions. I'm working on code to identify divergences using this method. -- Dr. Robert Jackson robert.jackson@utoronto.ca -QUESTION: As you know, MACD is always bottoming or topping before crossing its trigger line. However, the MACD signal comes always a bit late compared to price movement. Is there any way to calculate the MACD first derivative function to identify MACD tops/bottoms, that could be use by the Explorer or the System Tester? -- Augustin Bataille, Belgium ANSWER: One way to do what you want would be using the 'Rate of Change' function. For example: RocPeriods:=1; ROC(MACD(),RocPeriods,$) or for the MACD histogram you would have RocPeriods:=1; ROC(MACD() - Mov(MACD(),9,E),RocPeriods,$) If that is to noisy, you could smooth it a bit with: RocPeriods := 1; MovAvePeriod :=1; ; Mov(3 * ROC(MACD(),RocPeriods,$) , MovAvePeriod,E) {the 3 just 'magnifies' the line on the plot but doesn't affect the calculation} or for the MACD histogram: RocPeriods := 1; MovAvePeriod :=1; ; Mov(3 * ROC(MACD() - Mov(MACD(),9,E),RocPeriods,$) , MovAvePeriod,E) Another way to do what you want would be to look for peaks and troughs using the 'Peak' and 'Trough' functions. I'm working on code to identify divergences using this method. -- Dr. Robert Jackson robert.jackson@utoronto.ca -
>I want an indicator that will project an exponential moving average into >the next period (i.e., draw tomorrow's line). 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. --Steve Karnish The formula below may be close to what you want, but it will not plot on the forward day. It will just plot the point where tomorrow's EMA would be. The equation is based on the MetaStock manual, page 459, concerning exponential moving averages. -- Chuck Wemlinger TC:=Input("Tomorrow's close",0.001,1000,1); MAP:=Input("Moving Average Period",2,144,55); MA1:=Mov(C,MAP,E); EPX:=2/(MAP+1); MA2:=(TC*EPX)+(MA1*(1-EPX)); ValueWhen(1,Cum(1)=LastValue(Cum(1)),MA2) MACD Additions{These MetaStock MACD indicator formulas allow user input for parameters when run} mp1:=Input("Short MA",1,377,13); mp2:=Input("Long MA",1,377,34); Mov(C ,mp1 ,E )- Mov(C ,mp2 ,E ) MACD signal line mp1:=Input("Short MA",1,377,13); mp2:=Input("Long MA",1,377,34); mp3:=Input("Signal MA",1,377,89); Mov( (Mov(C ,mp1 ,E )- Mov(C ,mp2 ,E )),mp3,E) MACD - Signal Line mp1:=Input("Short MA",1,377,13); mp2:=Input("Long MA",1,377,34); mp3:=Input("Signal MA",1,377,89); (Mov(C,mp1,E)-Mov(C,mp2,E))-(Mov((Mov(C,mp1,E)-Mov(C,mp2,E)),mp3,E)) {Thanks to Keith Massey}Gann High Low{name: GANN-HiLo} HLd:=If(CLOSE>Ref(Mov(H,3,S),-1), {then}1, {else}If(CLOSE<Ref(Mov(L,3,S),-1), {then}-1, {else}0)); HLv:=ValueWhen(1,HLd<>0,HLd); HiLo:=If(HLv=-1, {then}Mov(H,3,S), {else}Mov(L,3,S)); HiLo;
from Murray Richards . . .Drag this to the chart and change it to a histogram and plot green AO oscillator Green If( Mov(( H+L)/2, 5, S)- Mov(( H+L)/2, 34, S), >,Ref(Mov( ( H+L)/2, 5, S)- Mov(( H+L)/2, 34, S),-1),( Mov(( H+L)/2, 5, S)- Mov(( H+L)/2, 34, S )),0) Put in the same window and plot it red as a histogram A Oscillator red If( Mov( ( H+L)/2, 5, S)- Mov( ( H+L)/2, 34, S), <,Ref(Mov( ( H+L)/2, 5, S)- Mov( ( H+L)/2, 34, S),-1), Mov( ( H+L)/2, 5, S)- Mov( ( H+L)/2, 34, S),0) Acc Mov(( H+L)/2, 5, S)- Mov(( H+L)/2, 34, S)- Mov(Mov(( H+L)/2, 5, S)- Mov(( H+L)/2, 34, S) , 5, S) Put in its on window as a histogram and plot red AC Red If( Fml( "Acc" )<Ref( Fml( "Acc" ),-1) ,Fml( "Acc" ),0 ) Put in the same window and plot green AC green If( Fml( "Acc" )<Ref( Fml( "Acc" ),-1) ,Fml( "Acc" ),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
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.
Col A: CLOSE Filter: Fml("Consolidation breakout (upside)") = 1 Filter enabled: Yes
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,3)+Mo(25)+CCI(25)
{Multiple Time Frame - Tendency 5/23/99} {This will plot 1 for Bullish -1 for Bearish} dw:=DayOfWeek(); Fw:=If(dw<Ref(dw,-1),1,0); Mt:=If(Fw=1 AND Ref(dw,-1)<>5, {then}Ref(C,-1)- FmlVar("MTF-Fixed Balance Point","DWP"), {else}If(dw=5, {then}C-((HighestSince(1,Fw=1,H)+ LowestSince(1,Fw=1,L)+C)/3), {else}0)); If(Mt>0,1,If(Mt<0,-1,0)); {from Adam Hefner}
NOTE This EXPLORATION uses the results of several INDICATOR FORMULAS. You must create the INDICATORS first before running the exploration. Also, depending on your system you may have some problems importing this into early versions of Metastock 7. Ref(C,-1) Ref(C,-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) 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"),-2) When(colD,>,0) AND When(colE,<=,0)
CLA:=TRIX(3); CLB:=Ref(TRIX(3),-1); CLC:=Mov(TRIX(3),8,TIMESERIES); CLD:=Ref(Mov(TRIX(3),8,TIMESERIES),-1); SHORT:=When(CLA,>,CLC) AND When(CLB,<,CLD) AND When(CLA,<,0)AND When(CLA,>,-2); LONG:=When(CLA,<,CLC) AND When(CLB,>,CLD) AND When(CLA,>,0)AND When(CLA,<,+2); If(LONG>0,+1, If(SHORT>0,-1,PREVIOUS)) Weekly Trix Moving Average Test COLA: TRIX(3) COLB: REF(TRIX(3),-1) COLC: MOV(TRIX(3),8,TIMESERIES) COLD: REF(MOV(TRIX(3),8,TIMESERIES),-1) COLE: C Filter enabled:yes when(cola,>,colc)and when(colb,<,cold)and when(cola,<,0)and when(cola,>,-2) from A. J.
Maas
{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) {from
Stefan Schittko}
{FUNCTIONS-IND-REFERENCE-INDEX: FF=FASTLINE,SS=SLOWLINE,SETBARS=3DAYMOVAVE, ENTRYADD=+1,EXITADD=+1} {FUNCTIONS-VAR-REFERENCE-INDEX: BBUY=(VAR),SSELL(VAR),CBUY(VAR),CSELL(VAR),FF(VAR),SS(VAR), LXSTOP(VAR),SXSTOP(99999),MP(VAR)} {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
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)) from Alton StephensFibboGattoFG1: ((c+ref(c,-1)+ref(c,-2)+ref(c,-3)+ref(c,-5)+ref(c,-8)+ref(c,-13)+ref(c,-21)+ref(c,-34)+ref(c,-55)+ref(c,-89)+ref(c,-144))/c)*-1 {{{adding closing price only on fib days 1,2,3,5,8,13,21,34,55,89 and 144 and then dividing by today's close}}} FG2: mov(((c+ref(c,-1)+ref(c,-2)+ref(c,-3)+ref(c,-5)+ref(c,-8)+ref(c,-13)+ref(c,-21)+ref(c,-34)+ref(c,-55)+ref(c,-89)+ref(c,-144))/c)*-1,34,e) {{{ 34 period mov avg of above indicator}}} Look for crosses of the two indicators for positive or negatives. Now, there are many whipsaws. I don't recommend this as a *system* at all, just as an indicator. It really highlights some big moves but measuring it with the system test is useless. You must use this as ONE of the tools -- not THE tool. Regards, Jerry GattoDynamic Zones{Zamansky&Stendahl's Dynamic Zones for MS6.5 (From the TASC July1997 article). First, for the Lookback Periods plot a 9-day RSI along with StDev adjusted rolling 70-day SMAs; e.g., as can be seen in the article's S&P500-example} PR:=Input("Enter Periods for RSI",1,100,9); PB:=Input("Enter Periods for BUY",1,100,70); PS:=Input("Enter Periods for SELL",1,100,70); UpZone:=Mov(RSI(PR),PS,S)+(1.3185 *Stdev(RSI(PR),PS)); LwZone:=Mov(RSI(PR),PB,S)-(1.3185 *Stdev(RSI(PR),PB)); UpZone; LwZone; Most indicators use a fixed zone for buy and sell signals. Here's a concept based on zones that are responsive to past levels of the indicator. One approach to active investing employs the use of oscillators to exploit tradable market trends. 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. However, these oscillator-driven systems lack the ability to evolve with the market because they use fixed buy and sell zones. Traders typically use one set of buy and sell zones for a bull market and substantially different zones for a bear market. And therein lies the problem. Once traders begin introducing their market opinions into trading equations, by changing the zones, they negate the system's mechanical nature. The objective is to have a system automatically define its own buy and sell zones and thereby profitably trade in any market -- bull or bear. Dynamic zones offer a solution to the problem of fixed buy and sell zones for any oscillator-driven system. The algorithm for the dynamic zones is a series of steps. First, decide the value of the lookback period t. Next, decide the value of the probability Pbuy for buy zone and value of the probability Psell for the sell zone. The area above and below the dynamic zones constitute the upper and lower 10% boundaries. The zones appear to evolve with the market because they use a rolling 70-day period of indicator values in their construction.
{BUY} L>Ref(H,-1) OR Cum(1)=LastValue(Cum(1)) {SELL} H<Ref(L,-1) OR Cum(1)=LastValue(Cum(1)) Gap 2 System{BUY} N1:=5; L>Ref(HHV(H,N1),-1) OR Cum(1)=LastValue(Cum(1)) {SELL} N1:=5; H<Ref(LLV(L,N1),-1) OR Cum(1)=LastValue(Cum(1)) Gap 3 System
{Enter Long} N1:=5; L>Ref(HHV(H,N1),-1) OR Cum(1)=LastValue(Cum(1)) {Exit Long} N2:=3; C<Ref(LLV(L,N2),-1) OR Cum(1)=LastValue(Cum(1)) {Enter Short} N1:=5; H<Ref(LLV(L,N1),-1) OR Cum(1)=LastValue(Cum(1)) {Exit Short} N2:=3; C>Ref(HHV(H,N2),-1) OR Cum(1)=LastValue(Cum(1)) {from Ton Maas}
Mov((H+L)/2,5,S)-Mov((H+L)/2,35,S) 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)"} {from Mike Arnoldi}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;
{from Adam HefnerVonHef@email.msn.com }
Len:=Input("Periods",1,400,89); (Mov((H - L + Abs(H - Ref(C,-1)) + Abs(L - Ref(C,-1)) ),len,E))/2
{ from Bob bjagow@jps.net }Cyclical Systemfrom Ton Maas ms-irb@wxs.nl"Trading Stocks With A Cyclical System" by Jeffrey Owen Katz (TASC-Feb1999). (Translated for MetaStock 6.5 by Ton Maas -The Netherlands - June1999). ---------------------------------------------------------------------------- (The system's original Easy Language formulas+system were derived from theabove mentioned TASC article). My guess is that Equis (Alan McNichol) was not in the possession of them when he wrote the Equis version of the system, back in the Feb99 Trader's Tips section of TASC). ----------------------- MetaStock 6.5 Indicator ----------------------- Name: Cyclical System - J O Katz Formula: {TASC Feb99} thresh:= {omit whipsaw} 4; k:= {roc comparison period} 3; m:= {cycle period} 63; hld:= {maximum period holding position} 10; Value1:= {volatility} Stdev(Mov(C,m,S)-Mov(C,m+k,S),20); Value2:= {roc, relative comparison ratio} Mov(C,m,S)-Mov(C,m+k,S); tv1:= thresh*Value1; EL:={Enter Long} Value2>tv1; CL:={Close Long} Ref(Cross(Value2,tv1),-hld); ES:={Enter Short} Value2<tv1; CS:={Close Short} Ref(Cross(tv1,Value2),-hld); JKcycl:=If((EL>0)=1,+10, If((ES>0)=1,-10,0)); JKcycl --------------------------- MetaStock 6.5 System Tester --------------------------- Name: Jeffrey Owen Katz - Cyclical System Notes: {February 1999 - TASC-article (see also TRADERS' TIPS)} Formulas: {copy-repeat all that is printed below when applying for the right rule} thresh:= {omit whipsaw} 4; k:= {roc comparison period} 3; m:= {cycle period} 63; hld:= {maximum period holding position} 10; Value1:= {volatility} Stdev(Mov(C,m,S)-Mov(C,m+k,S),20); Value2:= {roc, relative comparison ratio} Mov(C,m,S)-Mov(C,m+k,S); tv1:= thresh*Value1; Rules: {Enter Long} Value2>tv1 {Close Long} Ref(Cross(Value2,tv1),-hld) {Enter Short} Value2<tv1 {Close Short} Ref(Cross(tv1,Value2),-hld) {After entering the formulas, click OK. Then click Options. On the Testing page, set the Trade Delay to zero, set Positions to "both", and then set any other desired options (apart from Optimizing, which is not advisable; leave the factory default settings). Click OK to save the changes, and then open a chart and run the system.}
{I was reading in Perry Kaufman's latest book and he described a little oscillator he called "Body Momentum". This simply calculates the momentum of the closes above the opens versus the closes below the opens. The theory is that as prices move up, closing prices will be higher than opening prices and vice-versa for down. If this oscillator is above 70 then the whites (Candle-sticks) dominate and below 30 the blacks are dominant.} {I also added a 3 day moving average to the calculation (for smoothing).} {Here is the code:} Lb:=Input("Look-Back Period?",3,60,14); B:=CLOSE - OPEN; Bup:= Sum(B > 0, Lb); Bdn:= Sum(B < 0, Lb); BM:=(Bup/(Bup+Bdn))*100; Mov(Bm,3,S) {from Adam Hefner}
{The StTO is really nothing unique. 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. I am not sure how the math is calculated for the CMO, but the (basic) math for the StTO is: (Close- Yesterday's Close) / (H-L)} {Here is the MetaStock code I use:} {name: StTO} {Short-term Trend Oscillator} Lb:=Input("Smoothing Period?",1,60,5); Num:=C-Ref(C,-1); Den:=H-L; Mn:=If(Mov(Num,Lb,S)=0,.01,Mov(Num,Lb,S)); Md:=If(Mov(Den,Lb,S)=0,.01,Mov(Den,Lb,S)); (Mn/Md)*100 {Adam Hefner}CCI Spike Trading System
{This system uses the momentum Commodity Channel Index (CCI) indicator to find short-term bottoms in the market. The CCI indicator is extremely volatile and is generally difficult to use when trading the S&P 500 Index. We, however, 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. Specifically if the gap is larger then a certain percentage and CCI indicator crosses above its moving average we buy the market. The system remains in the market for a short period of time, exiting the trade as the indicators cross to the downside. As designed, this system only trades long the market; it can however be altered to short the market. It is best used in choppy bullish markets similar to the 1995 bull market.} {Trading Tactics: This short-term bullish trading system exploits over extended markets. Futures, options, and mutual fund traders should take full advantage of this high probability trading system, either by taking outright positions or avoiding declining markets. The code for this system can be reversed to trade short positions. This system should be used in place of longer-term momentum systems in strong bullish choppy type markets. This system rarely exits at the market intermediate peak, so other exiting signals may be used in place of our indicator crossover technique.} {Enter long:} Ref(CCI(13)/(Mov(CCI(13),3,S)),-1)>1.5 AND Cross(CCI(13),(Mov(CCI(13),3,S))) AND Ref(CCI(13),-1)<-25 {Exit long:} Cross((Mov(CCI(13),3,S)),CCI(13)) AND Ref(CCI(13),-1)>200 {from Craig Monroe}
SMI-Plex:= StochMomentum(2,1,2)+StochMomentum(3,2,1)+StochMomentum(4,2,3)+StochMomentum (5,3,5)+StochMomentum(8,21,13)+StochMomentum(13,25,2) SMI13E-Plex:= Mov(StochMomentum(2,1,2)+StochMomentum(3,2,1)+StochMomentum(4,2,3)+StochMome ntum(5,3,5)+StochMomentum(8,21,13)+StochMomentum(13,25,2),13,E) {from Craig DeHaan}
((Stoch(8,3)*.05)+(Stoch(89,21)*.43)+(Stoch(55,13)*.26)+(Stoch(34,8)*.16)+(S toch(21,5)*.10)) Landis 3 week s m a mov(((Stoch(8,3)*.05)+(Stoch(89,21)*.43)+(Stoch(55,13)*.26)+(Stoch(34,8)*.16 )+(Stoch(21,5)*.10)),15,s) landis multiple time periods formula #1 mov(((Stoch(8,3)*.05)+(Stoch(89,21)*.43)+(Stoch(55,13)*.26)+(Stoch(34,8)*.16 )+(Stoch(21,5)*.10)),15,s) formula #2 mov(((Stoch(8,3)*.05)+(Stoch(89,21)*.43)+(Stoch(55,13)*.26)+(Stoch(34,8)*.16 )+(Stoch(21,5)*.10)),10,s) formula #3 mov(((Stoch(8,3)*.05)+(Stoch(89,21)*.43)+(Stoch(55,13)*.26)+(Stoch(34,8)*.16 )+(Stoch(21,5)*.10)),5,s) formula #4 mov(((Stoch(8,3)*.05)+(Stoch(89,21)*.43)+(Stoch(55,13)*.26)+(Stoch(34,8)*.16 )+(Stoch(21,5)*.10)),2,s) multiple slopes of landis formula #1 slope(mov(((Stoch(8,3)*.05)+(Stoch(89,21)*.43)+(Stoch(55,13)*.26)+(Stoch(34, 8)*.16)+(Stoch(21,5)*.10)),15,s),2) formula #2 slope(mov(((Stoch(8,3)*.05)+(Stoch(89,21)*.43)+(Stoch(55,13)*.26)+(Stoch(34, 8)*.16)+(Stoch(21,5)*.10)),10,s),2) formula #3 slope(mov(((Stoch(8,3)*.05)+(Stoch(89,21)*.43)+(Stoch(55,13)*.26)+(Stoch(34, 8)*.16)+(Stoch(21,5)*.10)),5,s),2)
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. CandleCode Bdy:=Abs(O-C); Lshd:=If(C>=O,O-L,C-L); Ushd:=If(C>=O,H-C,H-O); ThBotB:=BBandBot(Bdy,55,E,0.5); ThTopB:=BBandTop(Bdy,55,E,0.5); ThBotL:=BBandBot(Lshd,55,E,0.5); ThTopL:=BBandTop(Lshd,55,E,0.5); ThBotU:=BBandBot(Ushd,55,E,0.5); ThTopU:=BBandTop(Ushd,55,E,0.5); CCode:=If(C=O,1,0)*If(Ushd>=Lshd,64,48)+If(C=O,0,1)*(If(C>O,1,0)*(If(Bdy<=ThBotB,80,0)+If(Bdy>ThBotB AND Bdy<=ThTopB,96,0)+ If(Bdy>ThTopB,112,0))+ If(C<O,1,0)*(If(Bdy<=ThBotB,32,0)+ If(Bdy>ThBotB AND Bdy<=ThTopB,16,0)))+(If(Lshd=0,3,0)+ If(Lshd<ThBotL AND Lshd>0,2,0)+ If(Lshd>ThBotL AND Lshd<=ThTopL AND Lshd>0,1,0))+(If(Ushd>0 AND Ushd<=ThBotU,4,0)+ If(Ushd>ThbotU AND Ushd<=ThTopU,8,0)+ If(Ushd>ThTopU,12,0)); CCode; CSI{Candle strength index} Periods:=Input("Enter Periods",2,13,2); Mov(Mov(Mov(Fml("Candlecode"),Periods,S),Periods,S),Periods,S) My version of Tushar
Chande's Vidya using the P
variableVidya{P} Periods:=Input("length of MA",5,100,20); K:=Stdev(P,5)/Mov(Stdev(P,5),20,S); A:=(2/(Periods+1)); Vidya:=A*K*(P)+(1-A*K)*Ref(P,-1); Vidya; Tar(SZ)an Long C-(((462*Mov(C,34,E))-(420*Mov(C,13,E))+(490*(Mov(Mov(C,13,E)-Mov(C,34,E),89,E))))/42) Tar(SZ)an Short (C-(((325*Mov(C,26,E))-(297*Mov(C,12,E))+(351*Mov(Mov(C,13,E)-Mov(C,26,E),9,E))))/28)*2 Tom Demark's Range Expansion
IndexTDREI TD1:= H-Ref(H,-2); TD2:= L-Ref(L,-2); TD3:= If((H>=Ref(L,-5) OR H>=Ref(L,-6)) AND (L<=Ref(H,-5) OR L<=Ref(H,-6)),1,0); TD4:= If((Ref(H,-2)>=Ref(C,-7) OR Ref(H,-2)>=Ref(C,-8)) AND (Ref(L,-2)<=Ref(C,-7) OR Ref(L,-2)<=Ref(C,-8)),1,0); TD6:= (TD1) + (TD2); TD5:= If((TD3) + (TD4)>=1, (TD6), 0); TD7:= Abs(TD1) + Abs(TD2); TDREI:=((TD5) + Ref(TD5,-1) + Ref(TD5,-2) + Ref(TD5,-3) + Ref(TD5,-4))/ (TD7) + Ref(TD7,-1) + Ref(TD7,-2) + Ref(TD7,-3) + Ref(TD7,-4)*100; TDREI; From Henry Z
Kaczmarczyk
Trading the Trend (TTT) -- by Andrew Abraham, TASC Magazine 9/1998, 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. (Members of Chuck LeBeau's Traders Club will recognise the "Chandelier Exit".) 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 the highs get higher the stop moves up but it never moves downward. In MS 6.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. Since the closes move higher and lower, the stop also moves up and down (hence the Yo Yo name). Name: Trading the Trend Pds:=21; Mult:=3; TruRan:=Mov(ATR(1),Pds,W)*Mult; HiLimit:=HHV(H,Pds)-TruRan; LoLimit:=LLV(L,Pds)+TruRan; If(C>HiLimit,HiLimit,LoLimit) 1. After closing the Indicator Builder click on the Expert Advisor (the guy in the bowler/derby hat). 2. Click on New, then the Name tab, type in Trading the Trend. 3. Click on the Highlights tab, select the first line so that it is highlighted, click Edit, type in the name Uptrend, select Colour Blue, select Condition, type in C>FmlVar("Trading the Trend","HiLimit"), and click OK, 4. Still on the Highlights tab, select the second line, click Edit, type in the name Downtrend, select Color Red, select Condition, type in C<=FmlVar("Trading the Trend","HiLimit"), click OK, and then click OK again. 5. If you have a chart open that you want to use this on, click Attach, otherwise click Close. In the latter case, when you open a chart and plot the trendline, click on the Expert Advisor, select Trading the Trend, and click on Attach. I've given the Expert steps in detail for any who may not be familiar with its use. To experiment with variations in the lookback periods and the multiplier you can do so in either the Indicator Builder, or right-click the indicator on the chart, select Properties, then the Formula tab, and make the changes (e.g. try a lookback period of 10, and a multiplier of 2.5). As implemented above, the Expert should change accordingly. This shows the trade-offs that have to be made between near and distant stops. This is too rudimentary to be traded as a system - the whipsaws would chop you to pieces - but the exits should help to limit drawdowns. A very similar stoploss is given in Chande & Kroll "The New Technical Trader", pp.167 - 169, "Volatility-Based Trailing Stops". My preference is to plot both the high and the low exit lines in contrasting colours, dispensing with the switch between them, and dispensing with the Expert. If anyone wants help with the code, just say so. Assuming you entered everything exactly in both the Indicator Builder and the Expert Advisor, one question comes to mind. Did you decide to adapt the formula to MS v.6.5 and use an Input function for Pds and Mult? It seems like a logical thing to do, and in fact I coded it that way at first. The problem is that the Expert Advisor always reverts to the default value (the System Tester does the same thing). Thus if you used something like: Pds:=Input("Lookback Periods?",1,1000,20) and then when you applied it you changed the periods to 15, the Expert Advisor will still read 20. I hard-coded the Pds and Mult parameters for that reason. From Harvey Pearce hhp@home.com Trading the Trend 1TTT--TREND TRAILING Indicator -- 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),1,W)*3; If(C>Ref(C,-21) AND C>fml("VOLAInd"), HHV(H,21)-Ref(fml("VOLAInd"),-1), Ref(fml("VOLAInd"),-1)+LLV(L,21)) .or. VOLAInd :=Mov(ATR(21),1,W)*3; If(C>Ref(C,-21) AND C>VOLAInd, HHV(H,21)-Ref(VOLAInd,-1), Ref(VOLAInd,-1)+LLV(L,21)) {CHANGE BAR COLORS: double click on the price plot in the chart, from the Color/Style page click the UP drop-list and choose darkblue for upwards, and red for downward price changes} From Ian
Burgoyne iburgy@one.net.au
A fast method to clean out unwanted stocks from Metastock and also save them for future viewing. On your hard drive, create a series of folders and sub folders like your present Metastock data system. In my case OLD_META_DATA/ALL01/A01,B01,C01 etc to Z01. (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 . Browse to the folder you wish to make deletions from. In the "Copy Securities" window make sure you can read the Last Date column with the Name column showing. If not,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.( This is also a good tip when printing out Metastock reports that do not fit on the width of an A4 page, just reduce the width of a column or eliminate it completely if it is not wanted on the print out.) Hold down the Control key and highlight each Name you wish to delete. I go on the Last Date column to find useless stocks. 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. When finished highlighting let go of control key and press copy. Browse to the new folder you created, tick the "Delete Source Security" box and press OK. Old securities gone out of current data base and saved for future reference. You can do hundreds in a matter of minutes. If you want to ever see the old securities just alter the lead folders names in explorer. From Basil
HollowayBollinger Bands
2I am sure Steve has done something better, but here is a simple (MetaStock) formula allowing you to draw Bollinger Bands as an oscillator: 100*(C-Mov(C,20,S)+2*Stdev(C,20))/(4*Stdev(C,20)) Alberto
TorchioTorino, Italy Bull Fear/ Bear Fear with DX
Systementer long: n :=opt2{Time periods}; BullFear := (HHV(HIGH,n) - LLV(HIGH,n))/2 + LLV(HIGH,n); Cross(CLOSE,bullfear) AND DX(10) > opt1 close long: n :=opt2{Time periods}; BearFear := (HHV(LOW,n) - LLV(LOW,n))/2 + LLV(LOW,n); CLOSE < bearfear {Mike Arnoldi}Bull Fear/ Bear FearThe system is a trend follower that appears to get you in at the early in a trend. If the trend breaks down for any reason, the system seems to take you out with relatively little pain, and there is a relatively high percentage of losing trades (usually around 50%). Therefore, the system seems to perform best on issues that are prone to make prolonged moves. The trick is to find those issues. I do admit that the system is not perfect; for instance, it is my belief that the exit could be improved on winners to preserve more profit. However, I've been unable to develop an alternative exit that improves the system return. I've been trading this system myself for about a year and have had good results. Even in the April-September period when everything seemed to stall and move sideways, I was, at least able to hold my own and maintain my capital until the October break-always started to occur. For awhile, until I got bored with it, I phantom traded this system in the Yahoo Investment Challenge. I typically made about 20% a month using the system in that venue. Buy n :=opt2{Time periods}; BullFear := (HHV(HIGH,n) - LLV(HIGH,n))/2 + LLV(HIGH,n); Cross(CLOSE,bullfear) AND DX(10) > opt1 Sell n :=opt2{Time periods}; BearFear := (HHV(LOW,n) - LLV(LOW,n))/2 + LLV(LOW,n); 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). Once the Optimal time period is determined in this manner, then retest with the determined optimal time period and the DX in increments of 1. 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. Jeff5 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 {from bdog}Stoch RSIAlthough I keep the best of the bunch as a "super secret" for friends, relatives, and clients ... here is a smattering of formulae that might be useful. StoRSI's perform very differently when you plug in various numbers. Experiment and determine which are most suitable for your style and markets. Substitute numbers, apply moving averages, get creative. These are just a few: ((RSI(21)-LLV(RSI(21),8))/((HHV(RSI(21),13))-LLV(RSI(21),13))) ((RSI(21)-LLV(RSI(21),21))/((HHV(RSI(21),21))-LLV(RSI(21),21))) ((RSI(14)-LLV(RSI(14),14))/((HHV(RSI(14),14))-LLV(RSI(14),14))) Mov((RSI(21)-LLV(RSI(21),13))/(HHV(RSI(21),8)-(LLV(RSI(21)+.00001,13))),8,E) *100 Mov((RSI(5)-LLV(RSI(5),5))/(HHV(RSI(5),5)- (LLV(RSI(5),5))),3,E)*100 Mov((RSI(13)-LLV(RSI(13),13))/(HHV(RSI(13),13)- (LLV(RSI(13),13))),3,E)*100 from Steve KarnishCedar Creek Trading 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
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 : ADX(14) > 20 AND ( Mov(C,15,S) > Mov(C,30,S)) AND ( Mov(C,5,S) > Mov(C,30,S)) AND Stoch(5,3) < 30 AND Ref(Stoch(5,3) ,-1) >=30 Under Trends add the Bullish formula : ADX(14) > 20 AND ( Mov(C,15,S) > Mov(C,30,S)) AND ( Mov(C,5,S) > Mov(C,30,S)) and the Bearish formula : ADX(14) > 20 AND ( Mov(C,15,S) < Mov(C,30,S)) AND ( Mov(C,5,S) < Mov(C,30,S)) C Miller, ccm@itga.com.au Chandeleir Exit, version
IIBelow is the MetaStock code I posted for the Chandelier exit back in October, 1999. The trick is to define the entry date/price as the point at which your system triggered the entry, not by using the date functions. A side benefit is that you can also use it to implement a fixed dollar, or money management, stop. The more time I spend with the Chandelier exit, the more I admire its strength as an exit and its simplicity. Because exits tend to be the weakest part of a system, I would urge everyone to spend some time with it. And Chuck LeBeau gets credit for the MetaStock code, not me. I just took his framework and applied it to his exit. {LONG EXIT} LongEntry:= {this your entry system, eg. Cross(CLOSE, Mov(C,20,E))}; MoneyMgmtStop:= {this is your maximum loss, in points}; {DEFINE ENTRY PRICE, WITH EXIT BEING -- ENTRY PRICE AND NO TRADE BEING 0} EntryPrice:= If(PREV <= 0, {Trade entered today?} If(LongEntry, CLOSE, 0), {Trade entered before today. Stopped today?} If(LOW <= PREV - MoneyMgmtStop, -PREV, If(LOW <= HighestSince(1,PREV=0, HIGH) - 3 * ATR(10), -PREV, If(LOW <= HighestSince(1,PREV=0, CLOSE) - 2.5 * ATR(10), -PREV, PREV)))); {EXIT IF ENTRY PRICE < 0 (MEANING EXIT)} EntryPrice < 0 {SHORT EXIT} ShortEntry:= {this your entry system, eg. Cross(Mov(C,20,E), CLOSE)}; MoneyMgmtStop:= {this is your maximum loss, in points}; {DEFINE ENTRY PRICE, WITH EXIT BEING -ENTRY PRICE AND NO TRADE BEING 0} EntryPrice:= If(PREV <= 0, {Trade entered today?} If(ShortEntry, CLOSE, 0), {Trade entered before today. Stopped today?} If(HIGH >= PREV + MoneyMgmtStop, -PREV, If(HIGH >= LowestSince(1,PREV=0, LOW) + 3 * ATR(10), -PREV, If(HIGH >= LowestSince(1,PREV=0, CLOSE) + 2.5 * ATR(10), -PREV, PREV)))); {EXIT IF ENTRY PRICE < 0 (MEANING EXIT)} EntryPrice < 0 from Glen
WallaceMoving Average
CrossoversWhat follows is a simple example using a moving average crossover system for MetaStock, employing 10 and 30 day exponential averages. These are just examples and profitability is dubious. Custom indicator which gives 1 for longs and -1 for shorts-- Indicator Name: Position MASwitch:=If(Mov(C,10,E)>Mov(C,30,E),1,If(Mov(C,10,E)<Mov(C,30,E),-1,0)); If(BarsSince(MASwitch=1) <BarsSince(MASwitch=-1),1,-1) Custom indicator for cumulative open Equity curve without trading costs-- Indicator name: Equity Cum(If(Ref(Fml("Position"),-1)=1,C-Ref(C,-1),Ref(C,-1)-C)) You can make several such equity lines and then just add them by using a yet another custom indicator, e.g., Indicator name: TotalEquity Fml("Equity1")+Fml("Equity2") from Yngvi hardy@consulting.is
MetaStock is a marvellous program for traders, but can appear complicated and intimidating at first. In reality, it's easy and fun, if you take it slowly, step by step. Let's consider a common trader's question: MetaStock's Explorer tool allows you to search all the stocks in the ASX, and within a minute or two (depending on your computer's speed!) generate a list of all stocks meeting this particular criteria. Here's a step by step guide for beginners: 1. Open up your Explorer tool in MetaStock by clicking on the little "binoculars" symbol in the upper right field of your screen, or find it under Tools in the drop-down menu. 2. You will be presented with the Explorer screen showing a list of ready-made Equis Explorations plus various options to view or edit them. More about these later. Look instead at the list of options to the right. 3. Choose the "New" button and click. 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. 4. Note that the Explorer screen has an upper section labelled "Notes" and then, just below, seven columns, with tabs, labelled "A" to "F," plus "Filter." For now we're just going to work with the "Filter" column. Click on its tab and you're ready to write a MetaStock formula in this column. 5. Enter the following without the quotation marks: "Cross( Mov(c,3,s) , Mov(c,10,s) )" but don't worry about the *spaces* between letters and punctuations marks, nor about capitalisation. 6. Here's a quick explanation to ponder, before we go further. 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. MetaStock writes this as "Cross( A , B )" where A and B are other MetaStock formulas, any formulas you like. In this case, we're putting two different moving averages in the place of A and B. MetaStock writes the English language phrase "Moving Average of the past 3 days" as "mov(c,3,s)" and the second moving average is exactly the same, with the numeral 10 substituted for the 3. 7. Your first MetaStock Exploration is now finished. 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. 8. Next, 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. Choose which securities you want to scan. I suggest that you choose them all to start with, 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. You can just choose the "All" list whenever you want to scan stocks. (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.) 9. MetaStock will quickly verify that your stocks are where you say they are, and prompt you for an "OK". Once you do this, you can watch a nifty screen where MetaStock outlines its search for all the stocks that match your search (Filter) criteria. How long this process takes depends once again on the speed of your computer! 10. 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. MetaStock allows you to open each or all of these stocks in full screen pages for further analysis. Patrick McDonald, patrick@mpx.com.au
Perhaps the above is enough for many traders, but a few further
MetaStock nuances can add to the value of the information you've
uncovered. 1. Go back to the main Explorer tool section, highlight your "Moving Average Crossover" Exploration, and hit the "edit" key this time. You can now make alterations to your Exploration. Ignore the upper "Notes" section and click on Column A first. You will see a large white field for entry of formulas and a small field in the lower left, entitled "Col Name." Simply put a "c" in the large formula section and "Close" in the column name section. Repeat these actions for Column B, with "v" and "Volume" respectively. Now when your Exploration presents you with your data, you can easily sort by price (c) or volume (v). 2. Finally, click on the "Filter" tab again to slightly modify your Exploration formula. The way you have it set up initially tells MetaStock to find all stocks which meet the criteria today. You now want it to find all stocks that have met these criteria over the past five days. The answer is the MetaStock Alert function, which is written "Alert( A , Number ) where "A" is any formula you care to choose, and "Number" is the number of days. So now you put your original formula in the place of A. The result is: "Alert( Cross( Mov(C,3,E) , Mov(C,10,E) ) ,5)" without the quotation marks. 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. If you prefer to use Exponential Moving Averages instead of Simple Moving Averages, change "s" to "e" in the formulas. You can also open up the ready made Equis Explorations, investigate how they're written, and change them with the "Edit" command (then saving with a new name). A further step is to investigate the hundreds of formulas available here on this web site and modify them in the same way. This is the quick and easy way to learn how to program with MetaStock. Follow the examples given by all the kind and clever MetaStock users who have gone before you, and tweak, tweak, tweak. Patrick McDonald, patrick@mpx.com.au
This is the MetaStock code for VIDYA 21,5 which applies to the article "Breaking Out Of Price Channels" by Gerald Marisch in the TASC January 1998 edition. Length:=Input("Length",1,200,21); Smooth:=Input("Smoothing",1,200,5); AbsCMO:=(Abs(CMO(C,Length)))/100; SC:=2/(Smooth+1); VIDYA:=If(Cum(1)<=(Length+1),C,(SC*AbsCMO*CLOSE)+(1-(SC*AbsCMO))*PREV); VIDYA from
Ian BurgogyneVidya with P variable, version II My version of Tushar Chande's Vidya, using the P variable Vidya{P} Periods:=Input("length of MA",5,100,20); K:=Stdev(P,5)/Mov(Stdev(P,5),20,S); A:=(2/(Periods+1)); Vidya:=A*K*(P)+(1-A*K)*Ref(P,-1); Vidya; Tar(SZ)an Long C-(((462*Mov(C,34,E))-(420*Mov(C,13,E))+(490*(Mov(Mov(C,13,E)-Mov(C,34,E),89,E))))/42) Tar(SZ)an Short (C-(((325*Mov(C,26,E))-(297*Mov(C,12,E))+(351*Mov(Mov(C,13,E)-Mov(C,26,E),9,E))))/28)*2 from
Barry MarxVidya
ExplanationVidya is a subject that comes up with some regularity. It's actually available in MetaStock as the Variable Moving Average (Mov(C,n,V) but Equis, for their own inscrutable reasons, choose not to identify it by name. If you refer to the MetaStock manual, be aware that there is a typo in the formula (0.078 should read 0.78). Two or three years ago I coded the version given in TAS&C and it overlaid the MetaStock version precisely, except that at the time the MetaStock version was not correctly initialised -- this has since been corrected. Equis acknowledged the typo at the time, but have done nothing about it. As far as the 'circular reference' is concerned, 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, such as the Exponential Moving Average. If no provision is made, then usually the indicator will start with a value of zero, rise rapidly at first, then take some time to stabilise. One answer is to initialise it. For a Vidya of the close, period N, you can initialise with something like "If(Cum(1) < N, C,{else} ...)" with the Vidya formula as the 'else'. Then at day N the indicator uses the (N-1) close for yesterday's data and takes much less time to stabilise. from HHPVidya using P variable, version
IHere is a version of Vidya using a P variable that matches MetaStock's built-in Variable Moving Average. 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). There is a small difference at the start due to different initialisation, after which they are identical. The coding is spelled out for the benefit of anyone studying the book. It can be adapted by adding a variable input for the CMO length (9), or made universal by replacing each C with a P, or the Abs(CMOsc) can be replaced with a different volatility index that ranges between 0 and 1. {Vidya (Chande)} Pds:= Input("Number of Periods?",1,1000,20); Alpha:= 2/(Pds+1); {Chande Momentum Oscillator} {UD = Up day} {DD = Down day} UD:= Sum((C-Ref(C,-1))*(C>Ref(C,-1)),9); DD:= Sum((Ref(C,-1)-C)*(C<Ref(C,-1)),9); CMOsc:= (UD-DD)/(UD+DD); k:= Abs(CMOsc); Vidya:= (Cum(1) < Pds) * C + (Cum(1)>=Pds) * ((Alpha * k * C) + (1-Alpha * k) * PREV); Vidya {from HHP}Channel Exit with Stop
LossAs people have mentioned before, it is difficult to design exits in MetaStock because of the awkwardness of defining your trade entry price. One exit system that requires your trade entry price is the channel exit. For those not familiar with it, the channel exit is quite a straight forward trailing stop. Once you're in a trade (let's say, long), you maintain your stops at the lowest low of the past number of days (optimized, in the code below) until you are taken out of the market. This method attempts to let profits run in the direction of the trend, 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. Below is the code for a channel exit. It also includes a money management stop to limit losses to an acceptable level until the channel exit exceeds it. Work on variations of this basic theme, such as moving the stop up faster where the market makes rapid gains and your lowest low in, say, 10 or 20 days is just too far away to adequately protect profits. Glen Wallace{LONG EXIT} LongEntry:= {this your entry system, eg. Cross(CLOSE, Mov(C,20,E))}; MoneyMgmtStop:= {this is your maximum loss, in points}; {DEFINE ENTRY PRICE, WITH EXIT BEING -ENTRY PRICE AND NO TRADE BEING 0} EntryPrice:= If(PREV <= 0, {Trade entered today?} If(LongEntry, CLOSE, 0), {Trade entered before today. Stopped today?} If(LOW <= Max(PREV - MoneyMgmtStop, Ref(LLV(LOW,opt1),-1)), -PREV, PREV)); {EXIT IF ENTRY PRICE < 0 (MEANING EXIT)} EntryPrice < 0 {SHORT EXIT} ShortEntry:= {this your entry system, eg. Cross(Mov(C,20,E), CLOSE)}; MoneyMgmtStop:= {this is your maximum loss, in points}; {DEFINE ENTRY PRICE, WITH EXIT BEING -ENTRY PRICE AND NO TRADE BEING 0} EntryPrice:= If(PREV <= 0, {Trade entered today?} If(ShortEntry, CLOSE, 0), {Trade entered before today.Stopped today?} If(HIGH >= Min(PREV + MoneyMgmtStop, Ref(HHV(HIGH,opt1),-1)), -PREV, PREV)); {EXIT IF ENTRY PRICE < 0 (MEANING EXIT)} EntryPrice < 0 Higher Volume
ExplorationRequired: today's volume to be greater than the highest high over the past 21 days. MetaStock Explorer filter: V>Ref(HHV(V,21),-1) from
HHPEnter 20 Days after
MOV SignalI am trying to use the MetaStock Explorer to find all stocks with the following: 1. c - mov(c,60,s)<0 2. Above condition should be in place for 20 days/ I use c - Mov(c,60,s)<0 but how do I write the Exploration? from wsbUse (C - Mov(C,60,S))<0 AND Ref((C - Mov(C,60,S))<0),-1) AND ... Ref((C -Mov(C,60,S))<0),-19) where ... stands for all Ref( x,-i) with i between 2 and 18. from YngviUnder the MetaStock Explorer filter, use something like: C>MOV(C,60,S) AND REF((C>MOV(C,60,S)),-1) AND REF((C>MOV(C,60,S)),-2) AND REF((C>MOV(C,60,S)),-3) AND REF((C>MOV(C,60,S)),-4) AND REF((C>MOV(C,60,S)),-5) AND REF((C>MOV(C,60,S)),-6) AND REF((C>MOV(C,60,S)),-7) AND REF((C>MOV(C,60,S)),-8) AND REF((C>MOV(C,60,S)),-9) AND REF((C>MOV(C,60,S)),-10) AND REF((C>MOV(C,60,S)),-11) AND REF((C>MOV(C,60,S)),-12) AND REF((C>MOV(C,60,S)),-13) AND REF((C>MOV(C,60,S)),-14) AND REF((C>MOV(C,60,S)),-15) AND REF((C>MOV(C,60,S)),-16) AND REF((C>MOV(C,60,S)),-17) AND REF((C>MOV(C,60,S)),-18) AND REF((C>MOV(C,60,S)),-19) That should work ... theoretically. The only thing I'm concerned about is the REF format. However, I think it's correct. The Close is always above (or greater than '>') the MOV. The parentheses always match. Because a 60 day MOV is rather slow, you probably could shorten the formula by leaving out all of the even numbered REFerences: C>MOV(C,60,S) AND REF((C>MOV(C,60,S)),-1) AND REF((C>MOV(C,60,S)),-3) AND REF((C>MOV(C,60,S)),-5) AND REF((C>MOV(C,60,S)),-7) AND REF((C>MOV(C,60,S)),-9) AND REF((C>MOV(C,60,S)),-11) AND REF((C>MOV(C,60,S)),-13) AND REF((C>MOV(C,60,S)),-15) AND REF((C>MOV(C,60,S)),-17) AND REF((C>MOV(C,60,S)),-19) from Daniel
MartinezVolume Based
Exploration1. Stocks with volume > 10x the previous day's volume 2. Stocks where the above situation hasn't occurred during the previous 60 days. ColA = if(V > 10*ref(V,-1),1,0) ColB = ref(barssince(V>10*ref(V,-1)),-1) Filter: ColA=1 and ColB>60 from warthog
LSS 5 day Osc X:=HHV(H,5)-Ref(O,-5); Y:=C-LLV(L,5); LSS:=100*(X+Y)/(HHV(H,5)-LLV(L,5))*2; LSS; LLS 5 DAY Osc Diff from 3 day osc X:=HHV(H,5)-Ref(O,-5); Y:=C-LLV(L,5); LSS:=100*(X+Y)/(HHV(H,5)-LLV(L,5))*2; Diff:=LSS-Ref(LSS,-3); Diff; LLS Strength Index(1 day) 100*(Ref(C,-1)-Ref(L,-1))/(Ref(H,-1)-Ref(L,-1)) LLS Pivot Breakout Buy Number X:=(H+L+C)/3; BBN:=2*X-L; BSN:=2*X-H; BBN; BSN; From
Henry
KaczmarczykVolatility % Indicator Create the Volatility% Indicator
from William Brower’s S&C article in MetaStock for Windows.
Volatility% Lookback := Input("Time Periods",1,1000,50); HighVolatility := Input("High Volatility %",.01,100,3); 100 * Sum(100 * ATR(1)/CLOSE > HighVolatility, Lookback)/Lookback From Henry Kaczmarczyk Instantaneous Trendline & Sinewave Indicator as described by John Ehlers Here are a few formula's that I
picked up from amailing from George Angell LSS 5 day Osc X:=HHV(H,5)-Ref(O,-5); Y:=C-LLV(L,5); LSS:=100*(X+Y)/(HHV(H,5)-LLV(L,5))*2; LSS; LLS 5 DAY Osc Diff from 3 day osc X:=HHV(H,5)-Ref(O,-5); Y:=C-LLV(L,5); LSS:=100*(X+Y)/(HHV(H,5)-LLV(L,5))*2; Diff:=LSS-Ref(LSS,-3); Diff; LLS Strength Index(1 day) 100*(Ref(C,-1)-Ref(L,-1))/(Ref(H,-1)-Ref(L,-1)) LLS Pivot Breakout Buy Number X:=(H+L+C)/3; BBN:=2*X-L; BSN:=2*X-H; BBN; BSN; TASC Trader's Tip:
Volatility % Indicator (Dec '97)You can
easily create the Volatility% Indicator from William Brower’s article in
MetaStock for Windows. First choose Indicator Builder from the Tools menu
in MetaStock. Next choose New and enter one of the following
formulas:Formula for MetaStock 6.5 Volatility% Lookback := Input("Time Periods",1,1000,50); HighVolatility := Input("High Volatility %",.01,100,3); 100 * Sum(100 * ATR(1)/CLOSE > HighVolatility, Lookback)/Lookback Instantaneous
Trendline and Sinewave Indicatorby
John Ehlers Here is the MetaStock 6.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”. To implement them the following formulas must be created in MetaStock’s Indicator Builder. Each formula must be created separately and must be named exactly as it appears below. Only the last two formulas are plotted, 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. To download and install the formulas use the following steps Download the MS65FORM.DTA file into a temp folder To Download the file for this formula click MS65FORM.DTA Use the following instructions to Import the MS65FORM.DTA file from the temp file it was downloaded to. 1. Run MetaStock. 2. Choose Indicator Builder from the Tools menu. 3. Click the Organize button to launch the Formula Organizer Wizard. 4. Follow the on-screen instructions. Name: H cycle count 1a value:= Fml("Hilbert cycle period - 1a"); If(Sum(value,6)>=360 AND Sum(value,5)<360 ,6,0) + If(Sum(value,7)>=360 AND Sum(value,6)<360 ,7,0) + If(Sum(value,8)>=360 AND Sum(value,7)<360 ,8,0) + If(Sum(value,9)>=360 AND Sum(value,8)<360 ,9,0) + If(Sum(value,10)>=360 AND Sum(value,9)<360 ,10,0) + If(Sum(value,11)>=360 AND Sum(value,10)<360 ,11,0) + If(Sum(value,12)>=360 AND Sum(value,11)<360 ,12,0) + If(Sum(value,13)>=360 AND Sum(value,12)<360 ,13,0) + If(Sum(value,14)>=360 AND Sum(value,13)<360 ,14,0) + If(Sum(value,15)>=360 AND Sum(value,14)<360 ,15,0) Name: H cycle count 2a value:= Fml("Hilbert cycle period - 1a"); If(Sum(value,16)>=360 AND Sum(value,15)<360 ,16,0) + If(Sum(value,17)>=360 AND Sum(value,16)<360 ,17,0) + If(Sum(value,18)>=360 AND Sum(value,17)<360 ,18,0) + If(Sum(value,19)>=360 AND Sum(value,18)<360 ,19,0) + If(Sum(value,20)>=360 AND Sum(value,19)<360 ,20,0) + If(Sum(value,21)>=360 AND Sum(value,20)<360 ,21,0) + If(Sum(value,22)>=360 AND Sum(value,21)<360 ,22,0) + If(Sum(value,23)>=360 AND Sum(value,22)<360 ,23,0) + If(Sum(value,24)>=360 AND Sum(value,23)<360 ,24,0) + If(Sum(value,25)>=360 AND Sum(value,24)<360 ,25,0) Name: H cycle count 3a value:= Fml("Hilbert cycle period - 1a"); If(Sum(value,26)>=360 AND Sum(value,25)<360 ,26,0) + If(Sum(value,27)>=360 AND Sum(value,26)<360 ,27,0) + If(Sum(value,28)>=360 AND Sum(value,27)<360 ,28,0) + If(Sum(value,29)>=360 AND Sum(value,28)<360 ,29,0) + If(Sum(value,30)>=360 AND Sum(value,29)<360 ,30,0) + If(Sum(value,31)>=360 AND Sum(value,30)<360 ,31,0) + If(Sum(value,32)>=360 AND Sum(value,31)<360 ,32,0) + If(Sum(value,33)>=360 AND Sum(value,32)<360 ,33,0) + If(Sum(value,34)>=360 AND Sum(value,33)<360 ,34,0) + If(Sum(value,35)>=360 AND Sum(value,34)<360 ,35,0) Name: H ip sum 1 pd:=Int(Fml("Hilbert cycle period - final-a")); pr:=(H+L)/2; (Cos(0)*pr)+ (Cos(360*(1/pd))*Ref(pr,-1))+ (Cos(360*(2/pd))*Ref(pr,-2))+ (Cos(360*(3/pd))*Ref(pr,-3))+ (Cos(360*(4/pd))*Ref(pr,-4))+ (Cos(360*(5/pd))*Ref(pr,-5))+ If(pd>6, Cos(360*(6/pd))*Ref(pr,-6), 0)+ If(pd>7, Cos(360*(7/pd))*Ref(pr,-7), 0)+ If(pd>8, Cos(360*(8/pd))*Ref(pr,-8), 0)+ If(pd>9, Cos(360*(9/pd))*Ref(pr,-9), 0)+ If(pd>10, Cos(360*(10/pd))*Ref(pr,-10), 0)+ If(pd>11, Cos(360*(11/pd))*Ref(pr,-11), 0)+ If(pd>12, Cos(360*(12/pd))*Ref(pr,-12), 0)+ If(pd>13, Cos(360*(13/pd))*Ref(pr,-13), 0)+ If(pd>14, Cos(360*(14/pd))*Ref(pr,-14), 0) Name: H ip sum 2 pd:=Int(Fml("Hilbert cycle period - final-a")); pr:=(H+L)/2; If(pd>15, Cos(360*(15/pd))*Ref(pr,-15), 0)+ If(pd>16, Cos(360*(16/pd))*Ref(pr,-16), 0)+ If(pd>17, Cos(360*(17/pd))*Ref(pr,-17), 0)+ If(pd>18, Cos(360*(18/pd))*Ref(pr,-18), 0)+ If(pd>19, Cos(360*(19/pd))*Ref(pr,-19), 0)+ If(pd>20, Cos(360*(20/pd))*Ref(pr,-20), 0)+ If(pd>21, Cos(360*(21/pd))*Ref(pr,-21), 0)+ If(pd>22, Cos(360*(22/pd))*Ref(pr,-22), 0)+ If(pd>23, Cos(360*(23/pd))*Ref(pr,-23), 0)+ If(pd>24, Cos(360*(24/pd))*Ref(pr,-24), 0) Name: H ip sum 3 pd:=Int(Fml("Hilbert cycle period - final-a")); pr:=(H+L)/2; If(pd>25, Cos(360*(25/pd))*Ref(pr,-25), 0)+ If(pd>26, Cos(360*(26/pd))*Ref(pr,-26), 0)+ If(pd>27, Cos(360*(27/pd))*Ref(pr,-27), 0)+ If(pd>28, Cos(360*(28/pd))*Ref(pr,-28), 0)+ If(pd>29, Cos(360*(29/pd))*Ref(pr,-29), 0)+ If(pd>30, Cos(360*(30/pd))*Ref(pr,-30), 0)+ If(pd>31, Cos(360*(31/pd))*Ref(pr,-31), 0)+ If(pd>32, Cos(360*(32/pd))*Ref(pr,-32), 0)+ If(pd>33, Cos(360*(33/pd))*Ref(pr,-33), 0)+ If(pd>34, Cos(360*(34/pd))*Ref(pr,-34), 0) Name: H rp sum 1 pd:=Int(Fml("Hilbert cycle period - final-a")); pr:=(H+L)/2; (Sin(0)*pr)+ (Sin(360*(1/pd))*Ref(pr,-1))+ (Sin(360*(2/pd))*Ref(pr,-2))+ (Sin(360*(3/pd))*Ref(pr,-3))+ (Sin(360*(4/pd))*Ref(pr,-4))+ (Sin(360*(5/pd))*Ref(pr,-5))+ If(pd>6, Sin(360*(6/pd))*Ref(pr,-6), 0)+ If(pd>7, Sin(360*(7/pd))*Ref(pr,-7), 0)+ If(pd>8, Sin(360*(8/pd))*Ref(pr,-8), 0)+ If(pd>9, Sin(360*(9/pd))*Ref(pr,-9), 0)+ If(pd>10, Sin(360*(10/pd))*Ref(pr,-10), 0)+ If(pd>11, Sin(360*(11/pd))*Ref(pr,-11), 0)+ If(pd>12, Sin(360*(12/pd))*Ref(pr,-12), 0)+ If(pd>13, Sin(360*(13/pd))*Ref(pr,-13), 0)+ If(pd>14, Sin(360*(14/pd))*Ref(pr,-14), 0) Name: H rp sum 2 pd:=Int(Fml("Hilbert cycle period - final-a")); pr:=(H+L)/2; If(pd>15, Sin(360*(15/pd))*Ref(pr,-15), 0)+ If(pd>16, Sin(360*(16/pd))*Ref(pr,-16), 0)+ If(pd>17, Sin(360*(17/pd))*Ref(pr,-17), 0)+ If(pd>18, Sin(360*(18/pd))*Ref(pr,-18), 0)+ If(pd>19, Sin(360*(19/pd))*Ref(pr,-19), 0)+ If(pd>20, Sin(360*(20/pd))*Ref(pr,-20), 0)+ If(pd>21, Sin(360*(21/pd))*Ref(pr,-21), 0)+ If(pd>22, Sin(360*(22/pd))*Ref(pr,-22), 0)+ If(pd>23, Sin(360*(23/pd))*Ref(pr,-23), 0)+ If(pd>24, Sin(360*(24/pd))*Ref(pr,-24), 0) Name: H rp sum 3 pd:=Int(Fml("Hilbert cycle period - final-a")); pr:=(H+L)/2; If(pd>25, Sin(360*(25/pd))*Ref(pr,-25), 0)+ If(pd>26, Sin(360*(26/pd))*Ref(pr,-26), 0)+ If(pd>27, Sin(360*(27/pd))*Ref(pr,-27), 0)+ If(pd>28, Sin(360*(28/pd))*Ref(pr,-28), 0)+ If(pd>29, Sin(360*(29/pd))*Ref(pr,-29), 0)+ If(pd>30, Sin(360*(30/pd))*Ref(pr,-30), 0)+ If(pd>31, Sin(360*(31/pd))*Ref(pr,-31), 0)+ If(pd>32, Sin(360*(32/pd))*Ref(pr,-32), 0)+ If(pd>33, Sin(360*(33/pd))*Ref(pr,-33), 0)+ If(pd>34, Sin(360*(34/pd))*Ref(pr,-34), 0) Name: H TL sum 1 value:=Int(Fml("Hilbert cycle period - final-a")); If(value=6, Mov((H+L)/2,8,S),0) + If(value=7, Mov((H+L)/2,9,S),0) + If(value=8, Mov((H+L)/2,10,S),0) + If(value=9, Mov((H+L)/2,11,S),0) + If(value=10, Mov((H+L)/2,12,S),0) + If(value=11, Mov((H+L)/2,13,S),0) + If(value=12, Mov((H+L)/2,14,S),0) + If(value=13, Mov((H+L)/2,15,S),0) + If(value=14, Mov((H+L)/2,16,S),0) + If(value=15, Mov((H+L)/2,17,S),0) Name: H TL sum 2 value:=Int(Fml("Hilbert cycle period - final-a")); If(value=16, Mov((H+L)/2,18,S),0) + If(value=17, Mov((H+L)/2,19,S),0) + If(value=18, Mov((H+L)/2,20,S),0) + If(value=19, Mov((H+L)/2,21,S),0) + If(value=20, Mov((H+L)/2,22,S),0) + If(value=21, Mov((H+L)/2,23,S),0) + If(value=22, Mov((H+L)/2,24,S),0) + If(value=23, Mov((H+L)/2,25,S),0) + If(value=24, Mov((H+L)/2,26,S),0) + If(value=25, Mov((H+L)/2,27,S),0) Name: H TL sum 3 value:=Int(Fml("Hilbert cycle period - final-a")); If(value=26, Mov((H+L)/2,28,S),0) + If(value=27, Mov((H+L)/2,29,S),0) + If(value=28, Mov((H+L)/2,30,S),0) + If(value=29, Mov((H+L)/2,31,S),0) + If(value=30, Mov((H+L)/2,32,S),0) + If(value=31, Mov((H+L)/2,33,S),0) + If(value=32, Mov((H+L)/2,34,S),0) + If(value=33, Mov((H+L)/2,35,S),0) + If(value=34, Mov((H+L)/2,36,S),0) + If(value=35, Mov((H+L)/2,37,S),0) Name: Hilbert cycle period - 1a value1:=((H+L)/2) - Ref(((H+L)/2),-6); value2:= Ref(value1,-3); value3:=0.75*(value1-Ref(value1,-6)) + 0.25*(Ref(value1,-2)-Ref(value1,-4)); inphase:= 0.33 * value2 + (0.67 * PREV); quad:= 0.2 * value3 + ( 0.8 * PREV); p1:=Atan(Abs(quad+Ref(quad,-1)),Abs(inphase+Ref(inphase,-1))); phase:=If(inphase<0 AND quad>0, 180-p1, If(inphase<0 AND quad<0, 180+p1, If(inphase>0 AND quad<0, 360-p1,p1))); dp:=If(Ref(phase,-1)<90 AND phase>270, 360+Ref(phase,-1)-phase,Ref(phase,-1)-phase); dp2:=If(dp < 1, 1, If(dp > 60, 60, dp)); dp2 Name: Hilbert cycle period - final-a c1:= Fml( "H cycle count 1a") + Fml( "H cycle count 2a") + Fml( "H cycle count 3a") ; c2:=If(c1=0,PREV,c1); (0.25*c2) + (0.75*PREV) Name: Instantaneous Trend Line pr:=(H+L)/2; (Fml("H TL sum 1") + Fml("H TL sum 2") + Fml("H TL sum 3")); 0.33*(pr + (0.5*(pr-Ref(pr,-3)))) + (0.67*PREV) Name: Sinewave Indicator pd:=Int(Fml("Hilbert cycle period - final-a")); cp:=Fml("Hilbert cycle period - final-a"); ip:=Fml( "H ip sum 1") + Fml( "H ip sum 2") + Fml( "H ip sum 3"); rp:=Fml( "H rp sum 1") + Fml( "H rp sum 2") + Fml( "H rp sum 3"); dc1:=If(Abs(ip)>0.001, Atan(rp/ip,1), 90*If(rp>=0,1,-1)); dc2:=If(pd<30 AND cp>0,dc1+((6.818/cp - 0.227)*360),dc1); dc3:=If(ip<0, dc2+270, dc2+90); dcp:=If(dc3>315, dc3-360, dc3); Sin(dcp); Sin(dcp+45)
Here's my Metastock 6.2 coded version of the Zero Lag Moving Average,
as described in the April, 2000, issue of Technical Analysis of Stocks and
Commodities. I've also used it to construct a Zero Lag MACD and a Zero Lag
MACD trigger signal.
Zero Lag MACD Trigger
Signal(To be used with the ZeroLag MACD above) EMA1:= Mov(CLOSE,13,E); EMA2:= Mov(EMA1,13,E); Difference:= EMA1 - EMA2; ZeroLagEMA13:= EMA1 + Difference; EMA1:= Mov(CLOSE,21,E); EMA2:= Mov(EMA1,21,E); Difference:= EMA1 - EMA2; ZeroLagEMA21:= EMA1 + Difference; ZeroLagMACD:=ZeroLagEMA13 - ZeroLagEMA21; EMA1:= Mov(ZeroLagMACD,8,E); EMA2:= Mov(EMA1,8,E); Difference:= EMA1 - EMA2; ZeroLagTRIG:= EMA1 + Difference; ZeroLagTRIG RegardsPeter Martin alakazam@bigpond.com
periods:=Input("periods",1,244,89); VariableMA511( mp() , periods) Equis put this function in for me. It uses VHF rather than CMO. Unlike the present version, this is better. RichardRSI Offset RSI(13) - 50 {offset the RSI to +-50} from WarthogMACD
Offset(MACD()*10 +50) {offset the MACD to 50} from Warthog
As the name implies this metastock exploration finds stocks with a recent uptrend. {Col A } CLOSE {Col B} V {Filter} x:=HHV(H,60);
A:Close B:{MA}Ref(C,-1)<Mov(C,10,S) AND Ref(C,-1)<Mov(C,50,S) AND C>Mov(c,10,S) AND C>Mov(C,50,S) C:{Breakout}Ref(C,-1)<=((Ref(H,-1)-Ref(L,-1))*.25)+Ref(L,-1) AND C>=H-(H-L)*.25 D:{Entry}HHV(H,2)+.125 E:{Stop}HHV(H,2)+.125-1 Jeff Cooper 180's SellA:Close B:{MA}Ref(C,-1)>Mov(C,10,S) AND Ref(C,-1)>Mov(C,50,S) AND C<Mov(c,10,S) AND C<Mov(C,50,S) C:{Breakout}Ref(C,-1)>=((Ref(H,-1)-Ref(L,-1))*.25)+Ref(H,-1) AND C<=L+((H-L)*.25) D:{Entry}LLV(L,2)-.125 E:{Stop}LLV(L,2)-.125+1 Jeff Cooper Lizards BuyA:close B:{Signal}O>H-(H-L)*.25 AND C>H-(H-L)*.25 AND L<Ref(LLV(L,10),-1) C:{entry}H+.125 D:{Stop}H+1.125 Filter:O>H-(H-L)*.25 AND C>H-(H-L)*.25 AND L<Ref(LLV(L,10),-1) Jeff Cooper Lizards
SellA:close B:{Signal}O<L+(H-L)*.25 AND C<L+(H-L)*.25 AND H>Ref(HHV(H,10),-1) C:{entry}L-.125 D:{Stop}L-1.125 Filter:O<L+(H-L)*.25 AND C<L+(H-L)*.25 AND H>Ref(HHV(H,10),-1) Jeff Cooper Slingshots BuyA:Close B:{Range breakout}Ref(H,-1)>=Ref(HHV(H,40),-1) AND L<Ref(L,-1)-.125 C:{entry}If(O>Ref(H,-1)+.125,O,0) D:{Stop}If(If(O>Ref(H,-1)+.125,O,0)=O,Ref(O,-1)-2,0) Filter:Ref(H,-1)>=Ref(HHV(H,40),-1) AND L<Ref(L,-1)-.125 Jeff Cooper Slingshots
SellA:Close B:{Range breakout}Ref(L,-1)<=Ref(LLV(L,40),-1) AND H>Ref(H,-1)+.125 C:{entry}If(O<Ref(L,-1)-.125,O,0) D:{Stop}If(If(O<Ref(L,-1)-.125,O,0),Ref(O,-1)+2,0) Filter:Ref(L,-1)<=Ref(LLV(L,40),-1) AND H>Ref(H,-1)+.125 Jeff Cooper Whoops
SellA:close B:C<Mov(C,10,S) AND C<Mov(C,50,S) AND O>Ref(C,-1)+.25 C:{Entry}Ref(C,-1)-.125 D:{Stop}Ref(C,-1)-.125+1 Filter:C<Mov(C,10,S) AND C<Mov(C,50,S) AND O>Ref(C,-1)+.25 A:Close B:ADX(14){The higher the better} C: PDI(14)>MDI(14) D:If(L<Ref(L,-1) and Ref(L,-1)<Ref(L,-2) and Ref(L,-2)<Ref(L,-3),1,0) E:{Entry}HHV(H,3)+.125 F:{stop}LLV(L,3) Filter:ColB>30 and ColC and ColD=1 1234's
SellA: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 Boomers Buy and
SellA:Close B:{Signal Buy=-1,Sell=1} If(ADX(14)>30 and PDI(14)>MDI(14),-1,If(ADX(14)>30 and PDI(14)<MDI(14),1,0)) C:{setup}Ref(H,-2)>=Ref(H,-1) and Ref(H,-1)>=H and Ref(L,-2)<=Ref(L,-1) and Ref(L,-1)<=L D:{Entry}If(ADX(14)>30 and PDI(14)>MDI(14) and Ref(H,-2)>=Ref(H,-1) and Ref(H,-1)>=H and Ref(L,-2)<=Ref(L,-1) and Ref(L,-1)<=L,HHV(H,3)+.125,IF(ADX(14)>30 and PDI(14)<MDI(14) and Ref(H,-2)>=Ref(H,-1) and Ref(H,-1)>=H and Ref(L,-2)<=Ref(L,-1) and Ref(L,-1)<=L,LLV(L,3)-.125,0)) E:{Stop}If(ADX(14)>30 and PDI(14)>MDI(14) and Ref(H,-2)>=Ref(H,-1) and Ref(H,-1)>=H and Ref(L,-2)<=Ref(L,-1) and Ref(L,-1)<=L,LLV(L,3)-.125,IF(ADX(14)>30 and PDI(14)<MDI(14) and Ref(H,-2)>=Ref(H,-1) and Ref(H,-1)>=H and Ref(L,-2)<=Ref(L,-1) and Ref(L,-1)<=L,HHV(H,3)+.125,0)) F:ADX(14){Higher the better} Filter:ColB and ColC Expansion Pivots
BuyA:=Close B:{Breakout}(H-L)>ATR(9) C:{Signal}Ref(C,-2)<=Mov(C,50,S) and Ref(C,-1)>Mov(C,50,S) OR Ref(C,-1)<=Mov(C,50,S) and C>Mov(C,50,S) D:{entry}HHV(H,2)+.125 E:{Stop}If(Ref(C,-2)<=Mov(C,50,S) and Ref(C,-1)>Mov(C,50,S),Ref(C,-1)-1,If(Ref(C,-1)<=Mov(C,50,S) and C>Mov(C,50,S),C-1,0)) Filter:ColB and ColC Expansion Pivots
SellA:=Close B:{Breakout}(H-L)>ATR(9) C:{Signal}Ref(C,-2)>=Mov(C,50,S) and Ref(C,-1)<Mov(C,50,S) OR Ref(C,-1)>=Mov(C,50,S) and C<Mov(C,50,S) D:{entry}LLV(L,2)-.125 E:{Stop}If(Ref(C,-2)>=Mov(C,50,S) and Ref(C,-1)<Mov(C,50,S),Ref(C,-1)-1,If(Ref(C,-1)>=Mov(C,50,S) and C<Mov(C,50,S),C-1,0)) Filter:ColB and ColC Gilligan's Island
BuyA:Close B:GapDown()<=Ref(LLV(L,40),-1) and C>=O and C>=((H-L)*.50)+L C:{entry}H+.125 D:{stop}H+.125-1 Filter: GapDown()<=Ref(LLV(L,40),-1) and C>=O and C>=((H-L)*.50)+L Gilligan's Island
SellA:Close B:GapUp()>=Ref(HHV(H,40),-1) and C<=O and C<=((H-L)*.50)+L C:{entry}L-.125 D:{stop}L-.125+1 Filter: GapUp()>=Ref(HHV(H,40),-1) and C<=O and C<=((H-L)*.50)+L
ROC(Mov(C,13,E),21,%) Moving Average Violated By
%200 dma violated by 100% enter short c>=(mov(c,200,s)*2) 200 dma violated by 50% enter short c>=(mov(c,200,s)*1.5) 200 dma w/i 1 pt enter long c>=mov(c,200,s)+1 exit long ((if ((c<=prev(llv(c,15)-.5, 1)),1,0)) + (if ((c<=.75*hhv(c,10)),1,0)))>=1 enter short c<=mov(c,200,s)-1 exit short c>=hhv(llv(c,15), 15)+.5 200 dma w/i 3pts enter short c<=mov(c,200,s)-3 exit short c>=hhv(llv(c,15), 15)+.5 21 d reversal w di enter long c>prev(hhv(c,21),1) and adx(1)>adx(14) and (pdi(9)>mdi(14)) exit long c<prev(llv(c,21),1) and (pdi(14)<mdi(9)) enter short c<prev(llv(c,21),1) and adx(1)>adx(14) and (pdi(9)<mdi(14)) exit short c>prev(hhv(c,21),1) and (pdi(9)>mdi(14)) Stochastic MA Systementer long mov(stoch(55,21),5,w)>ref(mov(stoch(55,21),5,w),-1) and mov(stoch(55,21),5,w)<75 and mov(stoch(55,21),5,w)>20 exit long (mov(stoch(55,21),5,w)<75 and ref(mov(stoch(55,21),5,w),-1)>75) enter short (mov(stoch(55,21),5,w)<70 and ref(mov(stoch(55,21),5,w),-1)>70) and mov(stoch(55,21),5,w)<ref(mov(stoch(55,21),5,w),-1) exit short mov(stoch(55,21),5,w)>ref(mov(stoch(55,21),5,w),-1) and mov(stoch(55,21),5,w)<75 and mov(stoch(55,21),5,w)>20 Bollinger Bands Formula 7
Dayenter long high>(mov(Close,20,S)-std(Close,20,2)) and ref(low,-7)<ref((mov(Close,20,S)-std(Close,20,2)),-7) exit long close<(mov(Close,20,S)+std(Close,20,2)) and ref(close,-7)>ref((mov(Close,20,S)+std(Close,20,2)),-7) and Mov((RSI(14)- LLV(RSI(14),14)) /(HHV(RSI(14),14)-(LLV(RSI(14),14))),14,E)*100<70 and ref((Mov((RSI(14)- LLV(RSI(14),14)) /(HHV(RSI(14),14)-(LLV(RSI(14),14))),14,E)*100),-3)>70 and (mov(Close,20,S)+std(Close,20,2))>(mov(c,89,s)+(.062*(mov(c,89,s)))) EMA Cross Systemavoid using when the market has no clear direction -- enter long mov(c,5,e)>mov(c,21,e) and ref(mov(c,5,e),-1)<=ref(mov(c,21,e),-1) exit long mov(c,5,e)<mov(c,21,e) and ref(mov(c,5,e),-1)>=ref(mov(c,21,e),-1) Boomers Trading Signals: Boomers buysig enter long ((adx(14)+adx(27))/2)>30 and pdi(27)>mdi(27) exit long c<=prev(llv(c,15)-.5, 1) or c<=.75*hhv(c,10) Boomers watchsig**enter long prev(h,1)<=prev(h,2) and prev(l,1)>=prev(l,2) and BullHarami() exit long c<=prev(llv(c,15)-.5, 1) or c<=.75*hhv(c,10) Boomers watchsig 2**(Ref not prev) enter long ref(h,-1)<=ref(h,-2) and ref(l,-1)>=ref(l,-2) and BullHarami() exit long c<=ref(llv(c,15)-.5,-1) or c<=.75*hhv(c,10)
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); Resistance and SupportLookBack := 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; Guppy's MMA
Short{short-term} Mov(C,3,E);Mov(C,5,E);Mov(C,7,E); Mov(C,10,E);Mov(C,12,E);Mov(C,15,E); Guppy's MMA
Long{long-term} Mov(C,30,E);Mov(C,35,E);Mov(C,40,E); Mov(C,45,E);Mov(C,50,E);Mov(C,60,E) From
superform@hotmail.comAverage Dollar
Price Volatility Exploration-DeelThis 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-DeelThis indicator plots the value on the chart display. It is useful only as a quick method of attaching the volatility value to the stock. Apply this with caution and make sure that the new scale display is also included. (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 7 Day Rate Of
Change Ported From Super
Charts((C-Ref(CLOSE,-7))/Ref(CLOSE,-7)*100)
This exploration is designed to find those stocks where the close is above the median price over the past five days. It matches the steps in Dels bvook The Strategic Electronic Day Trader. col a = CLOSE - MP() col b = (Ref(CLOSE,-1))-(Ref( MP() ,-1)) Col c = (Ref(CLOSE,-2))-(Ref( MP() ,-2)) col d = (Ref(CLOSE,-3))-(Ref( MP() ,-3)) col e = (Ref(CLOSE,-4))-(Ref( MP() ,-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. By removing the filter all stocks will be shown. Ranking the first colum will then allow you to estaboish the overall score for each stock. MACD Custom The Input() Function(MSK-man. p.271-273) cannot be used directly in the Explorer (MSK-man. p.351). It is reserved to be used in a custom indicator. However, the custom indicator's default value can be used in an exploration. Since you have created a {faulty} custom indicator, than just re-code it. By referencing the Input() Function using the fml() CALL Function (MSK-man.p.226-227 and 208-209 and 212), you can still use its {by you at design time} assigned Default value. Custom Indicator : Name: MACDcustom Formula: MAprd:=Input( "Periods", 5 {Minimum}, 30 {Maximum}, 14 {Default} ); YourTrig:=Mov( MACD(), MAprd, E ); MACD(); 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, and "Open" each of them one by one, to paste them into your column TABs (MSK-man. p.347-348) . Exploration: Name: MACD crosses my Trigger Columns: Cola: Name: Close Formula: C Colb: Name: MACD Formula: FML( "MACDcustom , MACD" ) Colc: Name: MACDTrigger Formula: FML( "MACDcustom , YourTrig" ) Filter: Formula: Colb > Colc {or FML( "MACDcustom , MACD" ) > FML( "MACDcustom , YourTrig" ) } Ton
MaasSubmitted by warrah@comcen.com.au 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. from Philip
pschmi02@sprynet.com
Submitted by warrah@comcen.com.au Brown's
IndicatorName: RSI derivative index (EL) - C. Brown {EasyLanguage} Formula: Base:=Mov(RSI(14),6,S); ATRcustom:=HHV( ValueWhen(1,RSI(14)>Ref(RSI(14),-1),ATR(1))OR ValueWhen(2,RSI(14)>Ref(RSI(14),-1),ATR(1))OR ValueWhen(3,RSI(14)>Ref(RSI(14),-1),ATR(1)),14); Part1:= {up coefficient is a factor 2.3 and added} (2.3*(Mov(ATRcustom, 15,S))); Part2:= {down coefficient is factor 2.1 and subtracted} (2.1*(Mov(ATRcustom, 15,S))); {Part3=if RSI closes up or equal to, than part1, else, if RSI closes down, part2} If( Base>=Ref(Base,-1), {RSI up=TRUE, then} Base+Part1,{else} {RSI up=FALSE,then} Base-Part2) Submitted by warrah@comcen.com.au Finding Trendiness A remark by Chuck LeBeau about trading with the trend has stayed with me. He speaks of the actual strength of a trend as opposed to merely its direction. Entry strategies (pullbacks in his view) should be tailored to both direction and strength, he says. This makes perfect sense to me. Here are some initial thoughts. Perhaps you can help me to arrive at some kind of "hierarchy" of trendiness, or call it a classification, or a taxonomy, consisting of both direction and strength. For convenience, I'll describe only long trades. I. General direction, long term: EMA(21) > EMA(55) II. Trend picks up steam: EMA(13) > EMA(21) > EMA(55) III. Strong: EMA(8) >EMA(13) > EMA(21) > EMA(55) IV. Somewhere between II. and III. the ADX(13/14) usually starts rising. From what I've seen, a rising ADX at any level generally means business: ADX(13) > Ref(ADX(13),-1) V. 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 . . . very little direction (but don't fall asleep at the wheel): ADX(13) < say, 12-15 and has been bumbling along down there for a while (hard to quantify for me to date) from Philip
pschmi02@sprynet.comSubmitted by warrah@comcen.com.au Weakness In A Strong Trend In an up trend, three or four successive lower CLOSES and the EMA(21) is rising. SimpleX LONG: C <= Ref(C,-1) AND Ref(C, -1) <= Ref(C, -2) AND Ref(C, -2) <= Ref(C, -3) AND Mov(C, 21, E) > Ref(Mov(C, 21, E), -1) OR C <= Ref(C,-1) AND Ref(C, -1) <= Ref(C, -2) AND Ref(C, -2) <= Ref(C, -3) AND Ref(C, -3) <= Ref(C, -4) AND Mov(C, 21, E) > Ref(Mov(C, 21, E), -1) SimpleX SHORT: C >= Ref(C,-1) AND Ref(C, -1) >= Ref(C, -2) AND Ref(C, -2) >= Ref(C, -3) AND Mov(C, 21, E) < Ref(Mov(C, 21, E), -1) OR C >= Ref(C,-1) AND Ref(C, -1) >= Ref(C, -2) AND Ref(C, -2) >= Ref(C, -3) AND Ref(C, -3) >= Ref(C, -4) AND Mov(C, 21, E) < Ref(Mov(C, 21, E), -1) Rig this up with an OB/OS oscillator and you've got an entry that is, well, at least worth considering. Philip pschmi02@sprynet.comSubmitted by warrah@comcen.com.au 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) Submitted by warrah@comcen.com.au
{It returns the number of periods the close is moving in the same
direction. perc:=Input("Percent",2,100,10); by Spyros Raftopoulos
This is a MetaStock formula that I have had good success with. Copy and paste this into the Explorer filter. C>Ref(C,-1) AND C>Ref(C,-2) AND C>Ref(C,-3) AND C>Ref(C,-4) AND Ref(C,-1)<=Ref(C,-2) AND Ref(C,-1)<=Ref(C,-3) AND Ref(C,-1)<=Ref(C,-4) AND Ref(C,-2)<=Ref(C,-3) AND Ref(C,-2)<=Ref(C,-4) AND 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. Gann
Hi-LocolA BUY BarsSince(C< Fml("GANN-HiLo")) colB SELL BarsSince(C> Fml("GANN-HiLo")) filter colA=1 OR colB=1 from Mike
Arnoldi Bollinger Bank Hook Up and Hook
DownI use the following indicators to show the price reversal of Bollinger Band penetration: Name: Upper BB Hookdown Formula: UpperBB:= Mov(C,20,S) +(2*(Std(C,20))); C < UpperBB AND Ref(C,-1) > Ref(UpperBB,-1); Name: Lower BB Hookup Formula: LowerBB:= Mov(C,20,S) -(2*(Std(C,20))); C > LowerBB AND Ref(C,-1) < Ref(LowerBB,-1); from Jim
Barone
ECO - R
KrauzThe 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, and the difference between the high(H) and low(L) prices for each bar" originally created by William Blau. FWI my interpretation is: {ECO[Ergodic Candlestick Oscillator]} (MOV(MOV(C-O,5,E))26,E)/MOV(MOV(H-L,5,E))26,E))*100 J.
SeedChandelier Exit
2
Here is the Fast Chandelier Exit in full as supplied to me. It is part
of an exit strategy which you can adjust to your own trading style and
comfort levels. from Ian Burgoyne HHVDays:=Input("Days Since Trade Opened",1,300,1);
FORMULAS FROM SITE VISITORS
(If( HIGH > Ref( HIGH , -1 ), 1 ,0 ) AND If( HIGH > Ref( HIGH , -2 ),1 ,0 ) AND If( HIGH > Ref( HIGH , +1 ), 1 ,0 ) AND If(HIGH>Ref( HIGH , +2 ), 1 ,0 ))
(If( LOW < Ref( LOW , -1 ), 1 ,0 ) AND If( LOW < Ref( LOW , -2 ), 1 ,0) AND If( LOW < Ref( LOW , +1 ), 1 ,0 )AND If( LOW < Ref( LOW , +2 ), 1 ,0 )) Put the formulas in a new Expert with up arrows and down arrows in graphics with appropriate colors. Hope this will be of help.
That formula was for the MetaStock Expert. Create a new Expert and put the same in the symbols section and apply it. It will highlight the points where these occur. If you want to plot the same as lines, check this out. Use the Indicator Builder to create these two indicators.
ValueWhen(1,(( HIGH > Ref( HIGH , -1 ) ) AND ( HIGH > Ref( HIGH , -2 ) ) AND ( HIGH > Ref( HIGH , +1 ) ) AND ( HIGH > Ref( HIGH , +2 ))),C)
ValueWhen(1,((( LOW < Ref( LOW , -1 )) AND ( LOW < Ref( LOW , -2 )) AND ( LOW < Ref( LOW , +1 ))AND ( LOW < Ref( LOW , +2 ) ))),C) I use the fractals (we call them minor tops and minor bottoms) to add to my existing positions. Hope this helps
If( HIGH > Ref( HIGH, -1 ), 1 ,0 ) AND If( HIGH > Ref( HIGH, -2 ), 1 ,0 ) AND If( HIGH > Ref( HIGH, +1 ), 1 ,0 ) AND If( HIGH > Ref( HIGH, +2 ), 1 ,0 )
If( LOW < Ref( LOW , -1 ), 1 ,0 ) AND If( LOW < Ref( LOW , -2 ), 1 ,0) AND If( LOW < Ref( LOW , +1 ), 1 ,0 ) AND If( LOW < Ref( LOW , +2 ), 1 ,0 ) Put the formulas in a new Expert, in the Trends section, with up arrows and down arrows in graphics with appropriate colours. Hope this will be of help.
Here's a system that works. Its no Holy Grail but with a little common sense you'd be hard pressed losing money with it. Steve posted it a while back (his "lumber.gif") so I can hardly take credit for the idea, but I think the system is so profitable that I felt I really ought to champion it a bit. I would characterise it as being a fairly aggressive short term system, so it's not everyone's cup of tea. I have added a stochastic crossover to its exit which gets it out just that little bit earlier sometimes. I find that to get the best signals there is no point in optimising over too long a time frame (yea, I know I'm going to get flamed -- heretic, unbeliever) so I pick a period back where the security doesn't change character too much and re-optimise if something dramatic happens. Another trick is to initially optimise coarsely over a very wide range and then select intermediate results that appear to be heading for the sort of trades that you'd like to see (not always the most profitable). Often there are many profit peaks and if you initially optimise over too small a range you won't see the best version for that particular security. I also attach the optimised formula as a MetaStock Expert to securities that I follow. The Buy signal is uncanny and the first few times you really wonder about your sanity. {Enter Long} Cross(opt2,ForecastOsc(O,opt1)) {Close Long} Cross(ForecastOsc(O,opt1),opt3) OR Cross(Mov(Stoch(opt4,3),opt5,S),Stoch(opt4,3))
For ADX > 25 and rising, you could do something like this in MS Explorer: Column A: ADX(21) Filter: ADX(21)>25 AND ADX(21)>Ref(ADX(21),-1) AND Ref(ADX(21),-1)>Ref(ADX(21),-2) AND Ref(ADX(21),-2)>Ref(ADX(21),-3) For ADX starting to move higher, you could try: Column A: ADX(21) Column B: Ref(ADX(21),-1) Filter: ADX(21)>ADXR(21) AND Ref(ADX(21),-1)<=Ref(ADXR(21),-1
Inside(), outside(), rally(), reaction(), reactionwithvol() and rallywithvol() are all FUNCTIONS and described as such in the manual. These are not indicators, but can be used in writing an indicator. If you want to see rallywithvol() as an indicator, hit your formula button and call your new indicator rallywithvol. Then in the formula window, click on FUNCTIONS, highlight rallywithvol() and paste it in. Voila, you now have an indicator that reflects the rallywithvol() function. If you want to create a short term swing type trading system with these functions getting insights to their use which can be had by reading the description of these functions in the manual, create an expert and type the following:
This is for the long side. Looking for a fast point or two in the next few trading sessions. Entry is just above the signal bar. Use a tight stop. If entry point was not hit, there is no trade. This is for "Hit and Run" style trading. from
I can help with explanations of the Reaction() function and other associated functions in the formula language. The functionality exist in the formula language ONLY and are not implemented as standard, built-in indicators. In order to access their capabilities, you must write a custom indicator or other formula-based calculation that calls the appropriate function. These functions are used mainly for a type of pattern similar to the functions used for candlestick patterns. The candlestick pattern functionality can also only be accessed through formula functions and not as standard, built-in indicators. Specifically, the following functions are related to the Reaction() function:
The user's manual attempts to describe the functionality of these functions, but we recently identified the fact that the user's manual did not correctly define how they work. A correct explanation for these functions follows:
{Place in MetaStock Explorer filter section. Recommended to
predict sustained swings, contributed by from (ADX(14) < LLV(PDI(14),25) ) AND (ADX(14) < LLV(MDI(14), 25))
{CCT LinRegOsc:} (LinearReg(C,13)/Ref(LinearReg(C,13),-13))-1 {from
I want to signal when a Doji occurs following a four-day consecutive increasing CLOSE. I would like this to be an ALERT, signalling if this completed pattern has occurred within the last five days. from
Doji() AND Alert((Ref(C,-1) > Ref(C,-2) > Ref(C,-3) > Ref(C,-4)),5) from
I want to do a MetaStock Exploration with the Directional Movement Index. I want to scan for the crossing of the two, i.e., yesterday +DX is less than -DX; today +DX is greater than -DX; and visa versa. from
Although the names in the MetaStock quicklist drop down box are + or - DI, you will need to use PDI or MDI in your formulas. That seems to be causing your problem. PDI=Plus Directional Movement Index and MDI=Minus Directional Movement Index. Instead, use the following: DIRECT:=PDI(14)>MDI(14); DIRECT AND Ref(DIRECT,-1)=0; from
I want to do an exploration with Directional Movement Index. I want to scan for the crossing of the two, i.e., yesterday +DX is less than -DX, today +DX is greater than -DX and visa versa. from
+DX(14) > -DX(14) AND Ref(+DX(14),-1) < Ref(-DX(14),-1) from
Simple Interpretation: Excel Confidence % should oscillate between 0 and 100, usually at the extreme ends of the scale. A value of 0 indicates no confidence in the market going up, whilst 100 indicates perfect confidence in the market going up. Although this obviously isn't the holy grail of indicators, it does offer some insight into what the market is thinking and how one can measure investor sentiment. 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 - try 7 & 15) and trade the crossovers, as with stochastics. You can also just trade the values ie 90 or higher, buy, 10 or lower, sell.
(Sum( Mov(C * (2.5/ Sqrt(50 * V)),10,S)- LLV(Mov(C * (2.5/ Sqrt(50 * V)),10,S),5), 3 ) / Sum( HHV(Mov(C * (2.5/ Sqrt(50 * V)),10,S),5) - LLV(Mov(C * (2.5/ Sqrt(50 * V)),10,S),5), 3) ) * 100
Simple Interpretation: Front Weighted 36 Day Moving Average is similar to all other moving averages. The interpretation is just as with all others, the trend is up when prices are above the moving average and the trend is down when prices are below the moving averages. This particular variation attempts to weight the data at the front more than that at the back, with a sliding scale for each trading days value.
Fml( "1FrontWeighted36BarMA1" ) + Fml( "2FrontWeighted36BarMA2" ) + Fml( "3FrontWeighted36BarMA3" ) Where Fml( "1FrontWeighted36BarMA1" ) = 0.01 * Ref(P,-34) + 0.01 * Ref(P,-33) + 0.01 * Ref(P,-32) + 0.01 * Ref(P,-31) + 0.01 * Ref(P,-30) + 0.01 * Ref(P,-29) + 0.01 * Ref(P,-28) + 0.01 * Ref(P,-27) + 0.01 * Ref(P,-26) + 0.02 * Ref(P,-25) + 0.02 * Ref(P,-24) + 0.02 * Ref(P,-23) + 0.02 * Ref(P,-22) + 0.02 * Ref(P,-21) + 0.02 * Ref(P,-20) + 0.02 * Ref(P,-19) + 0.02 * Ref(P,-18) Where Fml( "2FrontWeighted36BarMA2" ) = 0.03 * Ref(P,-17) + 0.031 * Ref(P,-16) + 0.031 * Ref(P,-15) + 0.031 * Ref(P,-14) + 0.031 * Ref(P,-13) + 0.031 * Ref(P,-12) + 0.031 * Ref(P,-11) + 0.031 * Ref(P,-10) + 0.031 * Ref(P,-9) + 0.031 * Ref(P,-8) + 0.006 * Ref(P,-7) + 0.006 * Ref(P,-6) + 0.07 * Ref(P,-5) + 0.07 * Ref(P,-4) + 0.07 * Ref(P,-3) + 0.07 * Ref(P,-2) Where Fml( "3FrontWeighted36BarMA3" ) = 0.07 * Ref(P,-1) + 0.079 * P
Among the single-handful of tech analysis indicators I've come to value in seeking out potentially profitable trades is the good old swing chart. This is not present in the standard MetaStock 6.5 armoury (at least my edition of it)but Equis derived the following formula to me some time ago for the daily swing - If( High > Ref(High,-1) AND Low > Ref(Low,-1), High, If( High < Ref(High,-1) AND Low < Ref(Low,-1), Low, PREV)) Simple really! It certainly doesn't show up as a nice rectangular pattern, but you get used to reading it just as fluently for just as correct interpretation. This formula is easily adapted for any other time period by using Highest High Value and such-like functions instead of the Ref function. Though with a little more tooling, it is also readily adaptable to price swing charting rather than time swings.
Here is how I do it (in the MetaStock Explorer filter): y1:=2000; m1:=7; dt:=25; test:=If(Year()<>y1,1,If(Month()<>m1,1,If(DayOfMonth()<>dt,1,0))); Test=1 Since the Explorer does not allow the Input Function, you will need to enter the Year, Month, and Day as the variables y1,m1,and dt, respectively. from
Q:=Input("Periods",1,1000,14); Z:=Wilders(If(ROC(MACD(),1,$)>0,ROC(MACD(),1,$),0),LastValue(Q)); Y:=Wilders(If(ROC(MACD(),1,$)<0,Abs(ROC(MACD(),1,$)),0),LastValue(Q)); RS:=Z/Y; 100-(100/(1+RS)) from
Here's how to use MetaStock Expert function with the tab for commentary. For example, I wrote this commentary that I can attach to any stock, and it will give me the next day's projected high & low. PRICES: TODAY'S CLOSE WriteVal(CLOSE,2.3) TOMMOROW's PROJECTED HIGH WriteIf(C<O, "WRITEVAL(-L+ (H+2*L+C)/2,25.2)") WriteIf(C>O, "WRITEVAL(-L+ (2*H+L+C)/2,25.2)") WriteIf(C=O, "WRITEVAL(-L+ (H+L+2*C)/2,25.2)") PROJECTED LOW WriteIf(C<O, "WRITEVAL(-H+ (H+2*L+C)/2,25.2)") WriteIf(C>O, "WRITEVAL(-H+ (2*H+L+C)/2,25.2)") WriteIf(C=O, "WRITEVAL(-H+ (H+L+2*C)/2,25.2)") BOLLINGER BANDS CLOSING PRICE:WRITEVAL(C,2.3) BOLLINGERBAND TOP: WRITEVAL( BBandTop(C,21,E,2),13.3) 21 DAY MOVING AVERAGE: WRITEVAL(MOV(C,21,E),13.3) BOLLINGERBAND BOTTOM: WRITEVAL( BBandBOT(C,21,E,2),13.3) FIRST RESISTANCE: WRITEVAL(-L+(2* (H+L+C)/3),1.2) SECOND RESISTANCE: WRITEVAL(((H+L+C)/3) +((-L+(2* (H+L+C)/3))-(-H+(2* (H+L+C)/3))),1.2) FIRST SUPPORT: WRITEVAL(-H+(2*(H+L+C)/3),1.2) SECOND SUPPORT: WRITEVAL(((H+L+C)/3) -((-L+(2* (H+L+C)/3))-(-H+(2* (H+L+C)/3))),1.2) from
mp1:=Input("Days Volume Summed",1,377,30); mf1:=Input("Float, in X million",.1,10000,10); mf2:=mf1*1000000; (Sum(V,mp1)/mf2)*100; from
1) today's five-day RSI is greater than yesterday's five-day RSI; and 2) today's close is below the close of five days ago; and 3) today's close is less then or equal to the average of the last five day's closes. Long:=RSI(5)>Ref(RSI(5),-1) AND C<Ref(C,-5) AND C<=Mov(C,5,S);
1) today's close is higher than the average of the last five days' closes; or 2) you have been in the trade 10 days. If(Long=1 AND (C>(Mov(C,5,S) OR (Ref(Long,-10)=1 AND Ref(Long,-11)=0)),0,Long) from
I want to do an MetaStock Exploration with Directional Movement Index (DMI) that will scan for the crossing of the two: i.e., yesterday +DX is less than -DX, today +DX is greater than -DX, and visa versa.
Ref(Cross(MDI(14) , PDI(14)),-1) AND Cross(PDI(14) , MDI(14)) from
In his article "Normalization", Brian Bell introduces some methods for normalizing indicators. These methods can be easily created in MetaStock 6.52 or higher. Select Indicator Builder from the Tools Menu, click New and enter the formula for the desired method. Name: Simple Moving Average Oscillator OscP(4,8,S,$) Name: Simple MA Osc norm to Std Dev OscP(4,8,S,$)/Stdev(C,8) Name: Simple MA Osc norm to Ave True Range OscP(4,8,S,$)/ATR(8) Name: Simple MA Osc norm to Historical Range OscP(4,8,S,$)/WillR(200) Note: To apply these methods to different indicators replace the Simple Moving Average Oscillator portion with the desired indicator's formula.
Q:=Input("RSI Time Periods",1,1000,14); M:=Input("Momentum Time Periods",1,1000,5); B:=Input("Field: 1=Close, 2=Open, 3=High, 4=Low, 5=Volume",1,5,1); Bval:=If(B=1,C,If(B=2,O,If(B=3,H,If(B=4,L,V)))); Mom:=Bval-Ref(Bval,-M); Z:=Wilders(If(ROC(Mom,1,$)>0, ROC(Mom,1,$),0),LastValue(Q)); Y:=Wilders(If(ROC(Mom,1,$)<0, Abs(ROC(Mom,1,$)),0),LastValue(Q)); RMS:=Z/Y; RMIcust:=100-(100/(1+RMS)); Mov(RMIcust,M,S) from
In the indicator builder, you can create RSI of MACD (with MS 6.5 and later) : Q:=Input("Periods",1,1000,14); Z:=Wilders(If(ROC(MACD(),1,$)>0,ROC(MACD(),1,$),0),LastValue(Q)); Y:=Wilders(If(ROC(MACD(),1,$)<0,Abs(ROC(MACD(),1,$)),0),LastValue(Q)); RS:=Z/Y; 100-(100/(1+RS))
http://www.equis.com/customer/support/formulas/cf00098.html ...I just put MACD in the formula. I hope this helps...
Create an indicator called 'System - Volatility Breakout'. Then copy this crude code in: ************************************************* {Volatility Breakout System - returns Profit} Commission:=21; {for Buy+Sell+Stop} TradeAmt:=10000; Buy:=O+((Ref(H,-1)-Ref(C,-1))*.7); Sell:=C; Stop:=O; Trade:= O<Ref(C,-1) AND H>Buy AND Ref(C,-1)<Ref(C,-2) AND Ref(C,-2)<Ref(C,-3) AND Ref(C,-3)<Ref(C,-4); {Trigger for Trade} HitStop:= If(Trade AND Stop>=Sell,TRUE,FALSE); {Have we hit our Stop} TradeSize:= TradeAmt/Buy; Profit:=If(Trade,-Commission-TradeSize*Buy,0);{Purchase} Profit:=If(HitStop=TRUE,{then} Profit+Stop*TradeSize, {else} If(Trade AND HitStop=FALSE, {then} Profit+Sell*TradeSize,0)); {Sale} Win:=If(Profit>0,1,0); Loss:=If(Profit<0,1,0); Cum(Profit) ***************************************************** The indicator charts your profit. You just have to set the first 6 variables as per your system. The MS If structures are a pain and I'm sure there must be easier ways to do this. This is also my first attempt to prove if it works. If you then create an Expert Advisor with the following in the Commentary definition, you'll get some summary statistics for the system. ***************************************************** Volatility Breakout System Security Name: <Name> Security Symbol: <Symbol> Totals: Trades writeval( Cum( FmlVar("System - Volatility reakout","trade") ),0.0 ), Wins writeval(cum( FmlVar("System - Volatility Breakout","WIN") ),0.0), Losses Writeval(cum( FmlVar("System - Volatility Breakout","LOSS") ),0.0) Percentage Wins/Losses: writeval(cum( FmlVar("System - Volatility Breakout","WIN") )/Cum( FmlVar("System - Volatility reakout","trade") )*100,2.0)% Profit: $Writeval(cum( FmlVar("System - Volatility Breakout","PROFIT") ),0.0) Commission: $Writeval( FmlVar("System - Volatility Breakout","COMMISSION"),0.0 ) Trade Amount: $Writeval( FmlVar("System - Volatility Breakout","TRADEAMT"), 0.0) **************************************************************************** If you want to Highlight the Winning days in one colour and the Losing days in another, just use 'FmlVar("System - Volatility Breakout","WIN")' as the condition for a WIN, etc. The above is the only way I can see to test a system in MS that specifies the entry/exit prices. I suppose the other alternative is Excel!
1. Create a composite security in DownLoader consisting of NYSE Advancing Issues minus NYSE Declining Issues. Name the new security something like "Adv-Decl Issues." 2. Open the Adv-Decl Issues chart in MetaStock. 3. Create a new inner window. 4. Create two custom indicators in MetaStock: a) First is the McClellan Oscillator: Mov(CLOSE,19,EXPONENTIAL) - Mov(CLOSE,39,EXPONENTIAL) b) Second is the McClellan Summation Index: Cum(Mov(CLOSE,19,EXPONENTIAL) - Mov(CLOSE,39,EXPONENTIAL) ) 5. Plot the McClellan Oscillator custom indicator in the main chart window over top of the data plot and select "Display New Scale on Right." This will eliminate the Adv-Decl Issues' scale. 6. Select the Adv-Decl Issues data plot by clicking on it, then right click it and select "Adv-Decl Issues Properties" and change the bar colours to the same colour as your background to make it invisible. The raw data is needed for indicators, but need not be displayed. 7. Plot the McClellan Summation Index in the inner window. 8. Add whatever base lines you want. from
Pds1:= Input("EMA Periods?",1,100,20); Pds2:= Input("ATR Periods?",1,100,10); Mult:= Input("ATR Multiple?",1,10,2.5); EMA:= Mov(C, Pds1, E); Diff:= ATR(Pds2) * Mult; UBand:= EMA + Diff; LBand:= EMA - Diff; Ema; UBand; LBand; See also TAS&C Dec. 1999 p.45, ' Various STOCHASTIC RSI OPTIONS Mov((RSI(14)-LLV(RSI(14),9))/(HHV(RSI(14),9)-(LLV(RSI(14)+.00001,6))),4,E)*100
(RSI(14)-LLV(RSI(14),14))/(HHV(RSI(14),14)-LLV(RSI(14),14))*100
(Sum(RSI(14)-LLV(RSI(14),14),3)/Sum(HHV(RSI(14),14)-LLV(RSI(14),14),3))*100
{configurable formula for the StochRSI oscillator to quickly find what time periods/method you prefer to work with. CDH's List-post. (Sun, 15 Nov 1998 "Re: Finding the Stochastic of the Relative Strength")} mp1:=Input("RSI Periods",1,377,13); mp2:=Input("Stochastic Periods",1,377,13); mp3:=Input("Smoothing Periods",1,377,8); mat:=Input("MA Type: S, E, W",1,3,2); {1=S,2=E,3=W} If(mat=1, Mov((RSI(mp1)-LLV(RSI(mp1),mp2))/(.0000001+ HHV(RSI(mp1),mp2)-LLV(RSI(mp1),mp2)),mp3,S)*100, If(mat=2, Mov((RSI(mp1)-LLV(RSI(mp1),mp2))/(.0000001+ HHV(RSI(mp1),mp2)-LLV(RSI(mp1),mp2)),mp3,E)*100, If(mat=3, Mov((RSI(mp1)-LLV(RSI(mp1),mp2))/(.0000001+ HHV(RSI(mp1),mp2)-LLV(RSI(mp1),mp2)),mp3,W)*100,0))) ============================================================
rev. 01/06/97 In his book StochRSI = (RSI - RSIL)/(RSIH -RSIL) where RSIL and RSIH are the lowest and highest values of the RSI over a given period. In his book he uses 14 periods. The MetaStockT formula for the Stochastic RSI is: ( ( RSI ( 14 ) - LLV( RSI (14 ) ,14 ) ) / ( ( HHV( RSI (14 ) ,14 ) ) - LLV(RSI (14 ),14 ) ) ) from
There was an overbought/oversold indicator described in the June 2000 Futures Magazine called the Psychological Index. It looked sort of interesting, so I wrote the MetaStock code for it:
LookBack:= Input("Number of lookback periods", 2, 100, 12); UThreshold:= Input("Upper threshold (%)", 0, 100, 75); LThreshold:= Input("Lower threshold (%)", 0, 100, 25); UpDay:= If(CLOSE > Ref(CLOSE,-1), 1, 0); PsychIndex:= Sum(UpDay,LookBack) / LookBack * 100; PsychIndex; UThreshold; LThreshold from
periods:=Cum(If(C>0,1,0)); dollars:=C-ValueWhen(1,periods=1,C); percnt:=C/ValueWhen(1,periods=1,C); percnt; [or] dollars; You can quickly run an exploration and look at the buy and hold on everything in dollars or in percentage terms.
Period := Input("Period",10,200,20); Mov(If( CMF(Period ) > 0, 1, -1),Period,S)/Period; 0; from
I want to signal when a Doji occurs following a four-day consecutive increasing CLOSE. I would like this to be an ALERT, signaling if this completed pattern has occurred within the last five days. from Barry Kales Alert(Doji() AND Ref(C,-1) > Ref(C,-2) AND Ref(C,-2) > Ref(C,-3) AND Ref(C,-3) > Ref(C,-4) AND Ref(C,-4) > Ref(C,-5),5) from
This is a 28 period sine wave. The "flaw" is that it starts from the first period loaded in the chart rather than an absolute date. Change the -12 to shift the wave right or left. Ref(Sin( Cum(360/28) ), -12) There's also MetaStock's built-in cycle lines drawing tool. from
Here's an example of how to specify displaced moving average in the system tester . . . . Buy: Cross(C,Ref(Mov(C,50,e),-15)) {uses 50ema displaced by 15 days} Sell: Cross(Ref(Mov(C,50,e),-15),C) from
ATR(20) / MOV(Close,20,Simple) from
n:=Input("**Volatility** lookback length",1,50,20); x:=Input("%K smoothing (exponential smoothing)",1,50,3); y:=Input("%D smoothing (exponential smoothing)",1,50,3); lenmax:=28; lenmin:=7; v1:=Stdev(C,n); v2:=HHV(v1,n); v3:=LLV(v1,n); v4:=((v1-v3)/(v2-v3)); currlen:=(Int(lenmin+(lenmax-lenmin)*(1-v4))); hh:=HHV(H,LastValue(currlen)); ll:=LLV(L,LastValue(currlen)); RawStochK:=((C-ll)/(hh-ll))*100; SmoothedStochK:=Mov(RawStochK,x,E); StochD:=Mov(SmoothedStochK,y,E); 20; 80; StochD; SmoothedStochK; from
Exploration notes This uses the results of 6 custom indicators HINT When constructing this exploration use the PASTE FUNCTIONS button to transfer the exact formula name to the exploration. Col A: close CLOSE Col B: Ref(C,-1) Col C: Ref(C,-2) Col D: Fml( "MMA 3/30") + Fml( "MMA 5/35") + Fml( "MMA 8/40") + Fml( "MMA 10/45") + Fml( "MMA 12/50") + Fml( "MMA 15/60") Col E: 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) Filter When(colD,>,0) AND When(colE,<=,0)
## MMA 10/45If(OscP(10,45,E,%)>0,+1,-1) ## MMA 12/50If(OscP(12,50,E,%)>0,+1,-1) ## MMA 15/60If(OscP(15,60,E,%)>0,+1,-1) ## MMA 3/30If(OscP(3,30,E,%)>0,+1,-1) ## MMA 5/35If(OscP(5,35,E,%)>0,+1,-1) ## MMA 8/40If(OscP(8,40,E,%)>0,+1,-1)
Buy again three days after the signal.
FORMULAS FROM SITE VISITORS
(DAILY ADVANCING ISSUES -(minus) DAILY DECLINING ISSUES)= B McClellan OSC= MOV(B,19,E)- MOV(B,39,E) WHERE: -100 OR LESS IS OVERSOLD (BULLISH) WHERE: +100 OR GREATER IS OVERBOUGHT (BEARISH) Note that B is just a constant for illustration purposes only. Advance Decline Line {To display the Advance Decline Line, create a composite security in The DownLoader of Advancing Issues minus Declining Issues. Open a chart of the composite and plot this formula} Cum(CLOSE) McClellan Oscillator {To display the McClellan Oscillator, create a composite security in The DownLoader of Advancing Issues minus Declining Issues. Open a chart of the composite and plot this custom indicator.} Mov(CLOSE,19,EXPONENTIAL) - Mov(CLOSE,39,EXPONENTIAL)
momu:=If(C>Ref(C,-1),C-Ref(C,-1),0); momd:=If(C<Ref(C,-1),Ref(C,-1)-C,0); A1:=Stdev(momu,100); A2:=Stdev(momd,100); Mup:=If(C-Ref(C,-1)>A1,C-Ref(C,-1),0); Mdn:=If(Ref(C,-1)-C>A2,Ref(C,-1)-C,0); Periods:=Input("Length",5,100,13); CMOF:=100*((Sum(Mup,Periods)-Sum(Mdn,Periods)) /(Sum(Mup,Periods)+Sum(Mdn,Periods))); Sig:=Mov(CMOF,10,S); Hist:=CMOF-Sig; Hist; Sig; CMOF;
AI:= Security("D:\Stocks\Market Indicators\X.NASD-A",C); AV:= Security("D:\Stocks\Market Indicators\X.NASD-A",V); DecI:= Security("D:\Stocks\Market Indicators\X.NASD-D",C); DecV:= Security("D:\Stocks\Market Indicators\X.NASD-D",V); TO:=(((AI*AV)-(DecI*DecV))/((AI*AV)+(DecI*DecV)))*100; Periods1:=Input("length1",3,100,21); Periods2:=Input("length2",3,100,5); IND:=Mov(TO,Periods1,S); sig:=Mov(IND,Periods2,S); sig; IND; You will have to create securities of advancing issues,declining issues,advancing volume, declining volume first then type in the directory where they are located
the thrust osc, the metastock formula AI:= Security("D:\Stocks\Market Indicators\X.NASD-A",C); AV:= Security("D:\Stocks\Market Indicators\X.NASD-A",V); DecI:= Security("D:\Stocks\Market Indicators\X.NASD-D",C); DecV:= Security("D:\Stocks\Market Indicators\X.NASD-D",V); TO:=(((AI*AV)-(DecI*DecV))/((AI*AV)+(DecI*DecV)))*100; Periods1:=Input("length1",3,100,21); Periods2:=Input("length2",3,100,5); IND:=Mov(TO,Periods1,S); sig:=Mov(IND,Periods2,S); sig; IND; You will have to have created securities of advancing issues,declining issues,advancing volume, declining volume
How would I write a MetaStock System Tester for: Buy: stoch(12,3) has fallen below 36 and then crosses above its 6 day WMA. Sell: stoch(12,3) rises above 52 and then falls below its 3 day WMA OR 3 day WMA of stoch crosses above 55.
stoch(12,3)<36 and cross(stoch(12,3),mov(stoch(12,3),6,w)) stoch(12,3)>52 and cross(mov(stoch(12,3),3,w),stoch(12,3)) or mov(stoch(12,3),3,w)>55
True Strength Index (TSI) - "Momentum, Direction and Divergence", William Blau, Pub: John Wiley& Sons (see also TASC Jan '93, "Stochastic Momentum" gives the formula for the true strength index. This article refers to an older article by Blau in the Jan '91 TASC "Double Smoothed Stochastics") TSI(close,r,s) = 100*EMA(EMA(mtm,r),s / EMA(EMA(ImtmI,r),s) >> Your formula expanded >> 100*(Mov(Mov(ROC(C,1,$),25,E),13,E)/Mov(Mov(Abs(ROC(C,1,$)),25,E),13,E))
mtm = one-day momentum of close r-day EMA of mtm {25 day} s-day EMA {13 day double smoothing}
ImtmI = absolute value of mtm r-day EMA of ImtmI s-day EMA {double smoothing} TSI(close,25,13) Signal Line = EMA(TSI,7) thresholds at +25, 0, -25
{little lag Vs smoothing of price} Ergodic Oscillator = Ergodic + Signal line {TSI version of Slow Stochastic} Ergodic(close,r) = TSI(close,r,5) {double smoothing is fixed at 5} Signal Line(close,r) = EMA(TSI(close,r,5),5) r = 20days thresholds are +20, -20 Interesting comparison chart between 20 Slow Stochastic and 20 Erodic {more head room in oversold-bought areas} another chart showing Ergodic Osc = TSI(close,32,5) with 5-day EMA signal line
1. Enter or hold position only when slope of Ergodic Signal line has the same direction as the trend 2. Stand aside when slope of Ergodic Signal Line is in the opposite direction of trend 3. Enter or exit position when Ergodic and its Signal Line cross
Slow TSI Trend = TSI(close,64,64) {? weekly looking chart - very little lag} Thresholds set at +15 & -15 Trading Ergodics with Slow TSI Trend 1st window - Slow TSI Trend = TSI(close,64,64) 2nd window - Ergodic Osc = TSI(close,64,5)
True Strength Index = TSI TSI(close,r,s) = 100*EMA(EMA(mtm,r),s / EMA(EMA(ImtmI,r),s)
mtm = one-day momentum of close r-day EMA of mtm {25 day} s-day EMA {13 day double smoothing}
ImtmI = absolute value of mtm r-day EMA of ImtmI s-day EMA {double smoothing} TSI(close,25,13) Signal Line = EMA(TSI,7) thresholds at +25, 0, -25 - 0 - 5 day EMA of 20 day EMA of 1 day momentum {little lag Vs smoothing of price} - 0 - Ergodic Oscillator = Ergodic + Signal line {TSI version of Slow Stochastic} Erodic(close,r) = TSI(close,r,5) {double smoothing is fixed at 5} Signal Line(close,r) = EMA(TSI(close,r,5),5) r = 20days thresholds are +20, -20 interesting comparision chart between 20 Slow Stochastic and 20 Erodic {more head room in oversold-bought areas} another chart showing Ergodic Osc = TSI(close,32,5) with 5-day EMA signal line - 0 -
1. Enter or hold position only when slope of Erogodic Signal line has the same direction as the trend 2. Stand aside when slope of Erogodic Signal Line is in the opposite diretion of trend 3. Enter or exit position when Erogodic and its Signal Line cross - 0 - Slow TSI Trend = TSI(close,64,64) {? weekly looking chart - very little lag} Thresholds set at +15 & -15 Trading Ergodics with Slow TSI Trend 1st window - Slow TSI Trend = TSI(close,64,64) 2nd window - Ergodic Osc = TSI(close,64,5)
FORMULAS FROM SITE VISITORS
The RSquared, S/C,MFI test is based on linear regression. RSquared is a linear regression function that measures how strong a data array of given length is trending. It's really based on correlation. A return of one correlates to a very strong trend in either direction that rises or falls one point per day. A return of zero correlates to no trend. I'm using RSquared to tell me when there is no trend over the last 21 days, or that RSquared(C,21) is less than 0.15. Now that we have no trend, we would expect one to start in the next 5 to 13 days. If one does start we want to determine the direction and get in early. Therefore I use RSquared as my trigger, combining it with the ALERT function. With the ALERT given by RSquared being less then 0.15, then we will get a buy signal if all my other conditions are met within a 13-day period that I also set with the ALERT function. For the other conditions, I'm using S/C, MFI, and the 55-day Variable Moving Average (vma) to determine trend start and direction. S/C is nothing more than the normalized 34 day LinRegSlope of the close. I normalize it by dividing it by the close so charts are more directly comparable. I also multiply by 10000 just to get numbers between 0 and a few hundred. Finally I apply Tema smoothing to get a smoother plot. Therefore my formula for Tema S/C becomes: Tema S/C Periods := Input("Enter Periods",1,233,34); Tema(10000*LinRegSlope(C,Periods)/C,Periods) The theory is that if Tema S/C is rising then a up trend is in progress. If Tema S/C is falling a downtrend is in progress. I check this by making sure that tema(S/C) is larger than an optimized value (opt1) and is rising. I use the function HHV(X,5) = HHV(X,13) to check that it is really rising. This is just a quick way to determine if the most reason values of X have been rising. If the condition is met, then S/C is rising. Similarly if it met the condition LLV(X,5) = LLV(C,13) it would be falling. I double-check the result by also making sure that both the MFI and the 55-day vma are also rising. I use a Tema MFI formula which is just the tema smoothed MFI - 50 so it can be plotted as a histogram. The formula is: Tema MFI Periods := Input("Enter Tema Smoothing Periods",13,55,55); Tema(MFI(Periods),Periods) - 50 When all conditions are met within 13 days of the alert, we get a buy signal. The converse is true for a sell signal. Since the market is biased upwards, I use an additional check for the short - Tema MFI less then 0. I close the positions when the trend has stopped. For the long position I check that the Tema(MFI) is below 0, the Tema(S/C) is below opt 1 and that both are falling. Short positions tend to move faster, so I only look for the Tema MFI to be greater than zero and the 55 day vma to begin rising to close that position. The complete test follows: ENTER LONG: Alert(RSquared(C,21) < 0.15,13) AND Tema(10000*LinRegSlope(C,34)/C,34) > opt1 AND HHV(Tema(10000*LinRegSlope(C,34)/C,34),5) = HHV(Tema(10000*LinRegSlope(C,34)/C,34),13) AND HHV(Tema(MFI(55),55),5) = HHV(Tema(MFI(55),55),13)) CLOSE LONG: Tema(MFI(55),55) - 50 < 0 AND Tema(10000*LinRegSlope(C,34)/C,34) < opt1 AND LLV(Tema(10000*LinRegSlope(C,34)/C,34),5) = LLV(Tema(10000*LinRegSlope(C,34)/C,34),13) AND LLV(Tema(MFI(55),55),5) = LLV(Tema(MFI(55),55),1 ENTER SHORT Alert(RSquared(C,21) < 0.15,13) AND Tema(10000*LinRegSlope(C,34)/C,34) < opt2 AND LLV(Tema(10000*LinRegSlope(C,34)/C,34),5) = LLV(Tema(10000*LinRegSlope(C,34)/C,34),13) AND LLV(Tema(MFI(55),55),5) = LLV(Tema(MFI(55),55),13) AND Tema(MFI(55),55) - 50 < 0 AND LLV(Mov(C,55,VAR),5) = LLV(Mov(C,55,VAR),13) CLOSE SHORT HHV(Mov(C,55,VAR),5) = HHV(Mov(C,55,VAR),13) AND Tema(MFI(55),55) - 50 > 0 OPTIMIZATION: OPT1: Min=-34 Max=-8 Step=13 OPT2: Min=-55 Max=-21 Step=34 Although I have Tema S/C and Tema MFI defined as custom formulas so I can plot them as indicators on my charts, I don't call the custom formulas in the tests. Instead I use the actual formulas. The reason I do this, is that the test will run faster when the formulas are used direct instead of calling for the custom formulas. from
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, minus one for a bearish indication, and zero for a neutral condition. Then you add them all up for your binary wave indicator. I decided to format all my indicators so they could be plotted as a histogram. For these indicators plotting as histograms, positive is bullish and negative is bearish. To cut down on whipsaws, I decided that over +5 would be bullish, under -13 would be bearish and anything in between would be neutral. Therefore my binary wave formulas are: BW2 Demand Index If(Tema(DI(),21) > 5,+1,If(Tema(DI(),21) < -13,-1,0)) BW3 Linear Regression Slope If(Tema(10000*LinRegSlope(C,34)/C,34) > 5,+1, If(Tema(10000*LinRegSlope(C,34)/C,34) < -13,-1,0)) BW4 CCI If(Tema(CCI(21),21) > 5,+1, If(Tema(CCI(21),21) < -13,- 1,0)) BW5 ROC If(Tema(ROC(C,21,%),21) > 2,+1,If(Tema(ROC(C,21,%),21) < -2,-1,0)) BW6 Money Flow If(Tema(MFI(21),21)-50 > 5,+1,If(Tema(MFI(21),21)-50 < -5,-1,0)) BW7 CMO If(Tema(CMO(C,21),21) > 5,+1,If(Tema(CMO(C,21),21) < -5,-1,0)) BW8 VAR ma If(Mov(C,21,VAR) > Mov(C,55,VAR) AND HHV(Mov(C,233,VAR),5) = HHV(Mov(C,233,VAR),13),+1,If(Mov(C,21,VAR) < Mov(C,55,VAR) AND LLV(Mov(C,233,VAR),5) = LLV(Mov(C,233,VAR),13),-1,0)) The next formula just adds up the binary wave: BW Add Fml("BW2") + Fml("BW3") + Fml("BW4") + Fml("BW5") + Fml("BW6") + Fml("BW7") + Fml("BW8") Next, I decided to do something a little different. Since the whole purpose of this test is to catch a trending stock, I decided to add an amplifier that would get larger as the trend got stronger. Since I like Fibonacci numbers, I decided to use Rsquared as a measure of trend strength and base my amplifier on Fibonacci numbers. The formula I finally came up with after a lot of tinkering follows. BW Amplifier If(RSquared(C,21) > 0.8,5,If(RSquared(C,21) > 0.6,3,If(RSquared(C,21) > 0.4,2, If(RSquared(C,21)>0.2,1,0.5)))) The last step in constructing the binary wave was to decide on the smoothing and put it all together. Of course, I used tema smoothing. Tema Binary Wave Composite Periods := Input("Enter Tema Smoothing Periods",8,233,21); Tema(Fml("BW Add")*Fml("BW Amplifier"),Periods) The final step is to come up with a system test for the Tema Binary Wave Composite. Remember, the binary wave is just made up of a bunch of technical indicators that I give a +1 value when bullish, 0 when neutral, and -1 when bearish. Then they are summed and smoothed. So in general a positive value is bullish and a negative value is bearish. Also a rising number is bullish and a falling number is bearish. 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 you had a good algorithm, 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. 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. It does have the disadvantage of finding way too many peaks so I only use it as an Alert. For confirmation I use the QStick function and a variable moving average function. QStick was developed by Chande as a way to quantify candlesticks. Since the difference between the open and close prices lies at the heart of candlestick charting, QStick is simply a moving average of that difference. Negative values of QStick correlate to black candlesticks, positive values to white candlesticks. Since in general black candles are bearish and white candles are bullish, this indicator can also be plotted as a histogram and interpreted the same was as the Binary Wave. The formula is: Periods := Input("Enter Periods",1,233,34); Tema(Qstick(Periods),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, I have to have both the QStick rising and the 21 day vma greater then the 55 day vma. Therefore my buy signal became: Enter Long Alert(Cross(Fml("Tema Binary Wave Comp"), Mov(Fml("Tema Binary Wave Comp"),8,S)),21) AND HHV(Tema(Qstick(34),34),5) = HHV(Tema(Qstick(34),34),13) AND Mov(H,21,VAR) > Mov(H,55,VAR) Since the market has an upward bias, I wanted my sell signal to be more restrictive. Therefore instead of trying to catch a fall from a positive peak as my sell alert, I wanted a crossover of an optimized negative number. I still used QStick and vma to confirm and also added that the close should be lower than yesterdays low. Therefore, my sell signal became: Enter Short Alert(Cross(-opt2,Fml("Tema Binary Wave Comp")),8) AND Tema(Qstick(34),34) < -0.1 AND C < Ref(L,-1) AND Mov(L,21,VAR) < Mov(L,55,VAR) Then I wanted exit conditions that were less then full signal reversals. I decided that the BW being less than a negative number would be my primary close long signal, but I also wanted confirmation from other indicators. After a lot of trial and error I used the following: Close Long Fml("Tema Binary Wave Comp") < -opt1 AND Tema(Qstick(34),34) < 0 AND LLV(Mov(L,21,VAR),5) = LLV(Mov(L,21,VAR),13) Close Short Fml("Tema Binary Wave Comp") > 0 AND Tema(Qstick(34),34) > 0.08 Finally I also used Fibonacci numbers for my optimization: Opt 1: Min 3, Max 13, Step 5 Opt 2: Min 3, Max 13, Step 5
My third MetaStock Profit System Test is based on Wilder's directional movement indicators. As the MetaStock manual indicates, Wilder says a buy signal occurs when PDI - MDI moves above zero and a sell signal occurs when PDI-MDI falls below zero. I started with that thought and experimented a little. Wilder used 14 day periods to calculate his PDI and MDI functions. Since I like Fibonacci numbers, I used 13 days instead. Also I like to smooth my indicators so I used Tema smoothing. My custom PDI - MDI formula then became: Tema PDI - MDI Periods := Input("Enter Tema Smoothing Periods",8,55,13); Tema(PDI(13) - MDI(13),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, this number did not have to be zero and did not have to be the same for entering long and entering short. After a lot of trial an error I decide -1, -3, or -5 would be my enter long number and -5, -13, or -21 would be my enter short number. 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. Also down moves tend to be fast an extreme and this would only let us in short for larger, faster down moves which is what I wanted. 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. For long positions, 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. Therefore, I thought an adx max and min for a buy signal would help reduce false signals. After some experimenting, I set the min at 8 and the max at 21. 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. After more experimenting, I decided on the following for my open long signal: Open Long: Alert(Cross(Fml("Tema PDI - MDI"),opt1),13) AND MDI(13) - ADX(13) <= 4 AND MDI(13) - 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. When a stock starts to drop, the MDI starts to rise, so I wanted the MDI to be greater than a certain number to close a position. Finally, since markets are biased upwards, I also wanted the 55 day variable moving average to be dropping before I closed the position. Therefore, the close long became: Close Long: Fml("Tema PDI - MDI") < opt1 AND MDI(13) > 21 AND LLV(Mov(L,55,VAR),5) = LLV(Mov(L,55,VAR),13) To open a short position, I wanted the PDI-MDI to cross below a fairly high negative number. I wanted confirmation in that the adx was still fairly high when that happened. The answer was: Open Short: Alert(Cross(opt2,Fml("Tema PDI - MDI")),8) AND ADX(13) > 34 To close the short position, I only wanted PDI-MDI to be greater than a certain positive number. I don't like a lot of confirmations for closing shorts. With the bias being up, you need to close shorts fast. My close Short and optimization became: Close Short: Fml("Tema PDI - MDI") > 13 Optimization: Opt1: Min = -1 Max = -5 Step = 2 Opt2: Min = -21 Max = -5 Step = 8
I've been very busy and got away from the discussion of my MetaStock System tests. This week I'm going to get back on track and discuss my fourth MetaStock Profit System Test - 04_Tema PV Binary Wave, StochRSI_21. As you may recall from my post last fall, I wanted to develop a binary wave and a binary wave system test based on price and volume patterns to supplement my indicator - Binary Wave Composite. I didn't want to use any indicators except price and volume. I'd hoped to use all the old sayings such as higher highs and higher lows are bullish, breakouts and big moves on large volume, etc. I developed the binary wave with the help and participation of several on this forum. After a lot of experimenting, we came up with the following Binary wave formulas: PVBW01 (Highs & Lows) If(HHV(L,8) = HHV(L,21),2,0) + If(HHV(L,21) = HHV(L,55),2,0) + If(HHV(L,55) = HHV(L,233),1,0) + If(HHV(H,8) = HHV(H,21),2,0) + If(HHV(H,21) = HHV(H,55),2,0) + If(HHV(H,55) = HHV(H,233),1,0) + If(LLV(H,8) = LLV(H,21),-2,0) + If(LLV(H,21) = LLV(H,55),-2,0) + If(LLV(H,55) = LLV(H,233),-1,0) + If(LLV(L,8) = LLV(L,21),-2,0) + If(LLV(L,21) = LLV(L,55),-2,0) + If(LLV(L,55) = LLV(L,233),-1,0) PVBW02 (High Vol Move) If(Mov(V,3,S) > 1.02*Mov(V,21,S),1,0) * If(C > Ref(H,-1),2,0) + If(Mov(V,2,S) > 1.02*Mov(V,21,S),1,0) * If(C < Ref(L,-1),-2,0) PVBW03 (New 233 Day High or Low) ((If(Mov(V,2,S) > 1.02*Mov(V,21,S),1,0)) * If((H = HHV(H,233)),3,0)) + ((If(Mov(V,2,S) > 1.02*Mov(V,21,S),1,0)) * If((L = LLV(L,233)),-3,0)) PVBW04 (Price Look Back) (2*(C-Ref(C,-21)) + 2*(C-Ref(C,-55)) + (C-Ref(C,-233)))/C The idea behind PVBW01 was the old idea that higher highs and higher lows are bullish and lower lows and lower highs are bearish. We decided that it made sense to test for short, intermediate, and long term indications. We used the Fibonacci values of 21, 55, and 233 days for short, intermediate, and long term moving averages. After a lot of experimenting, we gave more weight to the short and intermediate term results. The idea behind PVBW02 was that a close above yesterdays high is bullish if it happens on good volume. Conversely, a close below yesterdays low is bearish if it happens on good volume. After more experimenting, we assigned a weight of +2 and -2 when these conditions were met. The idea behind PVBW03 is similar except we use new yearly highs and lows. We also assign more weight for meeting this condition. The idea behind PVBW04 is different. I wanted a look back indicator of some sort as the final component. I started with a 21, 55, and 233 day look back of the close and made it bullish or bearish just on comparing the two closing prices. However, when I got to thinking about this I thought it was just another way of getting the same results as our first binary wave. What I really wanted was momentum, so I came up with the idea of subtracting the two closes, assigning different weightings (our old 2, 2, 1) relationship, and then dividing by the closing price to normalize the results so there wouldn't be differences between low and high priced stocks. To get the final PVBW formula, I first had to add each together with the following formula: PVBW Add Fml("PVBW01") + Fml("PVBW02") + Fml("PVBW03") + Fml("PVBW04") Finally the last formula applies Tema Smoothing as follows: Tema PV Binary Wave Periods := Input("Enter Tema Smoothing Periods",8,55,21); Tema(Fml("PVBW Add"),Periods) After we got the formula, the next challenge was how to test it. To develop the PVBW we used a simple zero cross over test to determine the appropriate variables for each of the Binary Wave components. The original test was: 05_Tema PV Binary Wave ENTER LONG: Cross(Fml("Tema PV Binary Wave"),0) ENTER SHORT: Cross(0,Fml("Tema PV Binary Wave")) We improved that considerably and came up with the following test: 04_Tema PV Binary Wave, StochRSI_21 ENTER LONG: (Cross(Fml("Tema PV Binary Wave"),opt1) AND Fml("Tema StochRSI_21") > 0) OR (Cross(Fml("Tema StochRSI_21"),0) AND Fml("Tema PV Binary Wave") > 0) CLOSE LONG: Fml("Tema PV Binary Wave") < -opt1 AND Fml("Tema StochRSI_21") < 0 ENTER SHORT: Fml("Tema PV Binary Wave") < opt2 AND Fml("Tema StochRSI_21") < 0.1*opt2 CLOSE SHORT: Fml("Tema PV Binary Wave") > 0 AND Fml("Tema StochRSI_21") > 0 OPTIMIZATION: Opt1: Min = -5, Max = +5, Step = +5 Opt2: Min = -8, Max = -2, Step = +3 Before I discuss the test, I first need the following formula: Tema StochRSI_21 Periods := Input("Enter Periods",5,233,21); Tema(((RSI(Periods) - LLV(RSI(Periods ),Periods)) / ((HHV(RSI(Periods),Periods)) - LLV(RSI(Periods),Periods))) - 0.5,periods) That's just the standard stochRSI formula that I tweaked to allow use of Fibonacci numbers and Tema smoothing. Now back to the test. We get a enter long signal when the Tema PV Binary Wave crosses an optimized number and is confirmed by Tema StochRSI_21 being greater than 0 or when Tema StochRSI_21 crosses 0 and is confirmed by Tema PV Binary Wave being greater than 0. We get a close long signal when both Tema PV Binary Wave is less than minus opt1 and Tema StochRSI_21 is less than 0. Since the market is biased upwards, we want the short signals to be based on tougher critera, Therefore the enter Short signal is only generated when both the Tema PV Binary Wave and the Tema stochRSI are less than an optimized number. We close the Short when both are above 0.
For my last MetaStock system test, (05_StochRSI_13 & 55) I used the StochRSI formula described at the Equis site then modified it slightly. The original formula was: ( ( RSI ( 14 ) - LLV( RSI (14 ) ,14 ) ) / ( ( HHV( RSI (14 ) ,14 ) ) - LLV(RSI (14 ),14 ) ) ) I didn't want to use a specific number such as 14 for my formula, but want to be able to use my favorite Fibonacci numbers. I also wanted to smooth the formula with Tema smoothing. I finally settled on the Fibonacci numbers of 13 and 55 for my formulas. I also subtracted 0.5 from the result so I could plot the formula as a histogram. Therefore my formulas became: Tema StochRSI_13 Periods := Input("Enter Tema Smoothing Periods",5,233,13); Tema(((RSI(Periods) - LLV(RSI(Periods),Periods)) / ((0.0001 + HHV(RSI(Periods),Periods)) - LLV(RSI(Periods),Periods))) -0.5,Periods) --------------------------------------------------------------------------------- Tema StochRSI_55 Periods := Input("Enter Tema Smoothing Periods",5,233,55); Tema(((RSI(Periods) - LLV(RSI(Periods),Periods)) / ((0.0001+HHV(RSI(Periods),Periods)) - LLV(RSI(Periods),Periods))) -0.5,Periods) After I decided on the formulas, the next step was how to use them in a system test. I plotted the two formulas above several of my favorite stocks and looked at them for buying patterns. Since they are plotted as a histogram I looked at zero crossovers to the upside as buys and to the downside as sells. Then instead of a zero crossover, I used an optimized value crossover. After some experimenting, I found that the shorter length crossover gave better signals if I also required the longer length one to be negative, and confirmed an up move by also requiring that a short term moving average was moving up. Finally I saw that there was usually a good buy signal when the longer term formula crossed the optimized value and the shorter term formula was above zero. Therefore my open long signal became: OPEN LONG: (Alert(Cross(Fml("Tema StochRSI_13"),opt1),21) AND Fml("Tema StochRSI_55") < 0 AND Mov(C,21,VAR) > Ref(Mov(C,21,VAR),-8)) OR Alert(Cross(Fml("Tema StochRSI_55"),opt1),13) AND Fml("Tema StochRSI_13") > 0 I couldn't find a good close long signal, but did find that a reverse to a short on the longer term StochRSI crossing an optimized value confirmed by a falling moving average seemed to work well. Therefore my Open Short became: OPEN SHORT: Alert(Cross(opt2,Fml("Tema StochRSI_55")),13) AND Mov(C,21,VAR) < Ref(Mov(C,21,VAR),-8) The optimization valiues are: opt1: Min = -0.3 Max = 0 Step = 0.1 opt2: Min = -0.3 Max = 0 Step = 0.1 That's all there is to the StochRSI test, but it seems to work very well for some stocks. Try it and let me know what you think.
For my last MetaStock system test, (05_StochRSI_13 & 55) I used the StochRSI formula described at the Equis site then modified it slightly. The original formula was: ( ( RSI ( 14 ) - LLV( RSI (14 ) ,14 ) ) / ( ( HHV( RSI (14 ) ,14 ) ) - LLV(RSI (14 ),14 ) ) ) I didn't want to use a specific number such as 14 for my formula, but want to be able to use my favorite Fibonacci numbers. I also wanted to smooth the formula with Tema smoothing. I finally settled on the Fibonacci numbers of 13 and 55 for my formulas. I also subtracted 0.5 from the result so I could plot the formula as a histogram. Therefore my formulas became: Tema StochRSI_13 Periods := Input("Enter Tema Smoothing Periods",5,233,13); Tema(((RSI(Periods) - LLV(RSI(Periods),Periods)) / ((0.0001 + HHV(RSI(Periods),Periods)) - LLV(RSI(Periods),Periods))) -0.5,Periods) --------------------------------------------------------------------------------- Tema StochRSI_55 Periods := Input("Enter Tema Smoothing Periods",5,233,55); Tema(((RSI(Periods) - LLV(RSI(Periods),Periods)) / ((0.0001+HHV(RSI(Periods),Periods)) - LLV(RSI(Periods),Periods))) -0.5,Periods) After I decided on the formulas, the next step was how to use them in a system test. I plotted the two formulas above several of my favorite stocks and looked at them for buying patterns. Since they are plotted as a histogram I looked at zero crossovers to the upside as buys and to the downside as sells. Then instead of a zero crossover, I used an optimized value crossover. After some experimenting, I found that the shorter length crossover gave better signals if I also required the longer length one to be negative, and confirmed an up move by also requiring that a short term moving average was moving up. Finally I saw that there was usually a good buy signal when the longer term formula crossed the optimized value and the shorter term formula was above zero. Therefore my open long signal became: OPEN LONG: (Alert(Cross(Fml("Tema StochRSI_13"),opt1),21) AND Fml("Tema StochRSI_55") < 0 AND Mov(C,21,VAR) > Ref(Mov(C,21,VAR),-8)) OR Alert(Cross(Fml("Tema StochRSI_55"),opt1),13) AND Fml("Tema StochRSI_13") > 0 I couldn't find a good close long signal, but did find that a reverse to a short on the longer term StochRSI crossing an optimized value confirmed by a falling moving average seemed to work well. Therefore my Open Short became: OPEN SHORT: Alert(Cross(opt2,Fml("Tema StochRSI_55")),13) AND Mov(C,21,VAR) < Ref(Mov(C,21,VAR),-8) The optimization valiues are: opt1: Min = -0.3 Max = 0 Step = 0.1 opt2: Min = -0.3 Max = 0 Step = 0.1 That's all there is to the StochRSI test, but it seems to work very well for some stocks. Try it and let me know what you think. from
My understanding is that Donchian Channels are channels formed by the highest high and lowest low in the last 20 days (traditionally). The MetaStock code for the indicator would then be: Periods:= Input("Enter number of periods", 20, 60, 20); UpperChannelLine:= Ref(HHV(HIGH, Periods), -1); LowerChannelLine:= Ref(LLV(LOW, Periods), -1); UpperChannelLine; LowerChannelLine from
TotalVolume:=LastValue(Cum(V)); n := TotalVolume - Input("Float Volume", 1, 100000000000, 100000000); TrueDays:=(LastValue(BarsSince(Cum(V)<=n)))-1; HighestSince(1,(BarsSince(Cum(V)<=n)>0),LastValue(HHV((HighestSince(1,(BarsSince(Cum(V)<=n)>0),Ref(H,-1))),TrueDays))); LowestSince(1,(BarsSince(Cum(V)<=n)>0),LastValue(LLV((LowestSince(1,(BarsSince(Cum(V)<=n)>0),Ref(L,-1))),TrueDays)))
Formula:
DN:=1; HN:=2; HN3:=DN+HN; HN4:=HN+HN; HN5:=HN+HN+DN; HN6:=HN+HN+HN; HN7:=HN+HN+HN+DN; n:=50; sOne:=((n-DN)/HN)*C+ ((n-HN3)/HN)*Ref(C,-DN)+ ((n-HN5)/HN)*Ref(C,-HN)+ ((n-HN7)/HN)*Ref(C,-HN3)+ ((n-(HN7+HN))/HN)*Ref(C,-HN4)+ ((n-(HN7+HN4))/HN)*Ref(C,-HN5)+ ((n-(HN7+HN6))/HN)*Ref(C,-HN6)+ ((n-(HN5*HN3))/HN)*Ref(C,-HN7)+ ((n-(HN5*HN3+HN)/HN)*Ref(C,-HN*HN4)+ ((n-(HN5*HN3+HN4))/HN)*Ref(C,-HN3*HN3)+ ((n-(HN5*HN4+DN))/HN)*Ref(C,-HN*HN5)+ ((n-(HN5*HN4+HN3))/HN)*Ref(C,-HN*HN5+DN)+ ((n-(HN5*HN5))/HN)*Ref(C,-HN3*HN4)+ ((n-(HN5*HN5+HN))/HN)*Ref(C,-HN3*HN4+DN)+ ((n-29)/HN)*Ref(C,-HN3*HN4+HN)+ ((n-31)/HN)*Ref(C,-HN3*HN5)+ ((n-33)/HN)*Ref(C,-HN3*HN5+DN)+ ((n-35)/HN)*Ref(C,-HN3*HN5+HN)+ ((n-37)/HN)*Ref(C,-HN3*HN6)+ ((n-39)/HN)*Ref(C,-HN3*HN6+DN)+ ((n-41)/HN)*Ref(C,-HN4*HN5)+ ((n-43)/HN)*Ref(C,-HN4*HN5+DN)+ ((n-45)/HN)*Ref(C,-HN4*HN5+HN)+ ((n-47)/HN)*Ref(C,-HN4*HN5+HN3)+ ((n-49)/HN)*Ref(C,-HN4*HN6)+ ((n-51)/HN)*Ref(C,-HN5*HN5)+ ((n-53)/HN)*Ref(C,-HN5*HN5+DN)+ ((n-55)/HN)*Ref(C,-HN5*HN5+HN)+ ((n-57)/HN)*Ref(C,-HN4*HN7)+ ((n-59)/HN)*Ref(C,-HN4*HN7+DN)+ ((n-61)/HN)*Ref(C,-HN6*HN5)+ ((n-63)/HN)*Ref(C,-HN6*HN5+DN)+ ((n-65)/HN)*Ref(C,-HN6*HN5+HN)+ ((n-67)/HN)*Ref(C,-HN6*HN5+HN3)+ ((n-69)/HN)*Ref(C,-HN6*HN5+HN4)+ ((n-71)/HN)*Ref(C,-HN5*HN7)+ ((n-73)/HN)*Ref(C,-HN6*HN6)+ ((n-75)/HN)*Ref(C,-HN6*HN6+DN)+ ((n-77)/HN)*Ref(C,-HN6*HN6+HN)+ ((n-79)/HN)*Ref(C,-HN6*HN6+HN3)+ ((n-81)/HN)*Ref(C,-HN6*HN6+HN4)+ ((n-83)/HN)*Ref(C,-HN6*HN6+HN5)+ ((n-85)/HN)*Ref(C,-HN7*HN6)+ ((n-87)/HN)*Ref(C,-HN7*HN6+DN)+ ((n-89)/HN)*Ref(C,-HN7*HN6+HN)+ ((n-91)/HN)*Ref(C,-HN7*HN6+HN3)+ ((n-93)/HN)*Ref(C,-HN7*HN6+HN4)+ ((n-95)/HN)*Ref(C,-HN7*HN6+HN5)+ ((n-97)/HN)*Ref(C,-HN7*HN6+HN6)+ ((n-99)/HN)*Ref(C,-HN7*HN7)); TN:=Mov(C,n,S); yTwo:=TN+(HN6*sOne)/((n+DN)*n); yTwo
As you can see from the older mails below, there are quite a few CC indicators around. The Curves: Indicators, Momentums, Oscillators and SysTests. The one I am using is a 3-week tradeable version: Name: Coppock Curve - LT Momentum Formula: 1). Calculate the % change in value from 14 months ago. 2). Calculate the % change in value from 11 months ago. 3). Add 1 + 2. 4). The Coppock indicator is the 10-month (220days) weighted average of 3. 4). Original Modified to a 3-week version for trading purposes. 5). Overlay for trigger with a 14-day SMA, AJM.} Mov((CLOSE-Ref(C,-300))/(Ref(C,-300)*0.01)+ (CLOSE-Ref(C,-240))/(Ref(C,-240)*0.01),15,W) Regards,
BackVolume:=LastValue(Cum(V))-Cum(V)+V; float:=Input("# Shares (millions) ",1,100,1); float=float*1000000; if(BackVolume>=float,+1,-1);
Here's how the WCVFI works: The float is a variable input value that must be entered for each different stock under consideration. Starting on any given day and working backward, the current day's volume is added to the previous day's volume and adds that to the next previous day's volume and so on. As each volume number from the past is added cumulatively, the computer compares the running total with that particular stock's float. When the cumulative total is equal to or greater than the float, a dot is placed above that particular bar on the chart. Then two horizontal lines are plotted on the chart. The top line shows the highest price reached during the backward count, and the bottom line, the lowest price. These lines serve as trigger lines for the buy and sell signals. When the stock's price goes through the top line it gives a buy signal, and when it goes through the bottom line it gives a sell signal. The lines extend backward from the starting date to the bar, where the float has gone through one complete turnover. Some stocks with a small float may take months or years to go through one complete turnover, while other stocks with large floats may have a rapid turnover in a matter of days. The program is set up to start counting backward from any date entered for historical studies or set for the present date form constant updates. If a stock's price is rising day after day, the program gives buy signals each time the price goes through the line set from the previous day's highest price reached. Looking at stocks reveals four patterns that occur often. See http://www.floatanalysis.com/mag.htm for full article and graph examples. from
FORMULAS FROM SITE VISITORS
Because of the quality of Guppy Trader's Site, I would offer my "J2L trading system", which seems to be very simple but quite efficient : Plot an histogram with the following Period",5,100,50); TSF( CLOSE,period) - LinearReg( CLOSE,period) Buy signal is when plot crosses up the zero line Draw a trigger line between 0 and 0.05 Sell signal is when plot crosses down the trigger line. Enter long : Cross( TSF( CLOSE,opt1) ,LinearReg( CLOSE,opt1)) Close long : Cross( opt2,TSF( CLOSE,opt1) - LinearReg( CLOSE,opt1)) Optimise : Opt1 : 5 to 100 step 1 Opt2 : 0 to 0.05 step 0.1 I did'nt found that Stops improved the equity Try "J2L trading system" , and if you can even improve it more, be kind to send me a mail at : lepreux@noos.fr Jean-Louis Lepreux (from
Paris)
- RSI has been going up for three days - RSI three days ago was higher than lowest RSI in past 14 days - Close of three days ago was lower than lowest close of the prior 14 days will look something like this: {RSI exploration} Ref(RSI(14),0) > Ref(RSI(14),-1) AND Ref(RSI(14),-1) > Ref(RSI(14),-2)AND Ref(RSI(14),-2) > Ref( LLV(RSI(14),14),-3) {Price exploration} AND Ref(CLOSE,-2) < Ref(LLV(CLOSE,14),-3) {or REF(C,-2) = REF(LLV(C,14),-2)}
Period:= Input("What Period",1,250,10); EMA1:= Mov(P,Period,E); EMA2:= Mov(EMA1,Period,E); Difference:= EMA1 - EMA2; ZeroLagEMA:= EMA1 + Difference; ZeroLagEMA To smooth it out further, one may apply it twice with smaller period for the second. But again, you cannot make the lag zero!
colA < colD AND colA < colE AND (ADX(14) > 30) AND (PDI(14) < MDI(14)) AND VOLUME > 5000 AND (Hammer() OR InvBlackHammer() OR InvHammer() OR BullHarami() OR BullHaramiCross() OR DojiStar() OR MorningDojiStar() OR MorningStar() OR ShavenBottom() OR TweezerBottoms()) = 1 With this filter I have about 99 % of stocks rejected. Also, some caution in using ADX in exploration: to have the same value of ADX in exploration and on your chart, you should load the same numbers of days (if you use EOD version). So in the Explorer, you may have to change OPTIONS.
periods:= Input("Periods?",1,63,5); a:= Input("HOT?",-10,2,.000075); e1:= Mov(P,periods,E); e2:= Mov(e1,periods,E); e3:= Mov(e2,periods,E); e4:= Mov(e3,periods,E); e5:= Mov(e4,periods,E); e6:= Mov(e5,periods,E); c1:= -a*a*a; c2:= 3*a*a+3*a-3*a*a*a; c3:= -6*a*a-3*a-3*a*a*a; c4:= 1+3*a+a*a*a+3*a*a; c1*e6+c2*e5+c3*e4+c4*e3;
Col. Col. Name. Col Field ColA. Close c ColB Trigger If(Fml( "DS_EMA_X_MP()" )=1,H+.05, If(Ref( Fml( "DS_EMA_X_MP()" ) ,-1)=1,Ref(H,-1)+.05, If(Ref( Fml( "DS_EMA_X_MP()" ) ,-2)=1,Ref(H,-2)+.05, If(Fml( "DS_EMA_X_MP()" ) =-1,L-.05, If(Ref( Fml( "DS_EMA_X_MP()" ) ,-1)=-1,Ref(L,-1)-.05, If(Ref( Fml( "DS_EMA_X_MP()" ) ,-2)=-1,Ref(L,-2)-.05, 0)))))) ColC Signal If( Fml( "DS_EMA_X_MP()" ) =1,1, If( Fml( "DS_EMA_X_MP()" ) =-1,-1, If(Ref( Fml( "DS_EMA_X_MP()" ) ,-1)=1,2, If(Ref( Fml( "DS_EMA_X_MP()" ) ,-1)=-1,-2, If(Ref( Fml( "DS_EMA_X_MP()" ) ,-2)=1,3, If(Ref( Fml( "DS_EMA_X_MP()" ) ,-2)=-1,-3, 0)))))) Filter: When(v,>=,500000) AND When( ADX(14),>,mov(adx(14),8,e)) AND When(colC<>0)
You would do well to scan only those issues which have a high volume number. The more highly traded a stock the better the chances of a signal resulting in a decent move. I have also added the volume condition and you can insert a condition in the filter stipulating ADX greater than ADXr or some such measure. Paste the above into their respective places in a MS exploration and and it should work fine. I am also giving below the formula for the MA Xover. Paste it into the indictor builder and give it the name I have indicated here. Formula Name: DS_EMA_X_MP() Formula Definition: if ( Cross(mov(mov(mp(),4,e))4,e),mov(mov(mp(),8,e))8,e)),1, if (Cross(mov(mov(mp(),8,e))8,e),mov(mov(mp(),4,e))4,e)),-1, 0))
I have substituted the trendliness and money flow formulae by the volume and ADX() condition.
I have been using the Up/Down Volume Ratio in MetaStock for some time. The easiest way to enter the indicator formula is as:
Sum(If(C>Ref(C,-1),V,0),50)/Sum(If(C<Ref(C,-1),V,0),50).
FORMULAS FROM SITE VISITORS
FORMULAS FROM SITE VISITORS
Here is what I have been using as Relative strength (RSC)Compared to the XAO Column A: CLOSE Column B: If( (Ref(Div(CLOSE,P),-4) > Ref(Mov(Div(C,P),30,E),-4)),1,0) Column C: If( (Ref(Div(CLOSE,P),-3) > Ref(Mov(Div(C,P),30,E),-3)),1,0) Column D: If( (Ref(Div(CLOSE,P),-2) > Ref(Mov(Div(C,P),30,E),-2)),1,0) Column E: If( (Ref(Div(CLOSE,P),-1) > Ref(Mov(Div(C,P),30,E),-1)),1,0) Column F: (( C/P - Mov(C/P,30,E)) / Mov(C/P,30,E)) * 100 Filter: Div(C,P)> Mov(Div(C,P),30,E) AND colB=1 AND colC =1 AND colD = 1 AND colE =1 I name columns B - E period 1, 2, 3, etc. Open The chart of the index you wish to get the relative strength of the securities on make periodicity "Week". In the options area of the exploration editor change to Week. This formula will select securities that have outperform the index over the last 5 weeks. The formula in column F provides a way to rank the securities in terms of their recent performance relative to the index.
N:=Input("Lookback Period", 9, 220, 90); M:=N; {Period used for Momentum Index} SD:=1.5; {Number of Stdev's around FlexPivot} MI:= CMO(C ,M ) / 100; { Momentum Index } MA:= Mov(C, N, S); { Moving Average } FlxP := If( MI > 0, { THEN } MA + (MI * (HHV(C, M) - MA)), { ELSE } MA + (MI * (MA - LLV(C, M))) ); { ENDIF } LBand := FlxP - SD * Stdev(INDICATOR, N); UBand := FlxP + SD * Stdev(INDICATOR, N); UBand; FlxP; LBand;
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)
Substitute any formula for the "RSI(9)" in the above.
ColA: Mov(WillR(19),70,S)-(1.3185 * Stdev(WillR(19),70))
ColB: Mov(WillR(19),70,s)
Filter: Cross(mov(WillR(19),70,s) , Mov(WillR(19),70,S)-(1.3185 * Stdev(WillR(19),70)))
I have written a Dynamic Zone Williams % R indicator that you may find useful. I have converted the Will%R to a +/- 50 oscillator. The formula is:
{DYNAMIC W%R} PR:=Input("Enter Periods for W%R",1,100,14); PB:=Input("Enter Periods for BUY",1,100,20); PS:=Input("Enter Periods for SELL",1,100,20);
{CONVERT W%R TO +/-50 OSC} DWR:=(Mov(WillR(PR),2,S))+50; UpZone:=Mov(DWR,PS,S)+(1.3185 *Stdev(DWR,PS)); LwZone:=Mov(DWR,PB,S)-(1.3185 *Stdev(DWR,PB)); MidZone:=(UpZone + LwZone)/2; MidZone; UpZone; LwZone; DWR
This will plot 3 dynamic zones and a Dynamic Williams%R. To use in an exploration you would need to use the Fml Var call function of the indicator.
EXPLORE THE NUMBER OF NEGATIVE CLOSES AND THE PERCENT LOSS CHANGING THE > WITH < WE HAVE THE POSITIVE DAYS . COL A: BarsSince(C>Ref(C,-1)) {NUMBER OF NEG. DAYS ) COL B: ROC(C, LastValue(BarsSince(C>Ref(C,-1))),%) {PERCENT} From
Col A: RSI(14) Filter colA>=80 Filter enabled Yes Periodicity Daily Records required 18
Here's a simple Metastock exploration for locating Wolf Wave patterns. It doesn't hit all that often, but when it does, it's best to pay attention.
Pa:=Trough(4,LOW,5); Pb:=Peak(3,HIGH,5); P1:=Trough(3,LOW,5); P2:=Peak(2,HIGH,5); P3:=Trough(2,LOW,5); P4:=Peak(1,HIGH,5); P5:=Trough(1,LOW,5); tb:=TroughBars(1,LOW,5); tb<=4 AND p1 > pa AND pb < p2 AND p1 < p2 AND p1 < p4 AND p1 > p3 AND p3 > p5 AND p4 < p2 AND
p1:=Trough(3,LOW,5); p3:=Trough(2,LOW,5); p5:=Trough(1,LOW,5); o1:=p1-p3; o2:=p1-p5; a1:=TroughBars(3,LOW,5)-TroughBars(2,LOW,5); a2:=TroughBars(3,LOW,5)-TroughBars(1,LOW,5); tan1:=o1/a1; tan2:=o2/a2; Abs(tan1-tan2)
colA AND colB <= .2
In the August 1996 STOCKS & COMMODITIES, an article by Thom Hartle titled "The Market Facilitation Index" showed how to color chart bars to identify chart patterns based on changes in the market facilitation index and volume. The first step is to create a new expert by choosing Expert Advisor from MetaStock's Tool menu, and then choose New from the Expert Advisor. Name the expert "Market Facilitation Index," enter any notes you like, and then click on the Highlights tab. Enter the following Highlights by choosing New, choosing the color and then entering the following formulas: Green Bar (Green bar) ROC((H-L)/V,1,$) > 0 AND ROC(V,1,$) > 0 Fade Bar (Blue bar) ROC((H-L)/V,1,$) < 0 AND ROC(V,1,$) < 0 Fake Bar (Dk Gray bar) ROC((H-L)/V,1,$) > 0 AND ROC(V,1,$) < 0 Squat Bar (Red bar) ROC((H-L)/V,1,$) < 0 AND ROC(V,1,$) > 0 After you have entered the four Highlights, click OK to finish editing the expert's properties. You can now right-click on the heading or background of any chart. Next, select Expert Advisor and then Attach from the Chart shortcut menu. Attach the market facilitation index expert, and it will highlight the four market facilitation patterns that were discussed in Hartle's article. Note: You can save a chart as a template with this expert attached, and then any time you apply the template to a chart, the market facilitation index expert will automatically attach to the chart.
http://www.equis.com/ Sender: blackman@hawaii.rr.com
FORMULAS FROM SITE VISITORS
Maurice Odekerken from
Holland m.odekerken@home.nl
Buy Indicators:
TD1:=If(C<Ref(C,-4),1,0); TD2:=If(TD1=1 AND Ref(TD1,-1)=1 AND Ref(TD1,-2)=1 AND Ref(TD1,-3)=1 AND Ref(TD1,-4)=1 AND Ref(TD1,-5)=1 AND Ref(TD1,-6)=1 AND Ref(TD1,-7)=1 AND Ref(TD1,-8)=1, 1,0); TD3:=If(Ref(C,-9)>=Ref(C,-13),1,0); TD4:=If(TD2=1 AND TD3=1,1,0); TD5:=If(H>=Ref(LLV(L,5),-3),1,0); D8:=If(Ref(TD4,1)=1 AND TD5=1,1,0); D9:=If(TD4=1 AND TD5=1 AND Ref(D8,-1)<>1,1,0); D10:=If(Ref(TD4,-1)=1 AND TD5=1 AND Ref(D8,-2)<>1 AND Ref(D9,-1)<>1,1,0); D11:=If(Ref(TD4,-2)=1 AND TD5=1 AND Ref(D8,-3)<>1 AND Ref(D9,-2)<>1 AND Ref(D10,-1)<>1,1,0); D12:=If(Ref(TD4,-3)=1 AND TD5=1 AND Ref(D8,-4)<>1 AND Ref(D9,-3)<>1 AND Ref(D10,-2)<>1 AND Ref(D11,-1)<>1,1,0); D13:=If(Ref(TD4,-4)=1 AND TD5=1 AND Ref(D8,-5)<>1 AND Ref(D9,-4)<>1 AND Ref(D10,-3)<>1 AND Ref(D11,-2)<>1 AND Ref(D12,-1)<>1,1,0); D14:=If(Ref(TD4,-5)=1 AND TD5=1 AND Ref(D8,-6)<>1 AND Ref(D9,-5)<>1 AND Ref(D10,-4)<>1 AND Ref(D11,-3)<>1 AND Ref(D12,-2)<>1 AND Ref(D13,-1)<>1,1,0); D15:=If(Ref(TD4,-6)=1 AND TD5=1 AND Ref(D8,-7)<>1 AND Ref(D9,-6)<>1 AND Ref(D10,-5)<>1 AND Ref(D11,-4)<>1 AND Ref(D12,-3)<>1 AND Ref(D13,-2)<>1 AND Ref(D14,-1)<>1,1,0); D16:=If(Ref(TD4,-7)=1 AND TD5=1 AND Ref(D8,-8)<>1 AND Ref(D9,-7)<>1 AND Ref(D10,-6)<>1 AND Ref(D11,-5)<>1 AND Ref(D12,-4)<>1 AND Ref(D13,-3)<>1 AND Ref(D14,-2)<>1 AND Ref(D15,-1)<>1,1,0); D17:=If(Ref(TD4,-8)=1 AND TD5=1 AND Ref(D8,-9)<>1 AND Ref(D9,-8)<>1 AND Ref(D10,-7)<>1 AND Ref(D11,-6)<>1 AND Ref(D12,-5)<>1 AND Ref(D13,-4)<>1 AND Ref(D14,-3)<>1 AND Ref(D15,-2)<>1 AND Ref(D16,-1)<>1,1,0); SetUp:=D8+D9+D10+D11+D12+D13+D14+D15+D16+D17; SetUp
Cum(If(C<Ref(CLOSE,-2),1,0))-ValueWhen(1,Ref(Fml("TD - SetUp-Buy" ), 1)=1, Cum(If(C<Ref(C,-2),1,0)))
If(Fml("TD Count Down Buy A")>=14 AND C>Ref(C,-4),1,0)
If(Fml("TD Count Down Buy A")>=14 AND C>Ref(H,-2),1,0) Buy Experts: Type / Change in Highlights:
Fml( "TD - SetUp-Buy" ) =1 OR Ref( Fml( "TD - SetUp-Buy" ) ,1)=1 OR Ref( Fml( "TD - SetUp-Buy" ) ,2)=1 OR Ref( Fml( "TD - SetUp-Buy" ) ,3)=1 OR Ref( Fml( "TD - SetUp-Buy" ) ,5)=1 OR Ref( Fml( "TD - SetUp-Buy" ) ,6)=1 OR Ref( Fml( "TD - SetUp-Buy" ) ,7)=1 OR Ref( Fml( "TD - SetUp-Buy" ) ,8)=1
( Fml( "TD Count Down Buy A" ) =13 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 13) OR ( Fml( "TD Count Down Buy A" ) =12 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 12) OR ( Fml( "TD Count Down Buy A" ) =11 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 11) OR ( Fml( "TD Count Down Buy A" ) =10 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 10) OR ( Fml( "TD Count Down Buy A" ) =9 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 9) OR ( Fml( "TD Count Down Buy A" ) =8 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 8) OR ( Fml( "TD Count Down Buy A" ) =7 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 7) OR ( Fml( "TD Count Down Buy A" ) =6 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<>6) OR ( Fml( "TD Count Down Buy A" ) =5 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 5) OR ( Fml( "TD Count Down Buy A" ) =4 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 4) OR ( Fml( "TD Count Down Buy A" ) =3 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<>3) OR ( Fml( "TD Count Down Buy A" ) =2 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<>2)
( Fml( "TD Count Down Buy A" ) =14 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 14)
A:=If( Fml( "TD Count Down Buy A" ) =14 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 14,1,0); B:=If( Ref(Fml( "TD Count Down Buy B" ),-1) =1,1,0); HighestSinceBars(1,A =1,A )<HighestSinceBars(1,B=1,B ) AND Fml( "TD Count Down Buy B" ) =1
A:=If( Fml( "TD Count Down Buy A" ) =14 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 14,1,0); B:=If( Ref(Fml( "TD Count Down Buy C" ),-1) =1,1,0); HighestSinceBars(1,A =1,A )<HighestSinceBars(1,B=1,C ) AND Fml( "TD Count Down Buy C" ) =1 Type / Change in Symbols:
Fml( "TD - SetUp-Buy" )=1
Ref( Fml( "TD - SetUp-Buy" ),1)=1
Ref( Fml( "TD - SetUp-Buy" ) ,2)=1
Ref( Fml( "TD - SetUp-Buy" ) ,3)=1
Ref( Fml( "TD - SetUp-Buy" ) ,4)=1
Ref( Fml( "TD - SetUp-Buy" ) ,5)=1
Ref( Fml( "TD - SetUp-Buy" ) ,6)=1
Ref( Fml( "TD - SetUp-Buy" ) ,7)=1
Ref( Fml( "TD - SetUp-Buy" ) ,8)=1
Fml( "TD Count Down Buy A" ) =2 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<>2
Fml( "TD Count Down Buy A" ) =3 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 3
Fml( "TD Count Down Buy A" ) =4 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 4
Fml( "TD Count Down Buy A" ) =5 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 5
Fml( "TD Count Down Buy A" ) =6 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 6
Fml( "TD Count Down Buy A" ) =7 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 7
Fml( "TD Count Down Buy A" ) =8 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 8
Fml( "TD Count Down Buy A" ) =9 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 9
Fml( "TD Count Down Buy A" ) =10 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 10
Fml( "TD Count Down Buy A" ) =11 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 11
Fml( "TD Count Down Buy A" ) =12 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 12
Fml( "TD Count Down Buy A" ) =13 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 13
Fml( "TD Count Down Buy A" ) =14 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 14
A:=If( Fml( "TD Count Down Buy A" ) =14 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 14,1,0); B:=If( Ref(Fml( "TD Count Down Buy B" ),-1) =1,1,0); HighestSinceBars(1,A =1,A )<HighestSinceBars(1,B=1,B ) AND Fml( "TD Count Down Buy B" ) =1
A:=If( Fml( "TD Count Down Buy A" ) =14 AND Ref( Fml( "TD Count Down Buy A" ) ,-1 )<> 14,1,0); B:=If( Ref(Fml( "TD Count Down Buy C" ),-1) =1,1,0); HighestSinceBars(1,A =1,A )<HighestSinceBars(1,B=1,C ) AND Fml( "TD Count Down Buy C" ) =1
Sell Indicators:
TD1:=If(C>Ref(C,-4),1,0); TD2:=If(TD1=1 AND Ref(TD1,-1)=1 AND Ref(TD1,-2)=1 AND Ref(TD1,-3)=1 AND Ref(TD1,-4)=1 AND Ref(TD1,-5)=1 AND Ref(TD1,-6)=1 AND Ref(TD1,-7)=1 AND Ref(TD1,-8)=1, 1,0); TD3:=If(Ref(C,-9)<=Ref(C,-13),1,0); TD4:=If(TD2=1 AND TD3=1,1,0); TD5:=If(L>=Ref(HHV(H,5),-3),1,0); D8:=If(Ref(TD4,1)=1 AND TD5=1,1,0); D9:=If(TD4=1 AND TD5=1 AND Ref(D8,-1)<>1,1,0); D10:=If(Ref(TD4,-1)=1 AND TD5=1 AND Ref(D8,-2)<>1 AND Ref(D9,-1)<>1,1,0); D11:=If(Ref(TD4,-2)=1 AND TD5=1 AND Ref(D8,-3)<>1 AND Ref(D9,-2)<>1 AND Ref(D10,-1)<>1,1,0); D12:=If(Ref(TD4,-3)=1 AND TD5=1 AND Ref(D8,-4)<>1 AND Ref(D9,-3)<>1 AND Ref(D10,-2)<>1 AND Ref(D11,-1)<>1,1,0); D13:=If(Ref(TD4,-4)=1 AND TD5=1 AND Ref(D8,-5)<>1 AND Ref(D9,-4)<>1 AND Ref(D10,-3)<>1 AND Ref(D11,-2)<>1 AND Ref(D12,-1)<>1,1,0); D14:=If(Ref(TD4,-5)=1 AND TD5=1 AND Ref(D8,-6)<>1 AND Ref(D9,-5)<>1 AND Ref(D10,-4)<>1 AND Ref(D11,-3)<>1 AND Ref(D12,-2)<>1 AND Ref(D13,-1)<>1,1,0); D15:=If(Ref(TD4,-6)=1 AND TD5=1 AND Ref(D8,-7)<>1 AND Ref(D9,-6)<>1 AND Ref(D10,-5)<>1 AND Ref(D11,-4)<>1 AND Ref(D12,-3)<>1 AND Ref(D13,-2)<>1 AND Ref(D14,-1)<>1,1,0); D16:=If(Ref(TD4,-7)=1 AND TD5=1 AND Ref(D8,-8)<>1 AND Ref(D9,-7)<>1 AND Ref(D10,-6)<>1 AND Ref(D11,-5)<>1 AND Ref(D12,-4)<>1 AND Ref(D13,-3)<>1 AND Ref(D14,-2)<>1 AND Ref(D15,-1)<>1,1,0); D17:=If(Ref(TD4,-8)=1 AND TD5=1 AND Ref(D8,-9)<>1 AND Ref(D9,-8)<>1 AND Ref(D10,-7)<>1 AND Ref(D11,-6)<>1 AND Ref(D12,-5)<>1 AND Ref(D13,-4)<>1 AND Ref(D14,-3)<>1 AND Ref(D15,-2)<>1 AND Ref(D16,-1)<>1,1,0); SetUp:=D8+D9+D10+D11+D12+D13+D14+D15+D16+D17; SetUp
Cum(If(C>Ref(C,-2),1,0))-ValueWhen(1,Ref( Fml( "TD - SetUp-Sell" ), 1)=1, Cum(If(C>Ref(C,-2),1,0)))
If(Fml( "TD Count Down Sell A" )>=14 AND C<Ref(C,-4),1,0)
If(Fml( "TD Count Down Sell A" )>=14 AND C<Ref(H,-2),1,0) Sell Experts: Type / Change in Highlights:
Fml( "TD - SetUp-Sell" ) =1 OR Ref( Fml( "TD - SetUp-Sell" ) ,1)=1 OR Ref( Fml( "TD - SetUp-Sell" ) ,2)=1 OR Ref( Fml( "TD - SetUp-Sell" ) ,3)=1 OR Ref( Fml( "TD - SetUp-Sell" ) ,4)=1 OR Ref( Fml( "TD - SetUp-Sell" ) ,5)=1 OR Ref( Fml( "TD - SetUp-Sell" ) ,6)=1 OR Ref( Fml( "TD - SetUp-Sell" ) ,7)=1 OR Ref( Fml( "TD - SetUp-Sell" ) ,8)=1
( Fml( "TD Count Down Sell A" ) =13 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<> 13) OR ( Fml( "TD Count Down Sell A" ) =12 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<> 12) OR ( Fml( "TD Count Down Sell A" ) =11 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<> 11) OR ( Fml( "TD Count Down Sell A" ) =10 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<> 10) OR ( Fml( "TD Count Down Sell A" ) =9 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<> 9) OR ( Fml( "TD Count Down Sell A" ) =8 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<> 8) OR ( Fml( "TD Count Down Sell A" ) =7 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<> 7) OR ( Fml( "TD Count Down Sell A" ) =6 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<> 6) OR ( Fml( "TD Count Down Sell A" ) =5 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<> 5) OR ( Fml( "TD Count Down Sell A" ) =4 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<> 4) OR ( Fml( "TD Count Down Sell A" ) =3 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<> 3) OR ( Fml( "TD Count Down Sell A" ) =2 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<> 2)
( Fml( "TD Count Down Sell A" ) =14 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<> 14)
A:=If( Fml( "TD Count Down Sell A" ) =14 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<> 14,1,0); B:=If( Ref(Fml( "TD Count Down Sell B" ),-1) =1,1,0); HighestSinceBars(1,A =1,A )<HighestSinceBars(1,B=1,B ) AND Fml( "TD Count Down Sell B" ) =1
A:=If( Fml( "TD Count Down Sell A" ) =14 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<> 14,1,0); B:=If( Ref(Fml( "TD Count Down Sell C" ),-1) =1,1,0); HighestSinceBars(1,A =1,A )<HighestSinceBars(1,B=1,C ) AND Fml( "TD Count Down Sell C" ) =1
Fml( "TD - SetUp-Sell" )=1
Ref( Fml( "TD - SetUp-Sell" ),1)=1
Ref( Fml( "TD - SetUp-Sell" ),2)=1
Ref( Fml( "TD - SetUp-Sell" ),3)=1
Ref( Fml( "TD - SetUp-Sell" ),4)=1
Ref( Fml( "TD - SetUp-Sell" ),5)=1
Ref( Fml( "TD - SetUp-Sell" ),6)=1
Ref( Fml( "TD - SetUp-Sell" ),7)=1
Ref( Fml( "TD - SetUp-Sell" ),8)=1
Fml( "TD Count Down Sell A" ) =2 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<>2
Fml( "TD Count Down Sell A" ) =3 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<>3
Fml( "TD Count Down Sell A" ) =4 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<>4
Fml( "TD Count Down Sell A" ) =5 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<>5
Fml( "TD Count Down Sell A" ) =6 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<>6
Fml( "TD Count Down Sell A" ) =7 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<>7
Fml( "TD Count Down Sell A" ) =8 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<>8
Fml( "TD Count Down Sell A" ) =9 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<>9
Fml( "TD Count Down Sell A" ) =10 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<>10
Fml( "TD Count Down Sell A" ) =11 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<>11
Fml( "TD Count Down Sell A" ) =12 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<>12
Fml( "TD Count Down Sell A" ) =13 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<>13
Fml( "TD Count Down Sell A" ) =14 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<>14
A:=If( Fml( "TD Count Down Sell A" ) =14 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<> 14,1,0); B:=If( Ref(Fml( "TD Count Down Sell B" ),-1) =1,1,0); HighestSinceBars(1,A =1,A )<HighestSinceBars(1,B=1,B ) AND Fml( "TD Count Down Sell B" ) =1
A:=If( Fml( "TD Count Down Sell A" ) =14 AND Ref( Fml( "TD Count Down Sell A" ) ,-1 )<> 14,1,0); B:=If( Ref(Fml( "TD Count Down Sell C" ),-1) =1,1,0); HighestSinceBars(1,A =1,A )<HighestSinceBars(1,B=1,C ) AND Fml( "TD Count Down Sell C" ) =1
ColA: md := MACD(); mdhist := md - Mov(md,9,E); Correl(((Sum(Cum(1)*( mdhist ),100))-(Sum(Cum(1),100)* Sum(( mdhist ),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) Filter Column: colA and colA <-0.8 The above formula can also be combined with a volatility buy signal and a volume signal. The following addition is then made. ColB: The volatility buy signal H > Ref(C,-1) + 1.8 * Ref( ATR(10),-1) ColC: Volume 10% above the average of the previous 10 days V > 1.1 * Ref( Mov(V,10,E),-1) Filter Column: colA AND colB AND colC AND colA <-0.80 Initial tests with this system have been encouraging.
http://www.fib-charting.it/ 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
Periods:=Input("periods",1,260,100); Topbox:=If(Ref(H,-3)>=Ref(HHV(H,Periods),-4) AND Ref(H,-2)<Ref(H,-3) AND Ref(H,-1)<Ref(H,-3) AND H< Ref(H,-3),Ref(H,-3),PREVIOUS); Botbox:=If(Ref(H,-3)>=Ref(HHV(H,Periods),-4) AND Ref(H,-2)<Ref(H,-3) AND Ref(H,-1)<Ref(H,-3) AND H< Ref(H,-3),LLV(L,4),PREVIOUS); Botbox; Topbox; |