Australian (ASX) Stock Market Forum

Amibroker: Re-Entry Delay - For trades NOT stops?

Joined
10 December 2011
Posts
1
Reactions
0
Hi All,

I'm trying to test a system that trades both long and short. I don't want the system to enter a trade on the same bar it exits a trade on. I have my AFL set as follows:

SetTradeDelays( 1, 1, 1, 1 );
BuyPrice = O;
SellPrice = O;
ShortPrice = O;
CoverPrice = O;

Unfortunately, when I backtest, I often see a long exited and a short entered on the same bar.

I know there is a way to delay re-entry based on stops, but how do I prevent re-entry based on trades?

I want the system to wait until the next bar after a trade has been completed before entering another trade.

Thanks in advance for your help!

: )
 
I did try that option, but it doesn't seem to work for entry. So if I have a exit comes before entry, the entry will still get opened.

Any idea?
 
I did try that option, but it doesn't seem to work for entry. So if I have a exit comes before entry, the entry will still get opened.

Any idea?

Would something like this work:-

Entry1 = XL;
Exit1 = YL;
Entry2 = XS;
Exit2 = YS;
Buy = Entry1 AND Exit2<>1;
Sell = Exit1 AND Entry2<>1;
 
I did try that option, but it doesn't seem to work for entry. So if I have a exit comes before entry, the entry will still get opened.

Any idea?

If you're using the Applystop function for exits then a re-entry delay is one of the fields.

If you're using looping to control your entries and exits then you'll need to include re-entry delays into your looping code.
 
Top