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

[amibroker] Re: Bars since Buy signal - how to code in AFL ?



PureBytes Links

Trading Reference Links


See user's guide for ExRemSpan and ApplyStop:

Buy = ExRemSpan( Buy, 7 );
Sell = Ref( Buy, -7 ); 

or

Sell=0;
ApplyStop( stopTypeNBar, stopModeBars, 7 ); 

--- In amibroker@xxxxxxxxxxxxxxx, "vb_MCSE" <av_inon@xxxx> wrote:
> 
> Hi:
> Caught this Trend Change system from an old Tradestation video from
Omega.
>  
> Hi:
> Caught the following on an old Tradestation video from Omega:
>  
> Buy signal when:
>  Today's Low is lower than the lowest Low of past 6 days
>  AND
>  Today's Close is Greater Than Yesterday's Close.
>  
> Sell signal when:
>  If Bars Since Entry = 7 then Sell on Close.
>  
> How would one code the Sell signal ? It's got me (AFL newbie)
> scraching my head. As an aside, I think this Sell signal could be
> useful when combined with other entry systems (crossover etc). I'm
> interested in playing around with different values for Bars Since
Entry. 
> 
> Here's what I've coded with AFL so far:
> 
> b=0; 
> donothing=0;
> IIf (Low < LLV(Low, 6) AND Close > Ref(Close, -1), b=1,donothing);
> Buy = b==1;
> Sell = BarsSince (b==1) > 6; 
>  
> Get Buy signals (even though there are too many - it's at least
it's a
> start), but cannot get any Sell signals. 
>  
> Thanks in advance for any hints and or suggestions.
> vb





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

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