Please convert the following metastock formula in amibroker afl .

casoni

Well-Known Member
#11
Bro Triangles r different Than the tirades he mentioned here.
Even the logic of the code is different than that of triangles
Ohhh .... i thought he is looking for triangles
 

cloudTrader

Well-Known Member
#13
Dear Extremist ,

Plz. refer to the image below :



I used afl only for descending Triads and the chart looked like the above image which I have uploaded.

I used the ascending Triads as well and the result was similar chart with red dots.

Is it only with me ?

Thanks.
 

extremist

Well-Known Member
#14
Dear Extremist ,

Plz. refer to the image below :



I used afl only for descending Triads and the chart looked like the above image which I have uploaded.

I used the ascending Triads as well and the result was similar chart with red dots.

Is it only with me ?

Thanks.
Bro insert the indicator in the new pan bellow

Or the better option is look the post bellow
 
Last edited:

extremist

Well-Known Member
#15
To match the Code out put to the image sumit had posted I needed to invert the color from ascending to descending.

May be sumit know how to use this.



Code:
_SECTION_BEGIN("Triades");
// Converted by : Extremist
m1 = H<Ref(H,-1) AND L<Ref(L,-1);
m2 = H<Ref(H,-2) AND L<Ref(L,-2) AND H>Ref(H,-1)AND L<Ref(L,-1);
m3 =H<Ref(H,-3) AND L<Ref(L,-3) AND H>Ref(H,-2) AND L<Ref(L,-2) AND H>Ref(H,-1) AND L<Ref(L,-1);
marka = m1 OR m2 OR m3;
set = L >ValueWhen(marka,L) AND H>ValueWhen(marka,H) AND LowestSince(Ref(marka,-1),L) > ValueWhen(marka,L);

sig=0;
sig = Iif(marka,1, Iif(set,0,Ref(sig,-1)));

m1 = H>Ref(H,-1) AND L>Ref(L,-1);
m2 = H>Ref(H,-2) AND L>Ref(L,-2) AND H>Ref(H,-1) AND L<Ref(L,-1);
m3 = H>Ref(H,-3) AND L>Ref(L,-3) AND H>Ref(H,-2) AND L<Ref(L,-2) AND H>Ref(H,-1) AND L<Ref(L,-1);
markd = m1 OR m2 OR m3;
set =L<ValueWhen(markd,L) AND H<ValueWhen(markd,H) AND HighestSince(Ref(markd,-1) , H) < ValueWhen(markd,H);
sig=0;
sig = Iif(markd,1, Iif(set, 0, Ref(sig,-1)));

dec= ExRem(markd,marka);
ace= ExRem(marka,markd);
Coloro=IIf( ace, colorred, IIf(dec, colorbrightgreen,null ));
setbarfillcolor(IIf( ace, colorred, IIf( dec, colorbrightgreen,colorBlack )));
Plot( C, "Close", coloro, styleNoTitle | GetPriceStyle() ); 
_SECTION_END();
 

amitrandive

Well-Known Member
#16
To match the Code out put to the image sumit had posted I needed to invert the color from ascending to descending.

May be sumit know how to use this.



Code:
_SECTION_BEGIN("Triades");
// Converted by : Extremist
m1 = H<Ref(H,-1) AND L<Ref(L,-1);
m2 = H<Ref(H,-2) AND L<Ref(L,-2) AND H>Ref(H,-1)AND L<Ref(L,-1);
m3 =H<Ref(H,-3) AND L<Ref(L,-3) AND H>Ref(H,-2) AND L<Ref(L,-2) AND H>Ref(H,-1) AND L<Ref(L,-1);
marka = m1 OR m2 OR m3;
set = L >ValueWhen(marka,L) AND H>ValueWhen(marka,H) AND LowestSince(Ref(marka,-1),L) > ValueWhen(marka,L);

sig=0;
sig = Iif(marka,1, Iif(set,0,Ref(sig,-1)));

m1 = H>Ref(H,-1) AND L>Ref(L,-1);
m2 = H>Ref(H,-2) AND L>Ref(L,-2) AND H>Ref(H,-1) AND L<Ref(L,-1);
m3 = H>Ref(H,-3) AND L>Ref(L,-3) AND H>Ref(H,-2) AND L<Ref(L,-2) AND H>Ref(H,-1) AND L<Ref(L,-1);
markd = m1 OR m2 OR m3;
set =L<ValueWhen(markd,L) AND H<ValueWhen(markd,H) AND HighestSince(Ref(markd,-1) , H) < ValueWhen(markd,H);
sig=0;
sig = Iif(markd,1, Iif(set, 0, Ref(sig,-1)));

dec= ExRem(markd,marka);
ace= ExRem(marka,markd);
Coloro=IIf( ace, colorred, IIf(dec, colorbrightgreen,null ));
setbarfillcolor(IIf( ace, colorred, IIf( dec, colorbrightgreen,colorBlack )));
Plot( C, "Close", coloro, styleNoTitle | GetPriceStyle() ); 
_SECTION_END();
Trading triads
https://www.youtube.com/watch?v=xROXCVxsJs0
 
#17
To match the Code out put to the image sumit had posted I needed to invert the color from ascending to descending.

May be sumit know how to use this.



Code:
_SECTION_BEGIN("Triades");
// Converted by : Extremist
m1 = H<Ref(H,-1) AND L<Ref(L,-1);
m2 = H<Ref(H,-2) AND L<Ref(L,-2) AND H>Ref(H,-1)AND L<Ref(L,-1);
m3 =H<Ref(H,-3) AND L<Ref(L,-3) AND H>Ref(H,-2) AND L<Ref(L,-2) AND H>Ref(H,-1) AND L<Ref(L,-1);
marka = m1 OR m2 OR m3;
set = L >ValueWhen(marka,L) AND H>ValueWhen(marka,H) AND LowestSince(Ref(marka,-1),L) > ValueWhen(marka,L);

sig=0;
sig = Iif(marka,1, Iif(set,0,Ref(sig,-1)));

m1 = H>Ref(H,-1) AND L>Ref(L,-1);
m2 = H>Ref(H,-2) AND L>Ref(L,-2) AND H>Ref(H,-1) AND L<Ref(L,-1);
m3 = H>Ref(H,-3) AND L>Ref(L,-3) AND H>Ref(H,-2) AND L<Ref(L,-2) AND H>Ref(H,-1) AND L<Ref(L,-1);
markd = m1 OR m2 OR m3;
set =L<ValueWhen(markd,L) AND H<ValueWhen(markd,H) AND HighestSince(Ref(markd,-1) , H) < ValueWhen(markd,H);
sig=0;
sig = Iif(markd,1, Iif(set, 0, Ref(sig,-1)));

dec= ExRem(markd,marka);
ace= ExRem(marka,markd);
Coloro=IIf( ace, colorred, IIf(dec, colorbrightgreen,null ));
setbarfillcolor(IIf( ace, colorred, IIf( dec, colorbrightgreen,colorBlack )));
Plot( C, "Close", coloro, styleNoTitle | GetPriceStyle() ); 
_SECTION_END();

many thanks extremist . does the job perfectly

best regards



sumit
 

Similar threads