I don’t think I would torture anyone
by having them look at code from the likes of Portfolio Trader … It was
fine for what it did at the time … Those days are over …
I’m still not understanding the
aversion to using the backtester that’s there …
You want recalculation as new data comes
in ? … I’ve modified the previously posted script ( Below ) to allow
one to pick the frequency of automated backtest and the number of times to backtest
it …
This also needs a minor change to the
definition of the tool so that it will prompt for arguments …
If you want it one time only no arguments
are needed …
If you want something else then for
example this will provide 10 refreshes with 3 second intervals … This
could be made as fine as once per millisecond although I wouldn’t advise
it.
Count = 0
Times = 0
Refresh = 0
Set oArgs = WScript.Arguments
For i = 0 To oArgs.Count - 1
Arg = Split(oArgs(i),
"=")
Arg(0) = UCase(Arg(0))
If Trim(Arg(0)) = "REFRESH" Then
Refresh = CCur(Arg(1))
ElseIf Trim(Arg(0)) = "TIMES" Then
Times = CCur(Arg(1))
End If
Next
Set oAB = CreateObject("Broker.Application")
Set oAA = oAB.Analysis
While Count <= Times
oAA.Backtest(0)
WScript.Sleep Refresh * 1000
Count =
Count + 1
WEnd
MsgBox
"Done"
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Paul Ho
Sent: Sunday, May 18, 2008 10:51
PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: System
Performance Indicators [was: Can someone fix this OLE code?]
Herman,
I think I know where you are coming from. The difference between
using indicators vs scripts is that indicators continue to
recalculate ( or in this case backtest) as new data arrives.
One way to broker the impass with Tomasz is consider simple profolio
backtesting as an AFL function. Rather than using OLE, This option is
write a function similar to Equity() in which the symbols in a
watchlist is read and backtested.
I think this function could be done in AFL today using the various
functions already available. ie CategoryGetSymbol to get the symbols,
foreign to set foreign symbol, the equity() function to get rid of
excess signals etc. Of course, you have to do your own ositionscoring
and position sizing. Since Fred has done this before, may be he can
comment further or if he is generous enough, dig out his code and
post it again.
Essentially, this function can be called in your indicator afl. In
that way, you can have your pie and eat it as well. I'm sure if
Tomasz sees a use in it, he will incorporate in his list of functions
to do in the future.
What do you think?
Regards
Paul.
I am using the free version of SPAMfighter for private users.
It has removed 455 spam emails to date.
Paying users do not have this message in their emails.
Try
SPAMfighter for free now!
__._,_.___
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
__,_._,___