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

Re: [amibroker] buy sell signals



PureBytes Links

Trading Reference Links


Hello Dima and David,
 
In a new version (3.52 beta) there is a special 
function for this called ExRem(),
to remove excessive buy/sell signalsit is 
now enough to write the following:
 
buy = Your_original_formula;
sell = Your original_formula;
 
buy = ExRem( buy, sell );
sell = ExRem( sell, buy );
 
Best regards,Tomasz Janeczko===============AmiBroker - the 
comprehensive share manager.<A 
href="">http://www.amibroker.com
<BLOCKQUOTE 
>
----- Original Message ----- 
<DIV 
>From: 
Dima 
Rasnitsyn 
To: <A title=amibroker@xxxxxxxxxxxxx 
href="">amibroker@xxxxxxxxxxxxxxx 
Sent: Saturday, March 24, 2001 5:08 
PM
Subject: RE: [amibroker] buy sell 
signals

<SPAN 
class=170380616-24032001>Ooops... David, I'm s<FONT face=Arial 
color=#0000ff size=2>orry.
<SPAN 
class=170380616-24032001> 
<SPAN 
class=170380616-24032001>fromEntry = barssince (lgentry);fromExit= 
barssince (lgexit);
So 
the whole code fragment is:
<SPAN 
class=170380616-24032001> 
<SPAN 
class=170380616-24032001>fromEntry = barssince (lgentry);fromExit= 
barssince (lgexit);
 
<SPAN 
class=170380616-24032001>inlgtrd = IIF (NOT (cum (lgentry) > 0), 0, IIF 
(NOT (cum (lgexit) > 0), 1, IIF (fromEntry < fromExit, 1, IIF (fromEntry 
> fromExit, 0,   // 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 
trade   IIF (ref (fromEntry < fromExit, - (lastvalue 
(barssince (lgentry)) + 1)), 0,IIF (close > open, 1, 
0))))));
<SPAN 
class=170380616-24032001>Regards,
<SPAN 
class=170380616-24032001>Dima.

<FONT face=Tahoma 
size=2>-----Original Message-----From: David Holzgrefe 
[mailto:dtholz@xxxx]Sent: Friday, March 23, 2001 11:35 
PMTo: amibroker@xxxxxxxxxxxxxxxSubject: Re: 
[amibroker] buy sell signals
Thanks Dima ..well over my head :)
 

-- IIF (fromEntry < fromExit, 1, IIF 
(fromEntry > fromExit, 0,     IIF (ref (fromEntry 
< fromExit, - (lastvalue (barssince (lgentry)) + 1)), --- 
 
how do u define the fromEntry and fromExit 
?
 
<BLOCKQUOTE 
>
 
Original Message ----- 
<DIV 
>From: 
Dima 
Rasnitsyn 
To: <A 
title=amibroker@xxxxxxxxxxxxxxx 
href="">amibroker@xxxxxxxxxxxxxxx ; <A 
title=tj@xxxx href="">'Tomasz 
Janeczko' 
Sent: Saturday, March 24, 20012:55 
PM
Subject: RE: [amibroker] buy sell 
signals

<FONT face=Arial color=#0000ff 
size=2>David,
<FONT face=Arial color=#0000ff 
size=2> 
<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
<FONT face=Arial color=#0000ff 
size=2>lgexit = xxx; // Signals to exit from long 
position
<FONT face=Arial color=#0000ff 
size=2>// inlgtrd = 1 when in long, 0 otherwise; 'cum(lgentry)>0' and 
cum(lgexit)>0 are necessary to 
<FONT face=Arial color=#0000ff 
size=2>// filter out the cases when lgentry or lgexit is undefined,i.e. 
'{empty}'. These expressions will be
<FONT face=Arial color=#0000ff 
size=2>// 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> 
<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 new 
signal ?
 
thanks 
David