Papertrader
Mitglied seit 11 Jahre 4 Monate

Metastock 8.0: Trading nach Equity Line

Der Equityverlauf im nachfolgender Chart von “ H-MSBT Equity Plot Example“ dargestellt mit Metastock 8.0, zeichnet sich durch eine robuste Equity Line aus. Leider fehlt nur noch die entsprechende Formel für solch ein Trading-Sytem.

Im StockCentral Forum war am 28-05-2002 ein entsprechender Beitrag über “Trade Equity Le“

Wer könnte hier weiterhelfen ?

Mit freundlichen Grüßen
Papertrader

To 'Trade Equity LE' users
The ‘Trade Stop LE’ indicator that follows has been created to provide 3 basic stop options for use with the ‘Trade Equity LE’ indicator and system tester family. ‘Trade Equity LE’ can’t handle entry dependant stops but ‘Trade Stop LE’ now provides that capability. The necessary use of a number of PREV functions will cause TE explorations to run much more slowly, but the benefit is that profit target, stop loss and (accurate) timed exits are now all possible with TE.
In creating the ‘TS’ indicator I have tried to make it as flexible as possible, and I would like to hear back with suggestions, comments, and complaints about its flexibility and usefulness. In part TS is an attempt to replicate the appropriate MetaStock EOD stops, however I have attempted to create an indicator that produces stops that can be more closely related to real trading. To this end there are a number of selectable options that allow price stops to be implemented in different ways. One must remember that Trade Equity works best with ‘price’ entries and exits rather than the pure binary signals that the MS System Tester offers. TS also uses price signals rather than binary signals, so entries and exits can be based on intra-day prices while still using only EOD data.
For those that are not familiar with using price signals instead of binary signals the code changes required are usually minimal and quite simple. Consider an entry based on a moving average crossover that trades on the closing price with zero delay. The MetaStock System Tester code would be -
Cross(Mov(C,9,S),Mov(C,15,S));
And the modified entry code for Trade Equity/Trade Stop would be -
If(Cross(Mov(C,9,S),Mov(C,15,S)),C,0);
Simple really isn’t it. Well not always, but quite straight forward once one or two basic coding tricks are mastered.
‘Trade Stop’ is used with ‘Trade Equity’ by setting commissions and capital the same for both, setting the entry code the same for both, and setting ‘Trade Equity’ options to 5 (stop entry and exit). The usual ‘Trade Equity’ exit code is used instead by ‘Trade Stop’ and the output signal from ‘Trade Stop’ becomes the exit signal for ‘Trade Equity’.
Features and Usage
1. Timed exits
Set the ‘Pd’ variable to the maximum number of bars required per trade. Setting this variable to ‘99’ will disable the timing function. An alternative method for disabling the function, which will also speed up execution, is to place braces {} around the appropriate code in the ‘Tr’ variable.
2. Profit target met
The ‘Xa’ input options allow the user to select which price will be used to trigger the profit stop (close, high or stop value), and which price will be used trade the profit stop (next open, close or ASX adjusted profit stop price). The reason for using an adjusted (down) stop price is that the calculated percentage stop value seldom coincides with a price that is actually tradable. This is addressed by rounding down the stop value, once hit, to the next tradable price. When testing systems this will produce a lower profit figure but it must be remembered that an optimistic system test result is of no use to anyone. Since my knowledge of other exchanges is minimal I have not attempted to provide suitable rounding down code for other than the ASX.
3. Stop loss met
The ‘Xc’ input options allow the user to select which price will be used to trigger the stop loss (close, low or stop value), and which price will be used trade the stop loss (next open, close or ASX adjusted stop loss price). The reason for using an adjusted (down) stop price is the same as for the profit target stop.
4. Commission
This value must be set the same as the corresponding variable(s) in ‘Trade Equity LE’. It is assumed that both entry and exit commissions will be the same. If they are not then a close approximation can be achieved by halving the sum of entry and exit commissions. Comments have been placed in the indicator to show where different entry and exit commissions can be inserted directly if required.
If commissions are not included in the calculation of stops then results become significantly optimistic. This is especially so when commissions are particularly large relative to position sizing, as may be the case when using a full service broker and only a modest amount of capital.
5. Capital
This is your optimum position size, and it should also agree with the value used by ‘Trade Equity’. Capital and commission values are both required to calculate percentage stop values.
6. Profit target
This can be set between 1% and 98%, though numbers outside this range could be used if necessary. The value of ‘99’ can be used to disable the function of Profit target, and this function can also be disabled by commenting out the relevant code in the ‘Tr’ variable.
7. Stop loss
This is the same as for ‘Profit target’ above.
8. ‘N’ and ‘X’ variables are the same as ‘Ns’ and ‘Xs’ used in ‘Trade Equity LE’. Binary inputs have been dispensed with as they require more code to implement but deliver no advantages apart from standard MetaStock compatibility – not one of my priorities at this point. Note however that the output from this indicator will now be called by ‘Trade Equity LE’ using the following line of code.
Xs:=Fml(“Trade Stop LE”);
9. The ‘Pf’ and ‘Lf’ factor variables are just used to simplify and shorten subsequent code requiring profit and loss calculations.
10. The ‘Tr’ variable, the heart of this indicator, is a latch that sets and holds the entry price when a trade is initiated. The first line of code controls entry, and the subsequent four lines control the four possible exit conditions. Notice that any one exit condition will trigger a reset to zero (trade exit), and multiple exit events are possible. The second ‘Tr’ variable is provided to allow ‘Trade Stop’ to recognize concurrent entry and exit signals and to pass ‘X’ back to ‘Trade Equity’ to allow it to manage the “same day” entry and exit. Using a negative value for ‘Tr’ allows this type of trade to be identified if required.

