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

[amibroker] Re: AFL question.....for use in backtester



PureBytes Links

Trading Reference Links

You have had the same question some days ago.
Your condP *DOES NOT DEFINE A PEAK*
Try the simple
condP=Ref(H,-1)>=Ref(H,-2) AND Ref(H,-1)>H AND Ref(H,-1)>Ref(C,-3);
Plot(C,"",CONDP*24+1,64);
The condP candles are painted orange and they come *ONE DAY AFTER* 
some local peaks. 
Do you speak for these peaks?
If positive, these peaks occur when the cond1 occurs.
Try the
condP=Ref(H,-1)>=Ref(H,-2) AND Ref(H,-1)>H AND Ref(H,-1)>Ref(C,-3);
cond1=Ref(condP,1);
Plot(C,"",COND1*24+1,64);
If you have in mind these [green] peaks let me know to see the rest 
of your requirement.
Note also that cond1 looks into the future by +1 day [you can not 
know a peak before the next, lower day...]
Dimitris Tsokakis

--- In amibroker@xxxxxxxxxxxxxxx, "epintoem" <epintoem@xxxx> wrote:
> I have the AFL code that automatically draws trend lines but I cant 
> use it in Backtester. Anyone with a work around?
> 
> 
> 
> condP=Ref(H,-1)>=Ref(H,-2) AND Ref(H,-1)>H AND Ref(H,-1)>Ref(C,-3);
> 
> The above condition defines a peak.
> 
> In order to draw a trend line I need 4 values
> 
> first Peak= value when condP is met
> 
> second peak= value when condp is met and High greater than first 
peak.
> 
> bar1= number of bars between peaks
> 
> bar2= number of bars since first peak.
> 
> Using last value restricts the finding to the last occurrence which 
> then does not allow to back test?
> 
> TIA


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/