I have a system which trades the S&P 500. It Buys on the Open and sells on a later day at a Limit. I want MaxOpenPositions=5.
But the backtester counts the Sell at Limit trades as available equity and therefore allows the Buy on Open trades. Unfortunately the Limit trades almost always occur After the Open.
If I sell at Limit I may not have funds until the Limit is reached. But backtester allows me to buy at the Open.
I have tried everything I can think of and searched everywhere, but I am stuck. Any suggestions? Thanks, Balin.
I have the following code:
SetOption ("MaxOpenPositions",5);
SetOption ("UsePrevBarEquityforPosSizing",False);
SetOption ("ActivateStopsImmediately", True ) ;
SetTradeDelays ( 1,0, 0, 0 ) ;
SetOption ("AllowPositionShrinking", False ) ;
SetOption ("InitialEquity", 50000 ) ;
SetOption ("AllowSameBarExit", False);
PositionSize = (-20);
Buy="My condition";
BuyPrice = Open;
Sell=H>="My Limit Price";
SellPrice=Max(O,"My Limit Price");
Equity(1);
__._,_.___
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
SPONSORED LINKS
__,_._,___
|