Can be done, but not a short answer.
Try "pre-trading" it with your own variables. Then you can "watch" and see if both trades signal and either wait until they do or at least require both sides to exist before allowing your trade (e.g. myBuy = condition) to become true for the real Buy = statement. This may even require loop code.
So,
Begin loop { your trading system bar by bar myBuy = whatever myShort = whatever other tracking variables } Buy = myBuy AND myShort; //if both are True the BUY is True. Sell = ????? Short = myBuy AND myShort; Cover =
Hope you get the idea.
-- Terry -----Original Message-----
hello,
i am currently backtesting an intraday pair trading system and i have run into this little problem:
when my system triggers a signal (BUY stockA and SHORT stockB) sometimes one of the two stocks does not have a quote on the bar it is supposed to enter (stock without heavy volume, 1-min bars) so only one of the two actually enters the trade (which is of course a big no-no). how do i tell my system to respect the set trade delay, but if there is no quote enter on the next quote after the trigger has been pulled?
dirk
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 other support material please check also: http://www.amibroker.com/support.html
SPONSORED LINKS
YAHOO! GROUPS LINKS
__,_._,___
Get your email and more, right on the new Yahoo.com |