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

[amibroker] Re: Need Help Using Trendlines for Data Mining



PureBytes Links

Trading Reference Links

I've partly answered my own question with the following AFL code. It 
records the information I want, but I have more than one trendline 
drawn that I've labelled "UP" on the same chart and the script only 
uses one of the trendlines.

//----------------------------------------------------
// Exploration to record MA values at the beginning and end
// of periods where a hand drawn trendline visibly 
// approximates the MA. The idea is to measure the slope
// of the MA and record the results in an automated fashion.
//----------------------------------------------------
Buy=0;

per=50;
Lin=Study("UP");
//Cond1=NOT IsEmpty(Lin);
Cond1=NOT IsEmpty(Lin);
Cond2=IsEmpty(Ref(Lin,-1));
Cond3=IsEmpty(Lin);
Cond4=NOT IsEmpty(Ref(Lin,-1));
Cond5=Cond1 AND Cond2;
Cond6=Cond3 AND Cond4;

// The filter records the values at the begining and end of the 
// hand drawn trendlines
Filter=Cond5 OR Cond6;
NumColumns=2;
Column0=BarIndex();
Column1=MA(C,per);
Column0Name="Bar";
Column1Name="50 MA";

I thought you just needed to label each trendline with whichever 
label you want selected and the script would go and use the 
trendline information to create signals, etc.

I have the "Range" toggle set to "All Quoatations" so its not that 
I'm not looking at the proper data. What do I need to do to record 
each occurence of the data?

Thanks for any help.

-ace

--- In amibroker@xxxxxxxxxxxxxxx, "acesheet" <acesheet@xxxx> wrote:
> Hi folks,
> 
> I would like to use the Exploration function to assemble some data 
> that uses the start date and end date of a trendline that I draw 
on 
> the screen to index the actual bar that the line starts and ends 
on.
> 
> What I'm doing is measuring the slope of various timeframe moving 
> averages to develop some screening criteria. I look for a period 
> where say the 50 MA looks like a straight uptrend or downtrend 
line 
> and draw a trendline over it. I can then label that trendline as 
an 
> uptrend "UP" or "DN" for purposes of running an exploration. 
> 
> What I'd like the exploration to do is measure the duration of the 
> trendline and give me the starting and ending values of either the 
> trendline or the 50 MA at the start and end of the line.
> 
> Then I'll dump that data into Excel for further analysis.
> 
> I'm not sure IF this can even be done using Exploration, so that's 
> my first question. The second is how to actually go about it.
> 
> Thanks fro any help.
> 
> -ace


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Low on Ink? Get 80% off inkjet cartridges & Free Shipping at 77Colors.com.
We have your brand: HP, Epson, Lexmark, Canon, Compaq and more!
http://www.c1tracking.com/l.asp?cid=5981
http://us.click.yahoo.com/DmnqpB/IyhGAA/ySSFAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/