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

Re: Trendline, in over my head



PureBytes Links

Trading Reference Links

BarsSince(s) does not spefify an event. S is a value so BarsSince(s) 
does not have a good reference to start from.

Try Bars = Peakbars(Close,...) same patameters you had for s=Peak
(...), then 

use Bars the way you want to..

Ara 
--- In amibroker@xxxx, "wdbaker8" <wdbaker8@xxxx> wrote:
> Graham,
> Not sure how that is supposed to be, I tried it though in the 3 
> barssince() that I am using and still returned no results.
> 
> Thanks
> wdbaker
> --- In amibroker@xxxx, kaveman <kavemanperth@xxxx> wrote:
> > Shouldn't Barssince(s) be Barssince(S==1)
> > Graham
> > 
> > ----- Original Message -----
> > From: "wdbaker8" <wdbaker8@xxxx>
> > Date: Monday, October 21, 2002 11:41 am
> > Subject: [amibroker] Re: Trendline, in over my head
> > 
> > > <html><body>
> > > 
> > > 
> > > <tt>
> > > Ara,
> > > 
> > > I checked the filter, it is ok, the problem is the barssince()
> > > 
> > > When I replace barssince() with an actual value it works fine, 
> but 
> > > I 
> > > 
> > > need the value to vary, thats why I was trying to use the 
> > > barssince 
> > > 
> > > so that it would give me varying counts to divide by. Here is 
an 
> > > 
> > > example of what did work, maybe someone knows of a different 
> > > function 
> > > 
> > > to use other than barssince or a different way to use it.
> > > 
> > > Below you can see that I removed the (BarsSince(s)-BarsSince
(t)) 
> > > and 
> > > 
> > > placed a 10 there. Same with the one below it. Trying to 
> calculate 
> > > 
> > > the slope as it changes.
> > > 
> > > 
> > > 
> > > Thanks
> > > 
> > > wdbaker
> > > 
> > > Example that worked:
> > > 
> > > Filter=TimeNum()&gt;080000 AND TimeNum()<=150000;
> > > 
> > > PositionSize=2500;
> > > 
> > > s=Peak(Close,.01,3);
> > > 
> > > t=Peak(Close,.01,2);
> > > 
> > > 
> > > 
> > > slope=(t-s)/10;//(BarsSince(s)-BarsSince(t));//
> > > 
> > > slope2=(C-s)/16;//BarsSince(s);
> > > 
> > > test1=slope2<slope and s&gt;t;
> > > 
> > > Buy=Filter AND test1;
> > > 
> > > Sell=TimeNum()&gt;150000;
> > > 
> > > 
> > > 
> > > 
> > > 
> > > Short=0;//Filter AND test2;
> > > 
> > > Cover=0;//test4 OR TimeNum()&gt;150000;
> > > 
> > > 
> > > 
> > > --- In amibroker@xxxx, &quot;akaloustian&quot; <ara1@xxxx wrote:
> > > 
> > > &gt; Not sure, but the word &quot;Filter&quot; may be used 
> > > improperly because it's 
> > > 
> > > a 
> > > 
> > > &gt; reserved word, so Buy = Filter and ... may be a problem. 
> Just 
> > > pick 
> > > 
> > > &gt; any other word.
> > > 
> > > &gt; 
> > > 
> > > &gt; Ara
> > > 
> > > &gt; 
> > > 
> > > &gt; --- In amibroker@xxxx, &quot;wdbaker8&quot; 
> > > <wdbaker8@xxxx wrote:
> > > 
> > > &gt; &gt; Ara,
> > > 
> > > &gt; &gt; thanks, you are correct, I have changed this below.
> > > 
> > > &gt; &gt; It still doesn't produce any results on a backtest 
> though,
> > > 
> > > &gt; &gt; so still looking for more ideas. If I can get it to 
> > > produce any 
> > > 
> > > &gt; &gt; results, then I can look at that and work from there.
> > > 
> > > &gt; &gt; 
> > > 
> > > &gt; &gt; thanks
> > > 
> > > &gt; &gt; wdbaker
> > > 
> > > &gt; &gt; Filter=TimeNum()&gt;=080000 AND TimeNum()<=150000; 
> > > 
> > > &gt; &gt; PositionSize=2500;
> > > 
> > > &gt; &gt; s=Peak(Close,.01,3);
> > > 
> > > &gt; &gt; t=Peak(Close,.01,2);
> > > 
> > > &gt; &gt; slope=(t-s)/(BarsSince(s)-BarsSince(t));
> > > 
> > > &gt; &gt; slope2=(C-s)/BarsSince(s);
> > > 
> > > &gt; &gt; test1=slope2<slope AND s&gt;t; 
> > > 
> > > &gt; &gt; Buy=Filter AND test1;
> > > 
> > > &gt; &gt; Sell=TimeNum()&gt;150000;
> > > 
> > > &gt; &gt; 
> > > 
> > > &gt; &gt; Short=0;
> > > 
> > > &gt; &gt; Cover=0;
> > > 
> > > &gt; &gt; --- In amibroker@xxxx, &quot;akaloustian&quot; 
> > > <ara1@xxxx wrote:
> > > 
> > > &gt; &gt; &gt; Seems like C is generally less than s or t, 
since 
> s 
> > > and t are 
> > > 
> > > &gt; &gt; defined 
> > > 
> > > &gt; &gt; &gt; as peaks, so slope2 will generally be less than 
> slope.
> > > 
> > > &gt; &gt; &gt; 
> > > 
> > > &gt; &gt; &gt; You may find some otherwise if you use a sizable 
> > > data set. 
> > > 
> > > &gt; &gt; &gt; 
> > > 
> > > &gt; &gt; &gt; Suggest you plot the zig-zag function to see 
where 
> > > the peaks 
> > > 
> > > are 
> > > 
> > > &gt; to 
> > > 
> > > &gt; &gt; &gt; get a feel for what is going on...
> > > 
> > > &gt; &gt; &gt; 
> > > 
> > > &gt; &gt; &gt; Ara
> > > 
> > > &gt; &gt; &gt; 
> > > 
> > > &gt; &gt; &gt; --- In amibroker@xxxx, &quot;wdbaker8&quot; 
> > > <wdbaker8@xxxx wrote:
> > > 
> > > &gt; &gt; &gt; &gt; All,
> > > 
> > > &gt; &gt; &gt; &gt; Attempting to figure out how to use the 
slope 
> > > between two 
> > > 
> > > past 
> > > 
> > > &gt; &gt; &gt; points 
> > > 
> > > &gt; &gt; &gt; &gt; and then buy when the slope between the 
> > > farthest point and 
> > > 
> > > the 
> > > 
> > > &gt; &gt; &gt; &gt; current close becomes less than the slope 
> > > between the 
> > > 
> > > original 
> > > 
> > > &gt; &gt; two 
> > > 
> > > &gt; &gt; &gt; &gt; points, I'm not getting any errors, just 
not 
> > > getting anything 
> > > 
> > > &gt; at 
> > > 
> > > &gt; &gt; &gt; &gt; all. Thought maybe there was an obvious 
> problem.
> > > 
> > > &gt; &gt; &gt; &gt; 
> > > 
> > > &gt; &gt; &gt; &gt; Thanks for reviewing this and before you 
ask,
> > > 
> > > &gt; &gt; &gt; &gt; I never finished high school so the slope 
> > > equations etc... 
> > > 
> > > &gt; could 
> > > 
> > > &gt; &gt; be 
> > > 
> > > &gt; &gt; &gt; &gt; wrong.
> > > 
> > > &gt; &gt; &gt; &gt; 
> > > 
> > > &gt; &gt; &gt; &gt; Thanks
> > > 
> > > &gt; &gt; &gt; &gt; Bill Baker
> > > 
> > > &gt; &gt; &gt; &gt; Filter=TimeNum()&gt;=080000 AND 
> > > TimeNum()<=150000; 
> > > 
> > > &gt; &gt; &gt; &gt; PositionSize=2500;
> > > 
> > > &gt; &gt; &gt; &gt; s=Peak(Close,.01,3);
> > > 
> > > &gt; &gt; &gt; &gt; t=Peak(Close,.01,2);
> > > 
> > > &gt; &gt; &gt; &gt; 
> > > 
> > > &gt; &gt; &gt; &gt; slope=(t-s)/(BarsSince(s)-BarsSince(t));
> > > 
> > > &gt; &gt; &gt; &gt; slope2=(C-s)/BarsSince(s);
> > > 
> > > &gt; &gt; &gt; &gt; test1=slope2&gt;slope AND s&gt;t; 
> > > 
> > > &gt; &gt; &gt; &gt; Buy=Filter AND test1;
> > > 
> > > &gt; &gt; &gt; &gt; Sell=TimeNum()&gt;150000;
> > > 
> > > &gt; &gt; &gt; &gt; 
> > > 
> > > &gt; &gt; &gt; &gt; 
> > > 
> > > &gt; &gt; &gt; &gt; Short=0;
> > > 
> > > &gt; &gt; &gt; &gt; Cover=0;
> > > 
> > > 
> > > 
> > > </tt>
> > > 
> > > 
> > > 
> > > 
> > > <!-- |**|begin egp html banner|**| -->
> > > 
> > > <table border=0 cellspacing=0 cellpadding=2>
> > > <tr bgcolor=#FFFFCC>
> > > <td align=center><font size="-1" color=#003399><b>Yahoo! Groups 
> > > Sponsor</b></font></td></tr>
> > > <tr bgcolor=#FFFFFF>
> > > <td align=center width=470><table border=0 cellpadding=0 
> > > cellspacing=0><tr><td align=center><font face=arial
> > > size=-2>ADVERTISEMENT</font>
> > > <img 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > >
> > 
> 
src="http://ad.doubleclick.net/ad/N879.ameritrade.yahoo/B1054521.11;sz
> =300x250;adc=ZHS;ord=1035171718?"
> > alt="" width="300"
> > height="250"border="0"></td></tr></table></td></tr><tr><td><img 
> alt=""
> > width=1 height=1
> > src="http://us.adserver.yahoo.com/l?
> 
M=219695.2310151.3725769.1980433/D=egroupmail/S=:HM/A=1226184/rand=899
> 086985"></td></tr></table><!--
> > |**|end egp html banner|**| -->
> > > 
> > > <tt>
> > > Post AmiQuote-related messages ONLY to: amiquote@xxxx 
> > > 
> > > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > > 
> > > 
> > > 
> > > Check group FAQ at: 
> > > http://groups.yahoo.com/group/amibroker/files/groupfaq.html</tt>
> > > 
> > > 
> > > 
> > > 
> > > <tt>Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
> > > Service.</tt></br>
> > > 
> > > </body></html>
> > > 
> > > 
> > 
> > ----------------
> > Powered by telstra.com