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

[amibroker] Re: Strange error on simple strat



PureBytes Links

Trading Reference Links



Still stuck on thsi issue. The first system buys on a down close and shorts on up close. The second one does the exact opposite. Why does the first system work correctly, but the second one only enters one side of the trade (either buy or short, depending on ticker)???

System 1:

Buy = 0;
Short = 0;
Sell = 0;
Cover = 0;
BuyPrice = C;
ShortPrice = C;
SetTradeDelays(0,0,0,0);
SetPositionSize( 100, spsPercentOfEquity );
Buy = C < Ref(C,-1);
Short = C >= Ref(C,-1);


Systems 2:

Buy = 0;
Short = 0;
Sell = 0;
Cover = 0;
BuyPrice = C;
ShortPrice = C;
SetTradeDelays(0,0,0,0);
SetPositionSize( 100, spsPercentOfEquity );
Buy = C >= Ref(C,-1);
Short = C < Ref(C,-1);





--- In amibroker@xxxxxxxxxxxxxxx, "lucianomt" <lucianomt@xxx> wrote:
>
> That's not it. My backtest is set to "close out positions if a reverse signal" is triggered. (I've tried to insert the Sell/Cover orders explicitly to the same results). Also note that when I reverse the Buy and Short orders, it works fine.
>
> Any thoughts?
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Joe" j0etr4der@ wrote:
> >
> > You are putting 100% into the first trade, so there will not be another trade opened until that trade is closed. Since you don't have a Sell or Cover, whichever comes first, Buy or Short is the only action that is going to take place.
> >
> > Joe
> >
> > --- In amibroker@xxxxxxxxxxxxxxx, "lucianomt" <lucianomt@> wrote:
> > >
> > > I created a simple strategy to measure follow-through:
> > >
> > > Buy = 0;
> > > Short = 0;
> > > Sell = 0;
> > > Cover = 0;
> > > BuyPrice = C;
> > > ShortPrice = C;
> > > SetTradeDelays(0,0,0,0);
> > > SetPositionSize( 100, spsPercentOfEquity );
> > > Buy = C >= Ref(C,-1);
> > > Short = C < Ref(C,-1);
> > >
> > > Strangely, the backtest is only registering the Short trades. No Buys. Even more strangely, when I invert the Buy and Short orders (Short = C >= Ref(C,-1); Buy = C < Ref(C,-1)), the backtest works fine.
> > >
> > > Am I doing something wrong?
> > >
> >
>


__._,_.___


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

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





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

__,_._,___