PureBytes Links
Trading Reference Links
|
Thanks
Owen, however note that i used Equity(1) in my code which removes all redundant
signals. This code will use exactly the same signals as are used in the
backtester... so i think it should work OK without ExRem() or other logic.
Please correct me if i am wrong.
<FONT face=Arial color=#0000ff
size=2>
<FONT face=Arial color=#0000ff
size=2>herman.
<FONT face=Arial color=#0000ff
size=2>
<FONT face=Arial color=#0000ff
size=2>
<FONT face=Tahoma
size=2>-----Original Message-----From: Owen Davies
[mailto:owen5819@xxxxxxxxxxxx]Sent: Thursday, June 17, 2004 10:23
AMTo: amibroker@xxxxxxxxxxxxxxxSubject: Re: [amibroker]
Is there a "Bars Since Entry" Function ?Herman van
den Bergen wrote:> The easiest way to determine trade profits is to
sample the equity > curve as created by AB. For example:>
> // your system here....(the following code untested)>
E=Equity(1);> LongEntryEquity = valuewhen(ref(Buy,-1),E);>
LongExitEquity = valuewhen(ref(Sell,-1),E);> LongTradeProfit =
valuewhen(ref(sell,-1), LongExitEquity-LongEntryEquity);>
Plot(LongTradeProfit,"LTP",1,1);Note that you will need
ExRem(Buy,Sell) and ExRem(Short,Cover) statements if your technique
involves the possibility of repeated entry signals before the exit, or the
ValueWhen() statement will wind up referring to the most recent signal,
rather than the one on which you entered.I have plead with Tomasz
to give us a BarsSince(Entry) function intermittently for several years
now. ExRem() and ExRemSpan() will do the job between them. I
believe Tomasz was kind enough to provide ExRemSpan() specifically to
solve a problem I had, and I am profoundly grateful to him; customer
service doesn't get any better than that. However, there are still
situations in which the logic of repeated signals becomes so convoluted
that I lose track and waste endless hours trying to be sure I've accounted
for all the variations--and then am never quite sure that I have
succeeded. BarsSince(Entry) would eliminate that problem.For
an illustration, try implementing the classic Larry Williams volatility
breakout entry and bailout exit. Enter when the price rises or falls
from the Open by a set fraction of the previous day's range. Exit on
the first profitable Open after a delay of one or more bars. This
frequently produces repeated entry signals before the exit, and often
gives a new signal on the exit day; it gets complicated enough to give you
the idea. This can be solved using ExRem() and ExRemSpan(), but the
code would be cleaner with a BarsSince(Entry) function.Owen
DaviesCheck AmiBroker web page at:<A
href="">http://www.amibroker.com/Check
group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Sponsor
ADVERTISEMENT
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 the Yahoo! Terms of Service.
|