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

Re: Trendline, in over my head



PureBytes Links

Trading Reference Links

Not sure, but the word "Filter" may be used improperly because it's a 
reserved word, so Buy = Filter and ... may be a problem. Just pick 
any other word.

Ara

--- In amibroker@xxxx, "wdbaker8" <wdbaker8@xxxx> wrote:
> Ara,
> thanks, you are correct, I have changed this below.
> It still doesn't produce any results on a backtest though,
> so still looking for more ideas. If I can get it to produce any 
> results, then I can look at that and work from there.
> 
> thanks
> wdbaker
> Filter=TimeNum()>=080000 AND TimeNum()<=150000; 
> PositionSize=2500;
> s=Peak(Close,.01,3);
> t=Peak(Close,.01,2);
> slope=(t-s)/(BarsSince(s)-BarsSince(t));
> slope2=(C-s)/BarsSince(s);
> test1=slope2<slope AND s>t; 
> Buy=Filter AND test1;
> Sell=TimeNum()>150000;
> 
> Short=0;
> Cover=0;
> --- In amibroker@xxxx, "akaloustian" <ara1@xxxx> wrote:
> > Seems like C is generally less than s or t, since s and t are 
> defined 
> > as peaks, so slope2 will generally be less than slope.
> > 
> > You may find some otherwise if you use a sizable data set. 
> > 
> > Suggest you plot the zig-zag function to see where the peaks are 
to 
> > get a feel for what is going on...
> > 
> > Ara
> > 
> > --- In amibroker@xxxx, "wdbaker8" <wdbaker8@xxxx> wrote:
> > > All,
> > > Attempting to figure out how to use the slope between two past 
> > points 
> > > and then buy when the slope between the farthest point and the 
> > > current close becomes less than the slope between the original 
> two 
> > > points, I'm not getting any errors, just not getting anything 
at 
> > > all. Thought maybe there was an obvious problem.
> > > 
> > > Thanks for reviewing this and before you ask,
> > > I never finished high school so the slope equations etc... 
could 
> be 
> > > wrong.
> > > 
> > > Thanks
> > > Bill Baker
> > > Filter=TimeNum()>=080000 AND TimeNum()<=150000; 
> > > PositionSize=2500;
> > > s=Peak(Close,.01,3);
> > > t=Peak(Close,.01,2);
> > > 
> > > slope=(t-s)/(BarsSince(s)-BarsSince(t));
> > > slope2=(C-s)/BarsSince(s);
> > > test1=slope2>slope AND s>t; 
> > > Buy=Filter AND test1;
> > > Sell=TimeNum()>150000;
> > > 
> > > 
> > > Short=0;
> > > Cover=0;