PureBytes Links
Trading Reference Links
|
<x-html><HTML>
<TT>Members,</TT><TT></TT>
<P><TT>Quite often there have been questions as to "what</TT>
<BR><TT>to do" with an indicator.</TT><TT></TT>
<P><TT>I am a great believer in the KISS principle. For</TT>
<BR><TT>this reason I am including below a SYSTEM which</TT>
<BR><TT>will demonstrate a reasonable capability of profit</TT>
<BR><TT>using only a Moving Average (delayed if desired) and</TT>
<BR><TT>the direction of the last two closes OR a Z score</TT>
<BR><TT>computation using positive numbers to go long and</TT>
<BR><TT>negative numbers to go short.</TT><TT></TT>
<P><TT>THERE IS NO REVERSAL IN THIS SYSTEM.</TT><TT></TT>
<P><TT>An exit must be taken from a trade before another</TT>
<BR><TT>trade can be entered. The exit can be by virture</TT>
<BR><TT>of the lapse of some number of days, the reaching</TT>
<BR><TT>of some profit objective, falling through some loss</TT>
<BR><TT>criteria, or pulling back a certain amount from the</TT>
<BR><TT>highest high or lowest low of a trade.</TT><TT></TT>
<P><TT>USE THIS SYSTEM AS A TRAINING EXERCISE TO SEE JUST</TT>
<BR><TT>HOW THESE EXITS INFLUNCE THE PROFITABILITY OF A</TT>
<BR><TT>TRADE.</TT><TT></TT>
<P><TT>To start with -- using the OEX cash from 2/11/88 to</TT>
<BR><TT>now -- set the following parameters</TT>
<BR><TT></TT> <TT></TT>
<P><TT>MODE
1 2</TT>
<BR><TT>LENGTH 10
10</TT>
<BR><TT>OFFSET .5
.5</TT>
<BR><TT>EXITDAYS 0
0</TT>
<BR><TT>EXITPROF 4.5
4.25</TT>
<BR><TT>DOLENTST 2
3</TT>
<BR><TT>PULLBMUL 3
3</TT>
<BR><TT>MOONDAYS 11
9</TT>
<BR><TT>BEGDATE 650101 650101</TT>
<BR><TT>ENDDATE 991231 991231</TT>
<BR><TT></TT> <TT></TT>
<P><TT>This really is a simple system and can provide</TT>
<BR><TT>a model for more exotic systems.</TT><TT></TT>
<P><TT>I hope you will try this and let all of us know</TT>
<BR><TT>what success you have had in your simulations.</TT>
<BR><TT></TT> <TT></TT>
<P><TT>Clyde</TT><TT></TT>
<P><TT>PS: THERE is an INDICATOR called EQUITY which</TT>
<BR><TT> will show profitable zones in green, loss</TT>
<BR><TT> zones in red and flat zones in grey.</TT><TT></TT>
<P><TT> I like to see this on systems.</TT>
<BR><TT></TT>
<BR><TT></TT> <TT></TT>
<P><TT>SYSTEM CODE STARTS BELOW -- SAME AS ATTACHED .ELA</TT>
<BR><TT></TT>
<BR><TT></TT>
<BR><TT></TT>
<BR><TT></TT> <TT></TT>
<P><TT>{</TT>
<BR><TT> System MovingAvg DisplacedP</TT><TT></TT>
<P><TT> Written by:</TT>
<BR><TT> Clyde Lee (FuturesMagic) Copyright (c) 1997</TT>
<BR><TT> clydelee@xxxxxxx</TT><TT></TT>
<P><TT> MODE 1:</TT>
<BR><TT> Go LONG on next bar when closing price exceeds the MOVA value
and</TT>
<BR><TT> last two closing prices are greater than the respective previous</TT>
<BR><TT> closing prices.</TT><TT></TT>
<P><TT> Go SHORT when closing price is less than the MOVA value and
the last</TT>
<BR><TT> two closing prices are less than the respective previous
closing prices.</TT><TT></TT>
<P><TT> MODE 2:</TT>
<BR><TT> Go LONG on next bar when ZScore (Variable11) is above
zero.</TT>
<BR><TT> Go SHORT on next bar when ZScore (Variable11) is below zero.</TT>
<BR><TT> </TT><TT></TT>
<P><TT> There is NO reversal of trades. Only when the system
is in a 'FLAT'</TT>
<BR><TT> position will an entry occur.</TT><TT></TT>
<P><TT> The MOVA value can be the MOVA value at some specified offset
prior</TT>
<BR><TT> to current time. If this offset is specified as a value
< 1 then the</TT>
<BR><TT> applied value is a multiple of the period selected for the
MOVA length.</TT>
<BR><TT> If the offset value is greater than one then the offset is
in bars.</TT><TT></TT>
<P><TT> Whether an entry is taken or not can be a function of whether
the</TT>
<BR><TT> moon is in the new or full phase and for how many days in
the</TT>
<BR><TT> selected phase a trade can be entered. THE CHOICE OF
MOON HAS</TT>
<BR><TT> NO EFFECT ON WHEN TO EXIT A TRADE. The moon parameter
is specified</TT>
<BR><TT> as xxYY where xx=beginning day of phase
and YY=last day of phase.</TT><TT></TT>
<P><TT> If the value of this parameter is negative then long entries
are taken</TT>
<BR><TT> during the full moon phase and short entries taken during
the new moon</TT>
<BR><TT> phase. For positive numbers long trades are taken during
the days</TT>
<BR><TT> which follow the new moon.</TT><TT></TT>
<P><TT> The system can be setup to execute trades only between certain
dates</TT>
<BR><TT> and can be forced to close all positions on the last bar
of the chart.</TT><TT></TT>
<P><TT> Exit choices (combinations allowed) are:</TT>
<BR><TT> 1. Exit on close when N days have elapsed regardless of
profit/loss.</TT>
<BR><TT> 2. Exit at a price which will yield a certain profit.
The profit</TT>
<BR><TT> can be specified in DOLLARS or some multiple of the
ATR(14).</TT>
<BR><TT> 3. Money Management stop some number of DOLLARS or some
multiple</TT>
<BR><TT> of the ATR(14) away from the entry price for a trade.</TT>
<BR><TT> 4. Exit at a price which is some amount below the highest
high</TT>
<BR><TT> for a LONG trade or above the lowest low for a short
trade</TT>
<BR><TT> that was achieved in the trade. The amount above/below
is</TT>
<BR><TT> a function of the amount specified for the money management</TT>
<BR><TT> stop. The amount below/above is specified as
a multiple of</TT>
<BR><TT> the MM stop amount.</TT>
<BR><TT></TT> <TT></TT>
<P><TT> The purpose of this system and it's description is ONLY FOR</TT>
<BR><TT> EDUCATIONAL PURPOSE AND ANY APPARENT RECOMMENDATIONS WHICH
DERIVE</TT>
<BR><TT> FROM EXECUTION OF THIS SYSTEM UNDER OMEGA SUPERCHARTS(R)
OR</TT>
<BR><TT> TRADESTATION(R) ARE STRICTLY TO SHOW WHAT THE INCLUDED ALGORITHMS</TT>
<BR><TT> WOULD INDICATE UNDER CERTAIN MARKET CONDITIONS.</TT>
<BR><TT></TT> <TT></TT>
<P><TT>$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$</TT>
<BR><TT>}</TT><TT></TT>
<P><TT>inputs: Mode(1),
{mode of trading 1=MOVA 2=ZScore}</TT>
<BR><TT>
Length(10), {Length for MOVA/ZScore
to compute}</TT>
<BR><TT>
OFFSET(.5), {Delay>=1 or Multiplier<1
of Length for Delay}</TT>
<BR><TT>
ExitDays(0), {Exit after n days in trade
}</TT>
<BR><TT>
ExitProf(4.5), {Exit if Profit>ExitProf <50=n*ATR(14)}</TT>
<BR><TT>
DolEntSt(2), {Money Management stop days
after Day 1}</TT>
<BR><TT>
{>50 = $$$ <50 = N*ATR(14)}</TT>
<BR><TT>
PullBMul(3), {Multiplier of DolEntSt for
Pullback exit}</TT>
<BR><TT>
MoonDays(0111), {Number of days in each moon phase to buy/sell}</TT>
<BR><TT>
{xxYY xx=begin date YY=end date}</TT>
<BR><TT>
{+=BUY IN NEW MOON PHASE -=BUY IN FULL PHASE}</TT>
<BR><TT>
BegDate(650101), {FIRST DATE TO USE IN SIMULATION}</TT>
<BR><TT>
EndDate(991231); {LAST DATE TO USE IN SIMULATION}</TT>
<BR><TT>
{If last date = 999999 - close on last date}</TT><TT></TT>
<P><TT>Vars: MaxProf(0),BegMoon(0),EndMoon(0),</TT>
<BR><TT> HiNTra(H), LoNTra(L),
Init(0);</TT><TT></TT>
<P><TT>IF Init=0 then begin</TT>
<BR><TT> BegMoon = IntPortion(AbsValue(MoonDays)/100);</TT>
<BR><TT> EndMoon = IntPortion(AbsValue(MoonDays)-BegMoon*100);</TT>
<BR><TT> Init=1;</TT>
<BR><TT>End;</TT>
<BR><TT></TT> <TT></TT>
<P><TT>If (LastBarOnChart=True and EndDate=999999) or Date>=EndDate
then begin</TT><TT></TT>
<P><TT> If marketposition = 1 then exitlong ;</TT>
<BR><TT> If marketposition = -1 then exitshort;</TT><TT></TT>
<P><TT>End</TT>
<BR><TT>Else If Date >= BegDate then begin</TT>
<BR><TT> If Mode=1 then begin</TT>
<BR><TT> {Value11 = LEEXHL2CLO(LENGTH);}</TT>
<BR><TT> If Offset < 1 then</TT>
<BR><TT> Value11 = Average(C,LENGTH)[LENGTH*OFFSET]</TT>
<BR><TT> Else</TT>
<BR><TT> Value11 = Average(C,LENGTH)[OFFSET];</TT>
<BR><TT> End</TT>
<BR><TT> Else If mode=2 then begin</TT>
<BR><TT> Value11 = log(C) - log(C[1]);</TT>
<BR><TT> Value11 = SquareRoot(Length)*(Value11 - Average(Value11,Length))</TT>
<BR><TT> /(StdDev(Value11,Length)+.001);</TT>
<BR><TT> End;</TT>
<BR><TT></TT> <TT></TT>
<P><TT> If MarketPosition=0 then begin</TT><TT></TT>
<P><TT> If mode = 1 then begin</TT>
<BR><TT> Condition1= c>c[1] and c[1]>c[2] and C>Value11;</TT>
<BR><TT> Condition2= c<c[1] and c[1]<c[2] and C<Value11;</TT>
<BR><TT> End</TT>
<BR><TT> Else begin</TT>
<BR><TT> Condition1= Value11>0;</TT>
<BR><TT> Condition2= Value11<0;</TT>
<BR><TT> End;</TT><TT></TT>
<P><TT> Value1=MoonPhas;</TT>
<BR><TT> If MoonDays>0 then begin</TT>
<BR><TT> If Value1>EndMoon or Value1<BegMoon
then Condition1=false;</TT>
<BR><TT> If Value1>EndMoon+14 or Value1<BegMoon+15 then
Condition2=false;</TT>
<BR><TT> End;</TT>
<BR><TT> If MoonDays<0 then begin</TT>
<BR><TT> If Value1>EndMoon or Value1<BegMoon
then Condition2=false;</TT>
<BR><TT> If Value1>EndMoon+14 or Value1<BegMoon+15 then
Condition1=false;</TT>
<BR><TT> End;</TT><TT></TT>
<P><TT> If Condition1 then Buy ("lRSIen") at c limit;</TT>
<BR><TT> If Condition2 then Sell ("sRSIen") at c limit;</TT><TT></TT>
<P><TT> HiNTra=H;LoNTra=L;</TT><TT></TT>
<P><TT> End;</TT>
<BR><TT></TT> <TT></TT>
<P><TT> If EntryPrice>0 then begin</TT>
<BR><TT> </TT>
<BR><TT> If mode=1 then begin</TT>
<BR><TT> If c<Value1 then ExitLong ("mvxl") at c limit;</TT>
<BR><TT> If c>Value1 then ExitShort ("mvxs") at c limit;</TT>
<BR><TT> End;</TT><TT></TT>
<P><TT> If ExitDays>0 then begin</TT>
<BR><TT> If BarsSinceEntry>=ExitDays then begin;</TT>
<BR><TT> ExitLong ("lxtim") at close;</TT>
<BR><TT> ExitShort ("sxtim") at close;</TT>
<BR><TT> End;</TT>
<BR><TT> End;</TT><TT></TT>
<P><TT> If ExitProf>0 then begin</TT>
<BR><TT> If ExitProf<50 then MaxProf=ExitProf*AvgTrueRange(14)</TT>
<BR><TT> else MaxProf=ExitProf/BigPointValue;</TT>
<BR><TT> ExitLong ("lxmxp") at EntryPrice + MaxProf limit;</TT>
<BR><TT> ExitShort ("sxmxp") at EntryPrice - MaxProf limit;</TT>
<BR><TT> End;</TT><TT></TT>
<P><TT> If DolEntSt<>0 then begin</TT>
<BR><TT> If DolEntSt>=50 then Value1 = DolEntSt / BigPointValue</TT>
<BR><TT> else Value1 =
DolEntSt * AvgTrueRange(14);</TT>
<BR><TT> If MarketPosition>0 then begin</TT>
<BR><TT> Value3 = EntryPrice - Value1;</TT>
<BR><TT> If H>HiNTra then HiNTra=H;</TT>
<BR><TT> Value4 = HiNTra - Value1 * PullBMul;</TT>
<BR><TT> If Value3>Value4 then ExitLong ("lxex")
at Value3 stop</TT>
<BR><TT> else ExitLong
("tplx") at Value4 stop ;</TT>
<BR><TT> End</TT>
<BR><TT> Else begin</TT>
<BR><TT> Value5 = EntryPrice + Value1;</TT>
<BR><TT> If L<LoNTra then LoNTra=L;</TT>
<BR><TT> Value6 = LoNTra + Value1 * PullBMul;</TT>
<BR><TT> If Value5<Value6 then ExitShort
("sxex") at Value5 stop</TT>
<BR><TT> else ExitShort
("tpsx") at Value6 stop ;</TT>
<BR><TT> End;</TT>
<BR><TT> End;</TT>
<BR><TT> </TT>
<BR><TT> End;</TT><TT></TT>
<P><TT>End;</TT>
<BR><TT></TT>
<BR><TT></TT> <TT></TT>
<P><TT>START OF CODE FOR EQUITY INDICATOR</TT><TT></TT>
<P><TT>{ *******************************************************************</TT>
<BR><TT> </TT>
<BR><TT> Study : Equity</TT>
<BR><TT> </TT>
<BR><TT> Last Edit : 10/19/96</TT><TT></TT>
<P><TT> Provided By : Clyde Lee (c) Copyright 1996</TT><TT></TT>
<P><TT>********************************************************************}</TT><TT></TT>
<P><TT>If CurrentBar>2 then begin</TT>
<BR><TT> If I_OpenEquity> I_ClosedEquity then begin</TT>
<BR><TT> Plot1(I_OpenEquity, "OpenEq");</TT>
<BR><TT> End</TT>
<BR><TT> Else If I_OpenEquity< I_ClosedEquity then begin</TT>
<BR><TT> Plot2(I_OpenEquity, "OpenEq");</TT>
<BR><TT> End</TT>
<BR><TT> Else begin</TT>
<BR><TT> {If Value1=I_ClosedEquity then} Plot3(I_ClosedEquity, "same");</TT>
<BR><TT> End;</TT>
<BR><TT>End;</TT>
<BR><TT>Value1=I_OpenEquity;</TT>
<BR><TT></TT> </HTML>
</x-html>
Attachment Converted: "c:\eudora\attach\vcard155.vcf"
|