[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Pullback System # 1 - problem with BuyPrice



PureBytes Links

Trading Reference Links

Hello again,

One more detail: 
the use of buyprice variable in the formula in question
does not affect system results but only affects
buy/hold results.
This is because buy/hold uses also buyprice array
and this array has undefined value for the start
bar because of 
buyprice = valuewhen( buy, open,1);

(the first bar when buyprice is defined after such statement
is the bar when first buy ocurred)

Best regards,
Tomasz Janeczko
===============
AmiBroker - the comprehensive share manager.
http://www.amibroker.com


----- Original Message ----- 
From: "Tomasz Janeczko" <tj@xxxx>
To: "AmiBroker Mailing List" <amibroker@xxxxxxxxxxxxxxx>
Sent: Friday, July 06, 2001 10:57 PM
Subject: [amibroker] Pullback System # 1 - problem with BuyPrice


> Hello,
> 
> There is a problem with the Pullback System # 1
> formula from AFL library that causes wrong results
> when back-tested on AmiBroker 3.59 and above 
> (the versions supporting *price variables ):
> 
> The problem is that the formula 
> uses reserved variable BuyPrice in a wrong way.
> As it is written in the tutorial section of the guide
> BuyPrice controls the price at which the long trade is open.
> 
> To fix the formula you should use different name for the
> variable than BuyPrice - for example buyp as shown in the fixed
> formula below:
> 
> condition1 = ref(c,-2) < ref(c,-3) and ref(c,-1) < ref(c,-2);
> condition2 = h > ref(h,-1);
> filter = c > ma(c,50);
> 
> buy = condition1 and condition2 and filter;
> buyp = valuewhen( buy, open,1);
> sell = c > buyp or l < ref(llv(l,2),-1);
> 
> buy = exRem(buy,sell);
> sell = exRem(sell,buy);
> 
> 
> Best regards,
> Tomasz Janeczko
> ===============
> AmiBroker - the comprehensive share manager.
> http://www.amibroker.com
> 
> 
> 
> 
> 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 
>