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

RE: [amibroker] Backtesting exit strategies based on previous discretionary entries



PureBytes Links

Trading Reference Links




<FONT face=Arial color=#0000ff 
size=2>If you know how to write simple Excel formulas to form strings 
you can just copy your dates and times into the first two columns and write an 
Excel formula to create the afl string needed by AmiBroker in the next 
column. Something like:
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2>Buy =
<FONT face=Arial color=#0000ff 
size=2>iif( Date == ExcelRefToDateColumn AND Time == 
ExcelRefToTimeColumn, 1,
<FONT face=Arial color=#0000ff 
size=2>.... copy the above line to as many rows as you have dates 
...
<FONT face=Arial color=#0000ff 
size=2>
<FONT face=Arial color=#0000ff 
size=2>iif( Date == ExcelRefToDateColumn AND Time == 
ExcelRefToTimeColumn, 1,
0 )...); // fill in as many brackets as you 
have Rows
 
You have to write only one Excel formula 
because all rows are the same except for the first and last one, so just copy it 
as often as you need it.
 
When done you can copy the page to wordpad 
and search-replace tabs/space with nothing to clean up and compact the file. 
Then copy to the afl editor and create an include file.
 
good luck,
herman.
 
<SPAN 
class=810491807-14112003> 

  <FONT face=Tahoma 
  size=2>-----Original Message-----From: g_r_e_g_69 
  [mailto:gregoliver_@xxxxxxxxxxx]Sent: November 14, 2003 2:28 
  PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] 
  Backtesting exit strategies based on previous discretionary 
  entriesI have been papertrading a very short term and 
  discretionary system on the Hang Seng futures over the last 1 1/2 
  months.  Anyway, although I would like to keep using discretionary 
  entries for the time being, I would like to do some backtesting on exit 
  strategies based on the discretionary entries I picked real-time in the 
  past.  I was wondering if there was some way for me to type my entry 
  times and prices into Amibroker and then write code to backtest my ideas 
  for exit strategies.(if it were just time, it think it would look 
  like this):longentry=iif(datenum()==1031114 AND timenum()==(213500 or 
  222100 or 234500),1,0);shortentry=iif(datenum()==1031114 AND 
  timenum()==(215500 or 225500 or 232300),1,0);buy=longentry; sell=???; 
  short=shortentry; cover=???;But I need to be able to enter both 
  entry time and price and I'm not sure how to do this, can anyone help 
  me?Thanks in advance,GregSend 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT











Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.