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

Pullback System # 1 - problem with BuyPrice


  • To: "AmiBroker Mailing List" <amibroker@xxxxxxxxxxxxxxx>
  • Subject: Pullback System # 1 - problem with BuyPrice
  • From: "Tomasz Janeczko" <tj@xxxx>
  • Date: 6 Jul 2001 20:57:22 -0000

PureBytes Links

Trading Reference Links

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