11. The end of a trade is denoted by ‘Xb’ (for eXit Bar).
12. ‘Ev’ remembers the entry value of each trade which is otherwise lost when the ‘Tr’ variable is reset to zero.
13. ‘Sp’ is the profit stop price that is to be applied to the trade. This will vary depending upon user preferences.
14. ‘Sl’ is the stop loss price to be applied to a trade, and the same in most respects as ‘Sp’.
15. The second to last line of the indicator supplies 3 useful visual signals, the entry price, the profit target price and the stop loss price. These outputs are visual only and do not affect the stop price returned to ‘Trade Equity LE’.
16. The last line of code prioritizes the various possible outputs. Note the order of precedence - stop loss, profit target, normal exit, and timed exit. The timed exit will default to exit on the current close. No provision has been made for other exit prices.

Sample code follows. Please note that the entry and exit code presented here has not been adjusted to reflect ASX tradable prices
{PS Fractal Entry}
F1:=ValueWhen(1,H<Ref(H,-2) AND Ref(H,-1)<Ref(H,-2) AND
Ref(H,-3)<Ref(H,-2) AND Ref(H,-4)<Ref(H,-2),Ref(H,-2));
a:=H>=F1;
If(a>0 AND Alert(a=0,2),Max(O,F1),0);.
{PS Fractal Exit}
F2:=ValueWhen(1,L>Ref(L,-2) AND Ref(L,-1)>Ref(L,-2) AND
Ref(L,-3)>Ref(L,-2) AND Ref(L,-4)>Ref(L,-2),Ref(L,-2));
If(Cross(F2,L),Min(O,F2),0);
{Trade Stop LE}
Pd:=20; {Timed exit periods - 99 to disable}
Xa:=Input("Profit Target Price and Timing:",0,0,0);
Xa:=Input("C/Next Open=1 C/Close=2 H/Close=3 Intraday=4",1,4,3);
Xc:=Input("Stop Loss Price and Timing:",0,0,0);
Xc:=Input("C/Next Open=1 C/Close=2 L/Close=3 Intraday=4",1,4,3);
Pt:=Input("Profit Target %",1,99,25)/100;
Ls:=Input("Maximum Loss %" ,1,99,12)/100;
Cm:=30; {Commission}
Cp:=6000; {Capital}
N:=Fml("PS Fractal Entry"); {Entry/Price}
X:=Fml("PS Fractal Exit"); {Exit/Price}
I:=Cum(N>-1 OR X>-1)=1;
Pf:=(Cp*(1+Pt)+Cm)/(Cp-Cm); {Profit factor}
Lf:=(Cp*(1-Ls)+Cm)/(Cp-Cm); {Loss factor}
{+Cm for exit, -Cm for entry}
Tr:=If(PREV=0,If(N>0 AND X=0,N,0),
If(X>0 OR
(BarsSince(PREV=0)>=Pd AND Pd<>99) OR
(If(Xa<3,C,H)>=Pf*PREV AND Pt<>99) OR
(If(Xc<3,C,L)<=Lf*PREV AND Ls<>99),0,PREV));
Tr:=If(Tr=0 AND N>0 AND Alert(N=0,2) AND X>0,-N,Tr);
Xb:=(Tr=0 AND Alert(Tr>0,2)) OR (Tr<0 AND Alert(Tr=0,2)); {Exit bar}
Ev:=ValueWhen(1,I OR Tr<>0,Abs(Tr)); {Buy price}
Sp:=If(Xb,If(Xa<3 AND C>=Ev*Pf,C,
If(Xa>2 AND H>=Ev*Pf,Ev*Pf,0)),0);
Sp:=If(Xa=4 AND Sp>0,Max(O,If(Sp>=0.5,PREC(Sp,
2),If(Sp<0.1,PREC(Sp,3),PREC(Sp*2,2)/2))),Sp);
Sp:=If(Xa=3 AND Sp>0,C,If(Xa=1,Ref(Sp,-1),Sp));
Sp:=If(Xa=1 AND Sp>0,O,Sp);
Sl:=If(Xb,If(Xc<3 AND C<=Ev*Lf,C,
If(Xc>2 AND L<=Ev*Lf,Ev*Lf,0)),0);
Sl:=If(Xc=4 AND Sl>0,Min(O,If(Sl>=0.5,PREC(Sl,
2),If(Sl<0.1,PREC(Sl,3),PREC(Sl*2,2)/2))),Sl);
Sl:=If(Xc=3 AND Sl>0,C,If(Xc=1,Ref(Sl,-1),Sl));
Sl:=If(Xc=1 AND Sl>0,O,Sl);
Tr; Tr*Pf; Tr*Lf; {Entry price, Target, Stop}
If(Xb,If(Sl>0,Sl,If(Sp>0,Sp,If(X>0,X,C))),0);

