log in     sign up for free
 
You can't make money if you're not willing to lose. It's like breathing in, but not being willing to breathe out. Various types of exits will help you do this (i.e., breathe fully), including trailing stops and the percent retracement stop.
Van K. Tharp
 
 
Home
systems (284)
 
Special offer: buy AmiBroker and EOD+Real-Time Data
 

Buy

MetaStock

     (special offer)
 
 
 

Buy

EOD data for MetaStock

     (special offer)
 
 
 

Buy

Realtime data for MetaStock

     (special offer)
 
 
 
Formula Library
 
AmiBroker
MetaTrader
MetaStock
TradeStation
Wealth-Lab
NinjaTrader
 
add your formula
System Library
 
 
Account login
Your email:
Password:
 
Log in
New to s4t? Sign up.
If you forgot your password click here.
Search the Web
 
Custom Search

Triple MA I Exploration

Formula for: MetaStock

expert advisor


 

 

Views:  1502

Added: May 18, 2008
 
Rate this code:  Rate: 1 Rate: 2 Rate: 3 Rate: 4 Rate: 5
This formula has not been rated yet
 

email this link

 
 
Tags: MetaStock, expert advisor
 
Your Ad Here


_Triple MA
ShortTime := 25;
MediumTime := 75;
LongTime := 200;
ShortMA := Mov(CLOSE, ShortTime, S);
MediumMA := Mov(CLOSE, MediumTime, S);
LongMA := Mov(CLOSE, LongTime, S);
ShortMA; MediumMA; LongMA;






_Triple MA Crossovers
Sma := FmlVar("_Triple MA","ShortMA");
Mma := FmlVar("_Triple MA","MediumMA");
Lma := FmlVar("_Triple MA","LongMA");
LongSignal := Cross(Sma, Mma) AND Lma > Mma;
ShortSignal := Cross(Mma, Sma) AND Lma < Mma;





_Triple MA Positions
BuyLong := FmlVar("_Triple MA Crossovers", "LongSignal");
SellShort := FmlVar("_Triple MA Crossovers", "ShortSignal");

If(
BarsSince(Ref(BuyLong,-1)) <= BarsSince(Ref(SellShort,-1)), +1,
If(
BarsSince(Ref(SellShort,-1)) <= BarsSince(Ref(BuyLong,-1)), -1,0)
);





_Triple MA Equity
Cum(
Cum(
If(
FmlVar("_Triple MA Crossovers","LongSignal")= 1,
OPEN-Ref(OPEN,-1),
If(FmlVar("_Triple MA Crossovers","ShortSignal")=-1,
-1 * OPEN-Ref(OPEN,-1),0
)
)
)
)



_Triple MA I Exploration

ColA: FmlVar("_Triple MA","ShortMA")

ColB: FmlVar("_Triple MA","MediumMA")

ColC: FmlVar("_Triple MA","LongMA")

ColD: ((HHV(C,250)-LLV(C,250))/LLV(C,250))*100

ColE: Fml("_Triple MA Equity")

Filter: colD > 100 AND colD < 300 AND CLOSE > 5.00

 

 



Code:

TEST OF INDICATORS BASED ON OTHER INDICATORS


Now, you can create an Exploration with INDICATOR4 as one of the columnsand quickly see the equity performance across your portfolio of stocks. Then, you can change "Length:=17;" to 18 or 20 in INDICATOR1, and run the exploration again to get the results for that value. You can repeat thisfor as many values as you like. (I copy the exploration results into Excelto do my summary statistics).

The first indicator is


_Triple MA
ShortTime := 25;
MediumTime := 75;
LongTime := 200;
ShortMA := Mov(CLOSE, ShortTime, S);
MediumMA := Mov(CLOSE, MediumTime, S);
LongMA := Mov(CLOSE, LongTime, S);
ShortMA; MediumMA; LongMA;




Next is :



_Triple MA Crossovers
Sma := FmlVar("_Triple MA","ShortMA");
Mma := FmlVar("_Triple MA","MediumMA");
Lma := FmlVar("_Triple MA","LongMA");
LongSignal := Cross(Sma, Mma) AND Lma > Mma;
ShortSignal := Cross(Mma, Sma) AND Lma < Mma;




Then comes :



_Triple MA Positions
BuyLong := FmlVar("_Triple MA Crossovers", "LongSignal");
SellShort := FmlVar("_Triple MA Crossovers", "ShortSignal");

If(
BarsSince(Ref(BuyLong,-1)) <= BarsSince(Ref(SellShort,-1)), +1,
If(
BarsSince(Ref(SellShort,-1)) <= BarsSince(Ref(BuyLong,-1)), -1,0)
);



And lastly,


_Triple MA Equity
Cum(
Cum(
If(
FmlVar("_Triple MA Crossovers","LongSignal")= 1,
OPEN-Ref(OPEN,-1),
If(FmlVar("_Triple MA Crossovers","ShortSignal")=-1,
-1 * OPEN-Ref(OPEN,-1),0
)
)
)
)







I've plotted the _Triple MA and set the 3 colours and saved that as a template. Plotting the Positions indicator produces a horizontal line at 1 when I'm long, -1 when short and zero when out. That's as I think it should be. The Equity indicator, when applied to the price bars, produces a stepping pattern that's horizontal until it steps vertically up or down to another location, then horizontal again. This doesn't seem right to me.

The Exploration:



_Triple MA I Exploration

ColA: FmlVar("_Triple MA","ShortMA")

ColB: FmlVar("_Triple MA","MediumMA")

ColC: FmlVar("_Triple MA","LongMA")

ColD: ((HHV(C,250)-LLV(C,250))/LLV(C,250))*100

ColE: Fml("_Triple MA Equity")

Filter: colD > 100 AND colD < 300 AND CLOSE > 5.00




Running this Exploration on the TSE produces a report where ColE ranges from -1331.80 to 17.95. Does this mean that, using this Triple MA indicator, and buying/selling when the crossovers hit, the best stock earned $17.95 over the history (5 years) and the worst stock lost $1,331.80?

from Bill Irwin

 





Source: http://purebytes.com/archives/metastock/

 

View similar (expert advisor for MetaStock):

%Bands II
Combining Statistical & Pattern Analysis, Shark-32
Double Stochastics Expert
Ehlers Distant Coefficient Filter
Dunnigan Trend
Smoothed Stochastic Expert
Bull Fear and Bear Fear Expert
Dynamic Moving Vertical Lines
Chande's Long Bomb Expert
Squelch Threshold
...
 
 
all formulas for MetaStock
all formulas

 

 

Email to friend

Top

 

     
However we try to maintain hiqhest possible level of service - most formulas, oscillators, indicators
and systems are submitted by anonymous users.
Therefore S4T™ does not take any responsibility for it's quality.
If you use any of this information, use it at your own risk. You are responsible for your own trading decisions.
Be sure to verify that any information you see on these pages is correct, and is applicable to your particular trade.
In no case will S4T™ be responsible for your trading gains or losses.
 
Privacy note | (c) copyrights systems4trading.com 2006-2012