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

[amibroker] Re: More simple backtesting questions



PureBytes Links

Trading Reference Links

Graham,

My browser went 404 ... sorry if this post is a duplicate. 

The problem is that I don't know whether I will be long or short at 
the time I want to exit.

For example, I'm trying to test a EMA Cross strategy of 7/29 with a 
SL of 0.0123 on the USD/EUR 5 minute charts. I only want to consider 
data on Fridays between 1:45 AM and 3:00 AM. At 3 each Friday I want 
all open positions closed. Here is the AFL I'm using to attempt 
that. 

Buy = Cross(EMA(Close,7),EMA(Close,29)) AND DayOfWeek()==5 AND 
TimeNum()>=014500 AND TimeNum()<=030000;
Sell = Cross(EMA(Close,29),EMA(Close,7)) AND DayOfWeek()==5 AND 
TimeNum()>=014500 AND TimeNum()<=030000;
Short=Sell;
Cover=Buy;
ApplyStop(0,2,0.0123,True,False);

Thanks for the quick response!

James


--- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanagh@xxxx> wrote:
> Try 
> Sell = Timenum()==yourtime and Datenum()=yourdate
> I might be able to be more specific with more detail of the times 
etc you
> want to close positions
> 
> 
> Cheers,
> Graham
> http://groups.msn.com/ASXShareTrading
> http://groups.msn.com/FMSAustralia 
> 
> -----Original Message-----
> From: the_real_redleg [mailto:james.hall3@x...] 
> Sent: Thursday, 16 October 2003 4:20 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] More simple backtesting questions
> 
> 
> Thanks to Graham and Yuki for answering my previous question! :)
> 
> Is there an AFL command for "close all open positions at this 
time?" 
> I'm backtesting FOREX (EUR/USD)5 minute charts for specific time 
> periods during specific days. But at the end of each time period I 
> would like to close all open positions. 
> 
> Also, how can I set the backtester so that all trades are 1 lot 
(for 
> EUR/USD that means equivalent $100,000 USD per trade.) I have 
> entered 100000 in the "set round lot size" function, but it 
appears 
> to trade multiple lots if the current ballance permits. How can I 
> limit it to 1 lot only for all trades?
> 
> Thanks!
> 
> James
> 
> 
> 
> 
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> 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 
http://docs.yahoo.com/info/terms/



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs from home.
Over 14,500 titles. Free Shipping
& No Late Fees. Try Netflix for FREE!
http://us.click.yahoo.com/mk9osC/hP.FAA/3jkFAA/GHeqlB/TM
---------------------------------------------------------------------~->

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 http://docs.yahoo.com/info/terms/