PDA

View Full Version : GP_Trendlines AmiBroker Plugin and AFL Files



GreatPig
26th-July-2005, 10:52 PM
Here is the trend line drawing plugin for AmiBroker and AFL code to use it. Instructions are included in a PDF file as well as at the start of each AFL file.

While I think it works reasonably well now (although the backtester is pretty slow), I'll probably keep working on it and updating it here occasionally.

You are free to use it for personal, non-commercial use, and all use is at your own risk. While I haven't had any problems yet, I can't guarantee that there aren't any bugs in the DLL.

Any feedback welcome.

Cheers,
GP

wayneL
26th-July-2005, 11:17 PM
Thanks for sharing your work GP :)

RichKid
26th-July-2005, 11:32 PM
It's very decent of you GP to share the fruits of your labours, even though I have no idea what this coding stuff is I'm sure you've saved a lot of people a lot of trouble. Keep it up! It's very considerate and in the right spirit imo. Traders helping Traders, sounds nice.

Milk Man
27th-July-2005, 07:20 AM
THREE CHEERS FOR GREATPIG!

HIP HIP......

dutchie
27th-July-2005, 07:44 AM
GP -I have not used it yet but it looks very useful.
Thanks very much for sharing this with everyone.

Milk Man
27th-July-2005, 09:47 AM
I'm getting a syntax error on the line-

fit = GP_DrawTrendLines(Bottom, Top, 2, startIx, 0, tchg, 0, closeOver, 0, isUp, Prefs(24));

and have AB 4.7.

Sorry to rain on your parade :o

GreatPig
27th-July-2005, 09:57 AM
I'm getting a syntax error on the line-

fit = GP_DrawTrendLines(Bottom, Top, 2, startIx, 0, tchg, 0, closeOver, 0, isUp, Prefs(24));

and have AB 4.7.
Hmm... I'm using 4.7 now and don't get that. Is that with the indicator or exploration - or perhaps both?

And is it using my original AFL file or have you modified it?

Just looking at it, I can't imagine why it would give a syntax error. Try changing "Prefs(24)" to either zero or one (zero for linear display or one for log), although that function still works on my version.

Anyone else tried it and is getting this error?

Cheers,
GP

kaveman
27th-July-2005, 10:03 AM
Prefs() have disappeared and no longer required

GreatPig
27th-July-2005, 10:21 AM
Prefs() have disappeared and no longer required
Okay. I'll have work out how else to find the linear/log display setting then.

Thanks.

GP

Milk Man
27th-July-2005, 10:25 AM
Dont worry- I just closed out of AB then went into it again.
:o :iamwithst

kaveman
27th-July-2005, 10:52 AM
Set chart view in the Parameters popup window
You can set a single preference in AFL using SetChartOptions

GreatPig
27th-July-2005, 12:14 PM
So you can only set the chart options, not get the current settings (ie. read the standard Axes Type parameter)?

I don't see any GetChartOptions function.

GP

kaveman
27th-July-2005, 05:38 PM
not really sure what you mean :confused:
, there is GetPriceStyle()

GreatPig
28th-July-2005, 12:35 AM
What I mean is if you set the chart linear/log setting in the Axes & Grid parameters (the one called "Type"), is it possible to read that particular setting in AFL code, similar to how Prefs(24) would read it for the main chart in 4.60 (and still does seem to in 4.70)?

Cheers,
GP

Caliente
28th-July-2005, 03:03 AM
thanks GP, using it with Ami right now :)

GreatPig
28th-July-2005, 08:40 AM
Caliente,

Hope you find it useful.

Cheers,
GP

kaveman
28th-July-2005, 08:44 AM
the original prefs all were in the preferencs for the chart & indicator settings. The majority of these are no longer in the preferences being replaced with the list of dragndrop indicator/charts. You can now set the prefs you want within the afl files for these by changing the default value in the Param statements.
Sorry did not mean that the prefs as such were not there, just not settable in preferences window.
As I have never used these myself, or any result from them I cannot comment. As far as the values of the indicator settings can be easily coded into the title line. Getting result as to if the chart is log or linear unless you have internal settings to make a value zero or null depending on if log or linear cannot see much use for it as just looking at the chart tells you what axis setting is. What purpose do you need to display the axis settings?

GreatPig
28th-July-2005, 12:07 PM
cannot see much use for it as just looking at the chart tells you what axis setting is. What purpose do you need to display the axis settings?
I don't want to display them, but I need to know the log/linear display setting to be able to draw trend lines correctly.

A straight line on a log display uses a different formula to a straight line on a linear display. If the formula doesn't match the actual mode in use, then the lines will appear curved.

Cheers,
GP

kaveman
28th-July-2005, 12:19 PM
ok wondered about that. I think the stylelog disappeared a long time ago, so prefs(24) would not provide any results now regardless
btw I found prefs still available in help files. Was surprised but guess it had to remain due to older AFL using them

perhaps an email to AB support could tell you if axis type can be detected in AFL

mavirk
29th-July-2008, 06:46 AM
You are the best. Thanks.

umesh_72
1st-March-2010, 02:34 PM
Dear GP

your posts are a great help...

I am trying to convert an AFL into a DLL File using VC++, I have been successfully do the same except for the below mentioned two codes which I am not getting. Will be very greatfull to you if you Can kindly help with a code to get these two.



