NexusFi: Find Your Edge


Home Menu

 





afl to dll


Discussion in Platforms and Indicators

Updated
      Top Posters
    1. looks_one badabingbadaboom with 6 posts (0 thanks)
    2. looks_two Big Mike with 2 posts (0 thanks)
    3. looks_3 sr114 with 2 posts (0 thanks)
    4. looks_4 murtiabcde with 2 posts (0 thanks)
    1. trending_up 13,218 views
    2. thumb_up 2 thanks given
    3. group 5 followers
    1. forum 14 posts
    2. attach_file 4 attachments




 
Search this Thread

afl to dll

  #1 (permalink)
sr114
Kolkata+India
 
Posts: 27 since Aug 2012
Thanks Given: 10
Thanks Received: 1

Hello Forum

is there any easy way to convert the afl to a dll or plugin?

can any 1 elaborate the process of the conversion?

what 1 have to do for this conversion?

regards and thanks
sr

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Request for MACD with option to use different MAs for fa …
NinjaTrader
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
67 thanks
Battlestations: Show us your trading desks!
48 thanks
NexusFi site changelog and issues/problem reporting
47 thanks
GFIs1 1 DAX trade per day journal
32 thanks
What percentage per day is possible? [Poll]
31 thanks

  #2 (permalink)
colion
Asheville, North Carolina
 
Posts: 24 since Sep 2010
Thanks Given: 1
Thanks Received: 15

Download the SDK (software development kit). The Users Guide has some helpful information and you can get more by joining the AmiBroker DLL Yahoo Group.

Reply With Quote
The following 2 users say Thank You to colion for this post:
  #3 (permalink)
sr114
Kolkata+India
 
Posts: 27 since Aug 2012
Thanks Given: 10
Thanks Received: 1


deleted - duplicate post

Reply With Quote
  #4 (permalink)
 badabingbadaboom 
London/UK
 
Posts: 56 since Apr 2013


sr114 View Post
Hello Forum

is there any easy way to convert the afl to a dll or plugin?

can any 1 elaborate the process of the conversion?

what 1 have to do for this conversion?

regards and thanks
sr


Learn C/C++/.NET
There are AmiBroker SDKs for all those languages.
As a tool for creation you would need MS Visual Studio or some free ones.

Reply With Quote
  #5 (permalink)
 badabingbadaboom 
London/UK
 
Posts: 56 since Apr 2013

As I'm not good in C/C++ here is a simple example showing the difference between AFL and .NET for AmiBroker.

The code plots a simple price graph plus simple title.

First pic shows AFL version second one shows the same in C#. To plot the C# example after compilation one just needs to call PlottestProc(); in AFL.

As you can see in the example there is not much difference between both versions.

Attached Thumbnails
Click image for larger version

Name:	AFL.png
Views:	321
Size:	5.6 KB
ID:	107432   Click image for larger version

Name:	c#.png
Views:	305
Size:	10.6 KB
ID:	107433  
Reply With Quote
  #6 (permalink)
murtiabcde
jakarta+indonesia
 
Posts: 2 since Apr 2013
Thanks Given: 0
Thanks Received: 0


sr114 View Post
Hello Forum

is there any easy way to convert the afl to a dll or plugin?

can any 1 elaborate the process of the conversion?

what 1 have to do for this conversion?

regards and thanks
sr

I want to convert afl programming to DLL(C++ programming)

// Trendlines AFL code by Edward Pottasch, Mar 2013
xx=BarIndex();x=xx;Lx=LastValue(x);
nbar=Param("N Pivot Bars",5,2,50,1);
npiv=Param("number of pivots",2,1,5,1);
tf=Param("Time Frame (min)",1,1,10080,1);tfrm=in1Minute*tf;
CleanPivots=ParamToggle("Filter Pivots","No|Yes",1);
PivotSymmetry=ParamToggle("Symmetric Pivots","No|Yes",0);

