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

Re: [amibroker] Re: PairTrading on Amibroker



PureBytes Links

Trading Reference Links

Hello,

It's very important to include
> SetOption("priceBoundChecking",False);
> SetOption("DisableRuinStop",True);

WRONG!

This should never be used for pairs trading.
If you need that it means that you code is wrong
(you are attempting to set prices outside H-L range which
is huge mistake).

Pairs trading should always respect normal prices
and you should use Foreign only for calculations
and NEVER for setting actual trade price entry.


Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "janhausd" <janhaus@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Friday, January 30, 2009 5:11 PM
Subject: [amibroker] Re: PairTrading on Amibroker


> I'm looking for the same thing, Angelo, I wish there was more inbuilt
> support in Ami for pair trading/testing  :) The way I'm dealing with
> it for now is to utilize foreign() calls, which can be agonizingly
> slow for large amounts of data, and test the strategy based on the
> synthetic/pair, where you enter/exit based on the synthetic price and
> all statistics based on that. Also, It's very important to include
> SetOption("priceBoundChecking",False);
> SetOption("DisableRuinStop",True);
> 
> Without disableruinstop, it seems anytime when there's enough data to
> enter/exit one leg but no data at the same time for the other security
> you hedge with, the backtester will kick you out of the position with
> some ridiculous price, and your results will be entirely incorrect.
> Without priceboundchecking, you may not be able to generate the
> synthetic pair value if the pricing is off. It took several emails to
> Ami support and browsing for posts here for me to figure out these two
> options were necessary for backtesting my setup, wish I'd known
> earlier :) If you or anybody else has any better ideas, I'm all up for
> it...
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "ang_60" <ima_cons@xxx> wrote:
>>
>> --- In amibroker@xxxxxxxxxxxxxxx, "janhausd" <janhaus@> wrote:
>> >
>> > Hi Angelo,
>> > 
>> > I have in fact just recently contacted Herman regarding this subject,
>> > since running that code on my data resulted in mismatching
>> > correlations, where Correl(A,B) was not equal to Correl(B,A) due to
>> > the Foreign() function and data holes between A and B. The result is
>> > actually somewhat similar to the the picture herman posted in that
>> > link, where you see that the correlation between AAPL,ALTR is -0.624,
>> > whereas ALTR,AAPL is 0.421, except when I ran the code, all of the
>> > pairs mismatched and not just the ones on the outer edge of the
>> > correlation square. Anyway, if you have data without mismatching
>> > times, this shouldn't be a problem :)
>> > 
>> 
>> 
>> Thanks jan,
>> 
>> this problem is clear to me now.
>> 
>> I'm on my way to build a pair system on amibroker, using as a template
>> the code posted by TJ on this list some time ago.
>> 
>> My code is pretty simple and open a position for symbol1, and - at the
>> same time - an opposite position for symbol2.
>> 
>> Of course ,in the report this trade is counted as "two" and this makes
>> unuseful of all the statistics based on the total nauber of trades
>> (e.g. percent winners... profit per trade... ).
>> 
>> As anyone thought of a way of telling Amibroker that - in this
>> particular case - the 2 trades representing both leg of the pair
>> should be counted as one?
>>
> 
> 
> 
> ------------------------------------
> 
> **** IMPORTANT ****
> This group is for the discussion between users only.
> This is *NOT* technical support channel.
> 
> *********************
> TO GET TECHNICAL 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
> 
> *********************************
> Yahoo! Groups Links
> 
> 
> 

------------------------------------

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

*********************
TO GET TECHNICAL 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

*********************************
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/