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

Re: [amibroker] Correct futures - forex backtesting


  • Date: Wed, 03 Feb 2010 01:31:49 +0100
  • From: Tomasz Janeczko <groups@xxxxxxxxxxxxx>
  • Subject: Re: [amibroker] Correct futures - forex backtesting

PureBytes Links

Trading Reference Links



Hello,

In other words negative result tells you how much extra cash you would need to deposit on your account
to keep trading. This is margin call. Either you deposit extra money or you say good bye to your account.

Best regards,
Tomasz Janeczko
amibroker.com

On 2010-02-03 01:22, Tomasz Janeczko wrote:


Hello,

Well, certainly with $10000 account then in fact you should not trade forex at all, because you are undercapitalized and this is straight way to blow you account, at that is precisely what backtest results tell you.

Best regards,
Tomasz Janeczko
amibroker.com

On 2010-02-02 21:07, İlhan Ketrez wrote:
[Attachment(s) from =?UTF-8?Q?=C4=B0lhan_Ketrez?= included below]

Hello,
 
If I have 10,000 and if the initial margin is 1000, can't I open 8 lots? Then what does the initial margin mean?
 
If Amibroker trades far away from margin call everything works perfectly. For example if I have 100,000 and trade one contract, there is no problem. Amibroker takes the position value, multiplies it with the price difference... These are OK. The document you suggest mainly explains these essential details and some basic concepts (http://www.amibroker.com/kb/2006/08/09/amibroker-for-forex/) .
 
In forex & futures, the trick is to be able to trade near limits without getting caught by the limits. And there is nothing in Amibroker about these limits as far as I see. Moreover, it seems that it is impossible to formulate a correct custom backtest procedure due to improper handling of PositionSize and read-only Equity and Cash variables in CBI.
 
I wonder your additional comments on the subject, especially your answer to my first two questions. The final equity becomes -378,320 with 10,000 initial equity with the same settings. Attached you may find the formula file.
 
Best regards,
Ilhan

 
2010/2/2 Tomasz Janeczko <groups@xxxxxxxxxxxxx>
 

Hello,

You are using wrong settings.

> Contract number is 800

That is wrong. No forex broker would allow you to open 800 lots.

You should use SetPositionSize( 1, spsShares ); to ensure you are trading one lot
(or what every lots you really trade).

You need to read this:
http://www.amibroker.com/kb/2006/08/09/amibroker-for-forex/

Best regards,
Tomasz Janeczko
amibroker.com



On 2010-02-02 18:37, İlhan Ketrez wrote:


Hello,

I am a registered user of Amibroker and have sent this problem to Amibroker support before sending to the mailgroup.
By now, more than one week has passed and there is no reply.

I still do not want to believe that Amibroker cannot perform a correct futures/forex bactest and I am afraid of hearing that it can't. However, to me, my tests clearly indicate that there's something wrong with the default behaviour of "futures mode" backtesting. Shortly, you open a position, and as the position be exhausted you still have cash in your account. Even after the position size goes below zero, you still have cash and may open a position if you code accordingly. Ability of the position size to go below zero may just be another discussion topic. There is no such account in real life. Normally, the position size does not change if the position is a winner and if the position is a loser, it consumes the cash first, then consumes itself down to the maintenance margin where the broker liquidates the position.

All in all, my request from Amibroker stuff is to either invalidate my comments by writing a few sentences or clearly accept that Amibroker cannot perform a correct futures backtest and stop misleading people.

Best regards,
Ilhan


2010/1/28 İlhan Ketrez <ketrezilhan@xxxxxxxxx>
 
[Attachment(s) from =?UTF-8?Q?=C4=B0lhan_Ketrez?= included below]

Dear friends

I am trying to test a simple system and understand the behaviour of Amibroker testing mechanism.
I have set up an AFL file very similar to the one described here.

Testing period: 01.01.2008 - today
Initial equity: 1,000,000
Final equity: -38,033,810


The position size is -80.
Margin deposit: 1000.
First entry details are as follows:
Contract number is 800
Entry position size: 800,000. Cash: 200,000.

The details I find interesting are:
As the position grows position size also grows and cash continues as 200,000.
Later, position size goes below zero as cash floats constantly above zero.
The default result in Amibroker is something impossible to encounter in real life. (To go into a debt of 38 million)
I defined a real cash value and observed the difference via debugview.


Report and debugview log are attached including the system codes.

I hope to find a way to test correctly using Amibroker with your help.
Thank you very much in advance.

Regards,
Ilhan Ketrez






Attachment(s) from =?UTF-8?Q?=C4=B0lhan_Ketrez?=

1 of 1 File(s)






__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___