TimeFrameSet(tfrm);
if(PivotSymmetry)
{
fc=1;
pk=H>Ref(HHV(H,nbar*fc),-1) AND Ref(HHV(H,nbar),nbar)<=H;
tr=L<Ref(LLV(L,nbar*fc),-1) AND Ref(LLV(L,nbar),nbar)>=L;
}
else
{
fc=2;
pk=H>Ref(HHV(H,nbar*fc),-1) AND Ref(HHV(H,nbar),nbar)<=H;
tr=L<Ref(LLV(L,nbar*fc),-1) AND Ref(LLV(L,nbar),nbar)>=L;
}
px0=ValueWhen(pk,x,0); tx0=ValueWhen(tr,x,0);
px1=ValueWhen(pk,x,1); tx1=ValueWhen(tr,x,1);
px2=ValueWhen(pk,x,2); tx2=ValueWhen(tr,x,2);
ph0=ValueWhen(pk,H,0); tl0=ValueWhen(tr,L,0);
ph1=ValueWhen(pk,H,1); tl1=ValueWhen(tr,L,1);
ph2=ValueWhen(pk,H,2); tl2=ValueWhen(tr,L,2);

if(CleanPivots)
{
pk=IIf((ph0>=ph1 AND tx0>px0 AND px0!=px1)
OR (ph1<ph2 AND px2>tx1)
OR (ph0>=ph1 AND tx0<px0 AND tx0==tx1 AND px0!=px1)
,False,pk);
tr=IIf((tl0<=tl1 AND px0>tx0 AND tx0!=tx1)
OR (tl1>tl2 AND tx2>px1)
OR (tl0<=tl1 AND px0<tx0 AND px0==px1 AND tx0!=tx1)
,False,tr);
}

pkh=IIf(pk,H,Null);trl=IIf(tr,L,Null);
TimeFrameRestore();
fact=Nz(Max(tfrm/60,Interval()/60)/(Interval()/60));
if(fact==0)fact=1;
Lkbk=Nz(tfrm/Interval());
if(Lkbk>1)
{
pk=TimeFrameExpand(pk,tfrm,expandFirst);
pkh=TimeFrameExpand(pkh,tfrm,expandFirst);
pkhs=IIf(!IsEmpty(pkh),1,0);pkhs=pkhs-Ref(pkhs,-1);
pk=pk AND H==pkh;
cond1=Sum(pk,BarsSince(pkhs==1)+1)==1 AND pk;
pk=pk AND cond1;

tr=TimeFrameExpand(tr,tfrm,expandFirst);
trl=TimeFrameExpand(trl,tfrm,expandFirst);
trls=IIf(!IsEmpty(trl),1,0);trls=trls-Ref(trls,-1);
tr=tr AND L==trl;
cond1=Sum(tr,BarsSince(trls==1)+1)==1 AND tr;
tr=tr AND cond1;
}

SetChartOptions(0,chartShowDates);
SetBarFillColor(IIf(C>O,colorBrightGreen,IIf(C<=O,colorRed,colorLightGrey)));
Plot(C,"\nPrice",IIf(C>O,ColorRGB(0,255,0),IIf(C<=O,ColorRGB(255,0,0),colorLightGrey)),64,0,0,0,0);
PlotShapes(shapeSmallCircle*tr,colorGreen,0,L,-10);
PlotShapes(shapeSmallCircle*pk,colorRed,0,H,10);

for (i=1;i<=npiv;i++)
{
y0=ValueWhen(tr,L,i-1);
y1=ValueWhen(tr,L,i);
x0=ValueWhen(tr,xx,i-1);
x1=ValueWhen(tr,xx,i);
aa=(y0-y1)/(x0-x1);
ls1=aa*(xx-x1)+y1;
dls1=ls1-Ref(ls1,-1);
ls1=IIf(dls1<0,Null,ls1);
if(i==1) Plot(ls1,"",colorBrightGreen,styleLine|styleNoRescale,0,0,0,1);
if(i>1)
{
ls1=IIf(tr,Null,ls1);
Plot(ls1,"",colorDarkGreen,styleNoLine|styleDots|styleThick|styleNoRescale,0,0,0,1);
}
y0=ValueWhen(pk,H,i-1);
y1=ValueWhen(pk,H,i);
x0=ValueWhen(pk,xx,i-1);
x1=ValueWhen(pk,xx,i);
aa=(y0-y1)/(x0-x1);
hs1=aa*(xx-x1)+y1;
dhs1=hs1-Ref(hs1,-1);
hs1=IIf(dhs1>0,Null,hs1);
if(i==1) Plot(hs1,"",colorRed,styleLine|styleNoRescale,0,0,0,1);
if(i>1)
{
hs1=IIf(pk,Null,hs1);
Plot(hs1,"",colorOrange,styleNoLine|styleDots|styleThick|styleNoRescale,0,0,0,1);
}
}

