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

Re: [amibroker] Trade Delays



PureBytes Links

Trading Reference Links

Hi Steve --

Be care to avoid a "future leak."  If you use the following set of statements:

settradedelays(0,0,0,0);
BuyPrice = Open;

The you are telling AmiBroker to trade at the open of the bar that is used to compute your signal.  This causes a future leak -- like reading tomorrows newspaper before you decide whether or not to buy at today's price.

The following set of statements has no future leak, since the signal is computed today and trade taken tomorrow:

settradedelays(1,1,1,1);
BuyPrice = Open;

When you are using the Formula Editor, pull down the menu next to the "!" mark, then click "Check."  AmiBroker will report future leaks in the code it is examining.  (Note that it cannot look into the code that might be called from your program, so be careful if you call external code).

Thanks,
Howard
www.quantitativetradingsystems.com
 

On Tue, Mar 4, 2008 at 4:08 AM, Steve Carlsson <stevecar144@xxxxxxxxxxxx> wrote:

Hello all

I have been testing a system with trade delays set to 1 for long short entry
exit in the backtester and keep getting very different results if I
alternatively code settradedealys(1,1,1,1) in the code. The results are
hugely different....

Just to clarify, when the settradedelays is used in the code the settings in
the backtester are for no trade delays.

Code below shows how I have used the Settradedelays..

PositionSize = Close * (1200/(3*ATR(30))); //max risk/sls * close
SetOption("InitialEquity", 120000 );
SetOption("AllowPositionShrinking", True );
SetOption("MaxOpenPositions", 10 );

SetTradeDelays( 1, 1, 1, 1);

trigger = Cross(C,Ref(LLV(L,14),-1));
Cond1 = trigger;
Cond2=ATR(30)/C >.01;
Cond3=ATR(30)/C<.03;
cond4= Close > Ref(HHV(Close,20),-1)-5*ATR(30);
Cond5=MA(C,200)>Ref(MA(C,200),-50) + 6*ATR(200) ;
cond7=MA(C,21)*MA(V,21)>200000;

Buy = Cond1 AND Cond2 AND Cond3 AND Cond5 AND Cond7 AND Cond4;
SellPrice = Open;

Sell= C < Ref(LLV(C,2),-1);

Steve Carlsson
Home and Property Maintenance
12 WInsham Rd
KARRINYUP WA 6018
0432990469


__._,_.___

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




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

__,_._,___