1. PreviousDayClose = TimeFrameGetPrice( "C", inDaily, -1 ); // Function in AFL

2. NewDay = Day()!= Ref(Day(), -1);
FDH = HHV( H, NewDay);

Thankyou & Best Regards

VC++ Codes..

AmiVar args7[3];
args7[0].type=VAR_FLOAT;
args7[0].val=sa.Close[i];
args7[1].type=VAR_STRING;
args7[1].string="inDaily" ;
args7[2].type=VAR_FLOAT;
args7[2].val= -1;


AmiVar PDC;

PDC=gSite.CallFunction("TimeFrameGetPrice",3,args7);
gSite.SetVariable("PDC", PDC);

Getting ERROR ::

How to solve this problem.

Today = gSite.CallFunction("day",0,NULL);



AmiVar ref_Today=gSite.AllocArrayResult();;
ref_Today=VRef(-1,Today.array);
gSite.SetVariable("ref_Today",ref_Today);

BOOL NewD ;
NewD = Today.array != ref_Today.array;
FDH1 = Vhhv(sa.High, NewD);
gSite.SetVariable("FDH1", FDH1);

Getting ERROR

gorilabd
23rd-July-2010, 05:58 PM
Can any 1 code this AFL....this is the best AFL i have ever seen....

Boggo
23rd-July-2010, 06:21 PM
....this is the best AFL i have ever seen....

Best looking or best performing ?

gorilabd
23rd-July-2010, 10:29 PM
best performing bro....this afl is developed by a Bangladeshi guy.....he developed it by spending more than 2 years.....u ppl r not suppose to have this afl...thats why i was asking can any1 code this afl or not.....

Wysiwyg
23rd-July-2010, 10:46 PM
That's pretty but as Boggo typed what use is it for trading?

This site has some AFL for sale and free that anyone could try.

http://www.9trading.com/products.php

gorilabd
23rd-July-2010, 10:50 PM
i have some very good afl......this is 1 of them....

gorilabd
23rd-July-2010, 10:58 PM
hope u will like flower afl.....

Wysiwyg
23rd-July-2010, 11:10 PM
I have Pattern Explorer in AFL. Has adjustable parameters.

gorilabd
23rd-July-2010, 11:29 PM
bro what good afls do u have can u share with us??? im new in this forum.....joined today.....

Wysiwyg
23rd-July-2010, 11:36 PM
bro what good afls do u have can u share with us??? im new in this forum.....joined today.....

I have the AFL I bought and the ones available at Amibroker Library. Try http://www.wisestocktrader.com/ as they have AFL for charts too.

piash
14th-August-2010, 10:08 PM
Can any 1 code this AFL....this is the best AFL i have ever seen....

Dear gorilabd, i`m from Dhaka. An amibroker fan, even do blog on amibroker : http://tatunnel.blogspot.com. Aneway, i was very much eager to have a glance on Southbridge. Thnks for the post. Dear, would you tell me something about its performance? What are the main sections, southwind has used in the afl?

excite
21st-September-2010, 11:23 AM
I have the AFL I bought and the ones available at Amibroker Library. Try http://www.wisestocktrader.com/ as they have AFL for charts too.

WiseTrader has Toolbox for sale at US$299, have you tried the Toolbox? If yes, any comments?

topguide
1st-November-2010, 08:33 PM
Anyone know if there's a sample AFL for automated trendlines? I'm new to Amibroker and would like to get up to speed quickly. The userguide is ok for introduction but not very helpful in showing how to do automated trendlines.

Wysiwyg
2nd-November-2010, 12:03 AM
WiseTrader has Toolbox for sale at US$299, have you tried the Toolbox? If yes, any comments?Just seen your question and no I haven't tried the Toolbox though neural networks looks like an interesting path to follow.

gorilabd
16th-November-2010, 03:57 PM
Dear gorilabd, i`m from Dhaka. An amibroker fan, even do blog on amibroker : http://tatunnel.blogspot.com. Aneway, i was very much eager to have a glance on Southbridge. Thnks for the post. Dear, would you tell me something about its performance? What are the main sections, southwind has used in the afl?



Southbreeze afl is an outstanding creation of the bangladeshi afl coder Southwind....this person also developed The Foundation by Southwind v-13.00 Int which is very popular all over the world....though Zultan renamed it by Zultan foundation and flashed it in such a way that he developed it...later he agreed that he did nothing in "The Foundation by Southwind v-13.00 Int"....Southbreeze afl is very complicated and works best as far as i know...some 1 posted Southbreeze in wisestocktrader.com and many other site but that afl is nothing but a modified version of pathfinder....this afl is not yet flashed out...because there r ppl who may rename it using their name and and take credit....

dalmas
23rd-January-2012, 07:03 AM
Hello there,

has someone tried the GP_Trendline code under AB 5.40.3 ???

I had to comment it out, since it seems crashing AB. The culprit seems to be the function call, GP_DrawTrendLines(...). Up to AB 5.30.5 it worked perfectly well.
Maybe something changed in the parameter passing, but not really aware of.

GreatPig, if you still read the forum, could, you please check it ?? (Then there is a wish: have a 64 bits DLL, but it is just a wish :) )

Thanks & Regards

Marco