Attached Files
Elite Membership required to download: afl a.docx
Reply With Quote
  #7 (permalink)
 badabingbadaboom 
London/UK
 
Posts: 56 since Apr 2013


murtiabcde View Post
I want to convert afl programming to DLL(C++ programming)

You wanna convert it. And why don't you do it then? Where is the problem? What's the message?
Why do you wanna convert it anyway? I don't see any reason for it.
Last but not least I hope you don't wanna sell it by using your own name. Don't get me wrong I don't wanna imply anything but it looks a bit suspicious to me.


Another tip, next time please use code tags to insert code. Thanks!

Reply With Quote
  #8 (permalink)
murtiabcde
jakarta+indonesia
 
Posts: 2 since Apr 2013
Thanks Given: 0
Thanks Received: 0


badabingbadaboom View Post
You wanna convert it. And why don't you do it then? Where is the problem? What's the message?
Why do you wanna convert it anyway? I don't see any reason for it.
Last but not least I hope you don't wanna sell it by using your own name. Don't get me wrong I don't wanna imply anything but it looks a bit suspicious to me.


Another tip, next time please use code tags to insert code. Thanks!

this is afl amiboker programming ,and want to convert to DLL (C++ programmig ):

// Trendlines AFL code by Edward Pottasch, Mar 2013
xx=BarIndex();x=xx;Lx=LastValue(x);
nbar=Param("N Pivot Bars",5,2,50,1);
npiv=Param("number of pivots",2,1,5,1);
tf=Param("Time Frame (min)",1,1,10080,1);tfrm=in1Minute*tf;
CleanPivots=ParamToggle("Filter Pivots","No|Yes",1);
PivotSymmetry=ParamToggle("Symmetric Pivots","No|Yes",0);

TimeFrameSet(tfrm);
if(PivotSymmetry)
{
fc=1;
pk=H>Ref(HHV(H,nbar*fc),-1) AND Ref(HHV(H,nbar),nbar)<=H;
tr=L<Ref(LLV(L,nbar*fc),-1) AND Ref(LLV(L,nbar),nbar)>=L;
}
else
{
fc=2;
pk=H>Ref(HHV(H,nbar*fc),-1) AND Ref(HHV(H,nbar),nbar)<=H;
tr=L<Ref(LLV(L,nbar*fc),-1) AND Ref(LLV(L,nbar),nbar)>=L;
}
px0=ValueWhen(pk,x,0); tx0=ValueWhen(tr,x,0);
px1=ValueWhen(pk,x,1); tx1=ValueWhen(tr,x,1);
px2=ValueWhen(pk,x,2); tx2=ValueWhen(tr,x,2);
ph0=ValueWhen(pk,H,0); tl0=ValueWhen(tr,L,0);
ph1=ValueWhen(pk,H,1); tl1=ValueWhen(tr,L,1);
ph2=ValueWhen(pk,H,2); tl2=ValueWhen(tr,L,2);

if(CleanPivots)
{
pk=IIf((ph0>=ph1 AND tx0>px0 AND px0!=px1)
OR (ph1<ph2 AND px2>tx1)
OR (ph0>=ph1 AND tx0<px0 AND tx0==tx1 AND px0!=px1)
,False,pk);
tr=IIf((tl0<=tl1 AND px0>tx0 AND tx0!=tx1)
OR (tl1>tl2 AND tx2>px1)
OR (tl0<=tl1 AND px0<tx0 AND px0==px1 AND tx0!=tx1)
,False,tr);
}

