PureBytes Links
Trading Reference Links
|
<SPAN
lang=EN-US><?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" /><FONT
size=2>I do not use
the system tester available in MetaStock; I prefer to build custom
indicators to return entry and exit conditions <SPAN
class=678595608-21082003>and derived cumulative
equity.
<SPAN
class=678595608-21082003><FONT face=Arial color=#000000
size=2>
<SPAN
class=678595608-21082003>The following is
a cut down sample of the type of code that will provide you with a trailing stop
that latches ON at the start of a trade, follows the trade (adjusting daily) and
reverts to zero on exit, awaiting the next entry
signal.
<SPAN
class=678595608-21082003><FONT face=Arial color=#000000
size=2>
<SPAN
class=678595608-21082003>Fml("LONGALERT")
can be any vaild set up condition; entry price trigger in example assumes that
you enter at or above the HIGH on the day following your set up condition. You
will need to fill in your values for EntryPCT and
DailyPCT.
<SPAN
class=678595608-21082003><FONT face=Arial color=#000000
size=2>
<SPAN
class=678595608-21082003>The indicator
returns:
<FONT
face=Arial color=#000000 size=2>a) the adjusted value of the trailing stop for
every day that the stop is not breached;
<FONT
face=Arial color=#000000 size=2>b) (-ve) the adjusted value of the trailing stop
on the day of exit;
<FONT
color=#000000>c) zero when not in a trade<SPAN
class=678595608-21082003>.
<FONT
color=#000000><SPAN
class=678595608-21082003>
<FONT
color=#000000>If
you want to plot this an indicator on a chart, suggest you create a separate
formula that returns the TrailingStop value when >0 and LOW when <=0 to
overcome scaling problems.
<FONT
face=Arial color=#000000 size=2>
<FONT
face=Arial><SPAN
class=678595608-21082003> {yesterday
set-up?}
<FONT
face=Arial><SPAN
class=678595608-21082003> SetUpDay :=
Ref(Fml("LONGALERT"),-1);
<FONT
face=Arial color=#000000 size=2>
<FONT
face=Arial><SPAN
class=678595608-21082003> {determine entry price
trigger and actual entry price}
<FONT
face=Arial><SPAN
class=678595608-21082003> Trigger :=
Ref(H,-1);
<FONT
face=Arial><SPAN
class=678595608-21082003> {did it open higher?}
<FONT
face=Arial><SPAN
class=678595608-21082003> Trigger := If(O > Trigger,
O, Trigger);
<FONT
color=#000000><SPAN
>
<FONT
face=Arial><SPAN
class=678595608-21082003> {calculate set-up day stop
value}
<FONT
face=Arial><SPAN
class=678595608-21082003> EntryPCT:= {insert x
value};
<FONT
face=Arial><SPAN
class=678595608-21082003> DailyPCT:= {insert y
value};
<FONT
face=Arial><SPAN
class=678595608-21082003> SUDStop:= (Ref(H,-1) +
Ref(L,-1))/2 - EntryPCT*ATR(10);
<FONT
face=Arial color=#000000 size=2>
<FONT
face=Arial><SPAN
class=678595608-21082003> {<SPAN
class=678595608-21082003>calculate entry day
result}
<FONT
face=Arial><SPAN
class=678595608-21082003> EntryDayResult:=
<FONT
face=Arial><SPAN
class=678595608-21082003> If(SetUpDay AND H >=
Trigger,
<FONT
face=Arial><SPAN
class=678595608-21082003> If(L <= SUDStop, -SUDStop,
SUDStop), 0);
<FONT
face=Arial color=#000000 size=2>
<FONT
face=Arial><SPAN
class=678595608-21082003> {calculate trailing
stop}
<FONT
face=Arial><SPAN
class=678595608-21082003> TrailingStop:=
<FONT
face=Arial><SPAN
class=678595608-21082003> If(PREV <= 0,
EntryDayResult,
<FONT
face=Arial><SPAN
class=678595608-21082003> If(L <= (PREV +
DailyPCT*ATR(10)),- PREV, (PREV +
DailyPCT*ATR(10))));
<FONT
face=Arial color=#000000 size=2>
<SPAN lang=EN-US
><FONT
face=Arial>
TrailingStop
Good luck with your
trading.
<FONT face=Arial
size=2>
<FONT face=Arial
size=2>MS
<FONT
face=Tahoma size=2>-----Original Message-----From: Bhavesh
Rajyaguru [mailto:bha6973@xxxxxxxxx] Sent: Wednesday, 20 August
2003 4:49 PMTo: equismetastock@xxxxxxxxxxxxxxxSubject:
[EquisMetaStock Group] trailing stop
configurationHello,I am user of Metastock ver
8.0 EOD,not good at programming and requires help.I have recently
made my system but have one problem i.e I am not able to
configuretrailing stop as per my concept.I want to configure my
trailing stop for longs :the day my system generates buy signal
:=median price minus x% of atr(10) and dailysubsequently y% of atr(10)
should be added.similarly reverse for shorts : the day my
systemgenerates sell signal:=i.e median price plus x% of atr(10) and
dailysubsequently y% of atr(10) should be subtracted.I want this
concept to be optimized in system testerand also as custom formula which
can tell me next day's stop in advance.any suggestion other than
this conceptalso invited.anybody there who can help me out
would be highly appreciatedThanks for helping me in
advance.Bhavesh RajyaguruTo
unsubscribe from this group, send an email
to:equismetastock-unsubscribe@xxxxxxxxxxxxxxxYour
use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
Yahoo! Groups Sponsor
ADVERTISEMENT
To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|