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

RE: [amibroker] [AFL help] How to sell at the second signal?



PureBytes Links

Trading Reference Links

You could try this

SellSig = Cross(C,Profitline);
Sell = sum(Sellsig, barssince(buy))==2;

Cheers,
Graham
http://e-wire.net.au/~eb_kavan/

-----Original Message-----
From: kris45mar [mailto:kris45mar@xxxxxxxxx] 
Sent: Sunday, December 12, 2004 10:42 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] [AFL help] How to sell at the second signal?


Hi All...

What function can I use if I want to sell the *second
time* an event occurs?

// buy and sell criteria here //
Profitline = EMA (H, (13)) + 2 * ATR (10);

EntryLine = LLV (L, 20) + (2.5 * ATR (10));

Buy = Cross(C,Entryline);


Sell = Cross(C,Profitline);

This gives me a sell signal the *first time* the close
crosses the Profitline.
How do I code for a sell signal the *second time* (or
third time for that matter) the close crosses the
profitline?

I thought I might be able to use 
Sell = Ref(cross(c,Profitline),2); as a sort
lookforward function, but this does not work.

or do I use the Sum or Cum functions somehow?

TIA

ChrisB



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250



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



 




------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/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/