pkh=IIf(pk,H,Null);trl=IIf(tr,L,Null);
TimeFrameRestore();
fact=Nz(Max(tfrm/60,Interval()/60)/(Interval()/60));
if(fact==0)fact=1;
Lkbk=Nz(tfrm/Interval());
if(Lkbk>1)
{
pk=TimeFrameExpand(pk,tfrm,expandFirst);
pkh=TimeFrameExpand(pkh,tfrm,expandFirst);
pkhs=IIf(!IsEmpty(pkh),1,0);pkhs=pkhs-Ref(pkhs,-1);
pk=pk AND H==pkh;
cond1=Sum(pk,BarsSince(pkhs==1)+1)==1 AND pk;
pk=pk AND cond1;

tr=TimeFrameExpand(tr,tfrm,expandFirst);
trl=TimeFrameExpand(trl,tfrm,expandFirst);
trls=IIf(!IsEmpty(trl),1,0);trls=trls-Ref(trls,-1);
tr=tr AND L==trl;
cond1=Sum(tr,BarsSince(trls==1)+1)==1 AND tr;
tr=tr AND cond1;
}

SetChartOptions(0,chartShowDates);
SetBarFillColor(IIf(C>O,colorBrightGreen,IIf(C<=O,colorRed,colorLightGrey)));
Plot(C,"\nPrice",IIf(C>O,ColorRGB(0,255,0),IIf(C<=O,ColorRGB(255,0,0),colorLightGrey)),64,0,0,0,0);
PlotShapes(shapeSmallCircle*tr,colorGreen,0,L,-10);
PlotShapes(shapeSmallCircle*pk,colorRed,0,H,10);

for (i=1;i<=npiv;i++)
{
y0=ValueWhen(tr,L,i-1);
y1=ValueWhen(tr,L,i);
x0=ValueWhen(tr,xx,i-1);
x1=ValueWhen(tr,xx,i);
aa=(y0-y1)/(x0-x1);
ls1=aa*(xx-x1)+y1;
dls1=ls1-Ref(ls1,-1);
ls1=IIf(dls1<0,Null,ls1);
if(i==1) Plot(ls1,"",colorBrightGreen,styleLine|styleNoRescale,0,0,0,1);
if(i>1)
{
ls1=IIf(tr,Null,ls1);
Plot(ls1,"",colorDarkGreen,styleNoLine|styleDots|styleThick|styleNoRescale,0,0,0,1);
}
y0=ValueWhen(pk,H,i-1);
y1=ValueWhen(pk,H,i);
x0=ValueWhen(pk,xx,i-1);
x1=ValueWhen(pk,xx,i);
aa=(y0-y1)/(x0-x1);
hs1=aa*(xx-x1)+y1;
dhs1=hs1-Ref(hs1,-1);
hs1=IIf(dhs1>0,Null,hs1);
if(i==1) Plot(hs1,"",colorRed,styleLine|styleNoRescale,0,0,0,1);
if(i>1)
{
hs1=IIf(pk,Null,hs1);
Plot(hs1,"",colorOrange,styleNoLine|styleDots|styleThick|styleNoRescale,0,0,0,1);
}
}

Attached Files
Elite Membership required to download: afl a.docx
Reply With Quote
  #9 (permalink)
 badabingbadaboom 
London/UK
 
Posts: 56 since Apr 2013

Yeah, I've already got it the first time around. No reason to post the same story with same code. You want to convert it. Then go ahead, good luck and happy coding ...

Reply With Quote
  #10 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,322 since Jun 2009
Thanks Given: 33,143
Thanks Received: 101,476



badabingbadaboom View Post
Yeah, I've already got it the first time around. No reason to post the same story with same code. You want to convert it. Then go ahead, good luck and happy coding ...

Moderator Notice
Moderator Notice


We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote





Last Updated on August 14, 2016


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts