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

RE: [amibroker] buy sell signals



PureBytes Links

Trading Reference Links


<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@xxxxxxxxxxxx 
href="">amibroker@xxxxxxxxxxxxxxx; <A 
title=tj@xxxx href="">'Tomasz Janeczko' 

Sent: Saturday, March 24, 2001 2: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
// 
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 andexit 
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, 20013: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 printnew 
signal ?
 
thanks DavidYour use 
of Yahoo! Groups is subject to the <A 
href="">Yahoo! Terms of Service. 
Your use of Yahoo! Groups is subject to the <A 
href="">Yahoo! Terms of Service. 
Your 
use of Yahoo! Groups is subject to the <A 
href="">Yahoo! Terms of Service.