The user section of ‘Trade Equity LE’ using ‘Trade Stop LE’ should look like this.
{Trade Equity LE} {Long side only}
{*** Start of user input section ***}
No:=Input("Enter 1=O 2=C 3=H 4=L 5=Stop",1,5,5);
Xo:=Input(" Exit 1=O 2=C 3=H 4=L 5=Stop",1,5,5);
Nd:=Input("Entry Delay",0,3,0);
Xd:=Input(" Exit Delay",0,3,0);
Cp:=6000; {** Trade Capital **}
Cn:=Input("Entry Commission $",0,99,30);
Cx:=Input(" Exit Commission $",0,99,30);
{For % commission use this and (*) code}
{Cn:=Input("Entry Commission %",0,3,0.5)*Cp/100;
Cx:=Input(" Exit Commission %",0,3,0.5)/100;}
N:= 0;
Ns:=Fml("PS Fractal Entry");
X:= 0;
Xs:=Fml("Trade Stop LE");
{*** End of user input section ***}

Geschrieben von Papertrader am
Papertrader
Mitglied seit 11 Jahre 4 Monate

Chart mit Equity Plot

Urs
Mitglied seit 11 Jahre 4 Monate

Hallo Papertrader

Es gibt eine yahoo-Gruppe TradeEquity http://groups.yahoo.com/group/TradeEquity/?yguid=74547443 wo es Metastockfiles und Diskussionen über Dein EquityLine gibt.

Schau Dir das mal an. Eventuell hilft es weiter.

Gruss Urs

Rückrufservice
Beschreiben Sie bitte Ihr Anliegen, damit wir uns auf den Rückruf vorbereiten können.
Ja, ich habe die Datenschutzerklärung zur Kenntnis genommen und willige ein, dass die von mir angegebenen Daten inklusive der Kontaktdaten zwecks Bearbeitung der Anfrage und für den Fall von Anschlussfragen elektronisch erhoben und gespeichert werden. Meine Daten werden dabei nur streng zweckgebunden zur Bearbeitung meiner Anfrage genutzt und nicht ohne Einwilligung weitergegeben. Diese Einwilligung kann jederzeit mit Wirkung für die Zukunft widerrufen werden.
Fragen?

Sie haben Fragen zu ZMP Live? Unser Team steht gerne hilfsbereit zu Ihrer Verfügung. Senden Sie uns gerne eine Nachricht:

Es gilt unsere Datenschutzerklärung

Jetzt registrieren

Jetzt registrieren und ZMP Live+ 14 Tage kostenlos testen!
  • Dauerhaft kostenfrei
  • Keine Zahlungsinformationen erforderlich