PureBytes Links
Trading Reference Links
|
Richard:
I'm assuming you need to define "BuyPrice" for your sell signal. How about:
{Enter long}
{System Tester options are set to enter on the Close}
BuyTrigger:=(MOV(C,10,E) - MOV(C,30,E)) / MOV(C,30,E);
BuyTrigger > 0.05
{Close long}
BuyTrigger:=(MOV(C,10,E) - MOV(C,30,E)) / MOV(C,30,E);
BuyPrice:= If(PREV <= 0,
{Then did you go long today?}
If(BuyTrigger > 0.05, CLOSE, 0),
{Else did you exit today?}
If(Close >= PREV*(1+BuyTrigger), -PREV,
PREV));
BuyPrice < 0
In this formula, BuyPrice is the close on the date BuyTrigger exceeds your
threshold. If you are in a trade and have just received a sell signal,
BuyPrice is redefined as a negative, and System Tester is told to close your
long position. If you are not currently in a trade, BuyPrice is assigned a
zero value and System Tester is told to watch for a new long entry.
If you need to define "BuyPrice" for further manipulation in your entry
conditions, that will be a little more involved and we can look at that
separately.
Hope this helps.
----- Original Message -----
From: Richard Bone
To: metastock@xxxxxxxxxxxxx
Sent: Friday, April 28, 2000 1:55 AM
Subject: System Tester - buy price
I'm trying to get a reference to the buy price ... and other function values
at the time of the buy.
For example:
Enter Long:
BuyPrice:=C;
BuyTrigger:=(MOV(C,10,E) - MOV(C,30,E)) / MOV(C,30,E);
BuyTrigger > 0.05 { Enter Long if 10pd EMA 5% greater than 30pd EMA }
Close Long:
C { current } >= BuyPrice * (1 + BuyTrigger) { Set target sell based on Buy }
Problems I find are that the Enter Long condition may or may not remain for
the duration of the trade. For example, Enter Long condition may hold today
and tomorrow but then the stock can fall for 2 weeks until it rises to above
the buy price. Of course, if we know that the stock will only rise then its
not so hard.
So, has anyone developed a formula or technique that will do this?
I have used the Stops | Profit Target but it only accepts fixed Points and
Percentages ... not a function of Buy or attributes at the time.
Richard Bone
|