Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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.
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;
}
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;
}
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 ...