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

RE: [amibroker] buy sell signals



PureBytes Links

Trading Reference Links


<FONT face=Arial color=#0000ff 
size=2>David,
<FONT face=Arial color=#0000ff 
size=2> 
I'm 
using the following code to filter out extra buy/sell 
signals:
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2>lgentry = xxx; // Signals to open long position
lgexit 
= xxx; // Signals to exit from long position
// 
inlgtrd = 1 when in long, 0 otherwise; 'cum(lgentry)>0' and cum(lgexit)>0 
are necessary to 
// 
filter out the cases when lgentry or lgexit is undefined, i.e. '{empty}'. These 
expressions will be
// 
replaced by ' lgentry != {EMPTY}' and 'lgexit != {EMPTY}' once Tomasz implements 
that.
<FONT face=Arial color=#0000ff 
size=2>   // If Entry and exit happen at the same day   
// If was in trade before, exit the trade   // Else (was not in 
trade) If the market closed above open (i.e. the low was done before the high), 
consider in long trade   // Else ( closed below open ), consider 
entry and exit at the same day and not in tradeinlgtrd = IIF (NOT (cum 
(lgentry) > 0), 0, IIF (NOT (cum (lgexit) > 0), 1, 
<FONT face=Arial color=#0000ff 
size=2>   IIF (fromEntry < fromExit, 1, IIF (fromEntry > 
fromExit, 0,     IIF (ref (fromEntry < fromExit, - 
(lastvalue (barssince (lgentry)) + 1)), 0,IIF (close > open, 1, 
0))))));lgexit = IIF (ref (inlgtrd, -1) > inlgtrd, 1, 0);lgentry 
=  IIF (CUM (lgentry) < 1, 0, IIF (CUM (lgentry) == 1, lgentry,  
ref (inlgtrd, -1) < inlgtrd));
<FONT face=Arial color=#0000ff 
size=2> 
Note: 
I'm using lgentry/lgexit rather then buy/sell to separate entering/exiting long 
trade from exiting/entering a short one.
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2>Regards,
<FONT face=Arial color=#0000ff 
size=2>Dima.
 

<FONT face=Tahoma 
size=2>-----Original Message-----From: David Holzgrefe 
[mailto:dtholz@xxxx]Sent: Friday, March 23, 2001 3:55 
PMTo: Tomasz Janeczko; amibroker@xxxxxxxxxxxxxxxSubject: 
[amibroker] buy sell signals
Hi all Tomasz is there a way to filter out buy 
sell signals if there is already an open signal
 
eg if buy condition meet don't print newsignal 
?
 
thanks DavidYour 
use of Yahoo! Groups is subject to the <A 
href="">Yahoo! Terms of Service.