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

Re: [amibroker] Re: simple system coding help....



PureBytes Links

Trading Reference Links

Could you try this:
 

a=CCI(40)>0;

b=Ref(StochK(3,2),-1)> 50;

d=StochK(3,2) > Ref(StochK(3,2),-1)AND ROC(StochK(3,2),2)>0;

e=C>O;

Buy=a AND b AND d AND e;

BuyPrice=C;

Sell=BarsSince(Buy)==1;

Short = 0;

Cover = 0;

Buy=ExRem(Buy,Sell);

Sell=ExRem(Sell,Buy);

----- Original Message -----

Sent: Friday, February 27, 2009 6:47 PM
Subject: [amibroker] Re: simple system coding help....

Thanks Mike.

I'm not using trade delays but I am using exrem. However, the
barssince funcion was only used to remove more complicated sell rules
to try and isolate the fault. It is still buying when the stoch is
falling or above 50 - and surely the code as is should re ruling this
out?

You say avoid Exrem - is this in all cases or just for fixed bar
exit? Unless I'm exiting after a fixed period, is exremspan better?

I'm really confused....:-(

Thanks for any further advice....anyone?

Rich

--- In amibroker@xxxxxxxxxps.com, "Mike" <sfclimbers@...> wrote:
>
> A couple of things to consider:
>
> 1. Are you using trade delays in your AA settings?
> 2. If using BarsSince, you should probably get rid of redundancies
> first.
> 3. Avoid ExRem except for charting. Use ExRemSpan in this case (see
> doc explicitly describing how to hold for 'x' days after buy).
> http://www.amibroker.com/guide/afl/afl_view.php?id=50
>
> Mike
>
>
> --- In amibroker@xxxxxxxxxps.com, "MAVIRK" <mvirk67@> wrote:
> >
> > b = ref(stochk(3,2),-1) < 50; //and stochk(3,2) > 50;
> >
> >
> > From: foxblade2000invest
> > Sent: Friday, February 27, 2009 5:21 PM
> > To: amibroker@xxxxxxxxxps.com
> > Subject: [amibroker] simple system coding help....
> >
> >
> > Could anyone help.
> >
> > I'm playing with the following idea. The system should buy if the
> cci
> > is above zero, the stochk has risen since yesterday and was below
50
> > yesterday, and the close should be above the open.
> >
> > My code is as follows;
> >
> > a=CCI(40)>0;
> > b=50>Ref(StochK(3,2),-1);
> > d=StochK(3,2)>Ref(StochK(3,2),-1);
> > e=C>O;
> >
> > Buy=a AND b AND d AND e;
> > BuyPrice=C;
> > Sell=BarsSince(Buy)==1;
> >
> > Short = 0;
> >
> > Cover = 0;
> >
> > Buy=ExRem(Buy,Sell);
> > Sell=ExRem(Sell,Buy);
> >
> > The problem is that when backtested, trades are clearly taken
when
> > the stoch if falling and was above 50 yesterday (breaking the
> rules).
> > The only rules being observed are that the cci is positive and
the
> > close is higher than the open (a and e).
> >
> > Can anyone suggest what basic mistakes I'm making?
> >
> > All contributions welcome.
> >
> > Cheers,
> > Rich
> >
>



__._,_.___


**** 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

__,_._,___