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

[amibroker] Re: Help to translate into AFL



PureBytes Links

Trading Reference Links

Hi Graham,

Thanks again for your reply.

May be I have confused you, there is no second signal. Once the x 
condition is met, a signal is created. The signal remains valid until 
a buy or a y condition is met. When the signal is valid, a buy happen 
when today price hit yesterday's high. Hope this is clearer. The 
problem I have is once I use var1=valuewhen(x,h), the h value is 
always remain even though the next bar cud be a lower H or higher H. 
I am still not familiar with AFL enough.

Thanks
KK

--- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanag@xxxx> wrote:
> I am a bit confused about the second signal. The first is easy 
enough
> 
> Val1 = valuewhen(x,h);
> 
> Val2 = valuewhen(ref(Val1,-1),H);
> 
> Buy = Cross(c,Val1-1) or Cross(c,Val2-1); //assume 1 trade tick is 
value
> 1 and the trigger is close equal or crossing the Val1 
> 
> Sell = y;
> 
>  
> 
> But when you say take the next bars high if the original is not met,
> which next bar do you mean? You could only use it as an either or 
for
> the buy statement.
> 
> There is no way of knowing if the first condition will not be met,
> unless you have a time factor for which the original buy remains
> current. Maybe someone else might work that bit out.
> 
>  
> 
>  
> 
> Cheers,
> 
> Graham
> 
>  
> 
> -----Original Message-----
> From: kk2628 [mailto:kk2628@x...] 
> Sent: Thursday, 6 February 2003 5:57 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Help to translate into AFL
> 
>  
> 
> Hi,
> 
>  
> 
> I am stuck. Wud greatly appreciate someone can help to translate the
> following trading rules into AFL:
> 
>  
> 
> When x condition is met, store the value of the bar's high. 
> 
> Buy when the bar's high value is met, otherwise take the following 
bar's
> high as the new value, until buy (hit the new bar's high value) or 
until
> y condition is met (signal reset).
> 
>  
> 
> many thanks
> 
> KK
> 
> 
> 
> 
> 
> 
> Yahoo! Groups Sponsor
> 
> 
> 
> ADVERTISEMENT
>  
> 
<http://rd.yahoo.com/M=243376.2803712.4220031.1927555/D=egroupweb/S=17
05
> 
632198:HM/A=1414910/R=0/*http:/ad.doubleclick.net/jump/N879.ameritrade
.y
> ahoo/B1054521.29;sz=300x250;adc=zhs;ord=1044525656429142?> 
> 
> 
>  
> <http://us.adserver.yahoo.com/l?
M=243376.2803712.4220031.1927555/D=egrou
> pmail/S=:HM/A=1414910/rand=723966570> 
> 
> 
> 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 the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/> .


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/