| 
Rank: Newbie
 Groups: Registered Users, SubscribersJoined: 11/27/2016(UTC)
 Posts: 1
 
 | 
            
	      
                Hi, who can help me?  I am trying to translate expert advisor formulas below to the indicator builder. But the successes tend toward zero: {-5}Se:=LastValue(FmlVar("AO GSe","GSe4"));
 zz:=C;
 If(Peak(2,zz,Se)<=Peak(3,zz,Se) AND Peak(1,zz,Se)<=Peak(2,zz,Se) AND Trough(1,zz,Se)<=Trough(2,zz,Se) AND Trough(2,zz,Se)<=Trough(3,zz,Se) AND PeakBars(1,zz,Se)>TroughBars(1,zz,Se),zz=Trough(1,zz,Se) AND BarsSince(zz=Trough(1,zz,Se))=TroughBars(1,zz,Se),0);
 
 Now, if is it true, it should returns -5.
 -2
 Se:=LastValue(FmlVar("AO GSe","GSe4"));
 zz:=C;
 If(Peak(2,zz,Se)>=Peak(1,zz,Se)  AND PeakBars(1,zz,Se)<TroughBars(1,zz,Se),zz=Peak(1,zz,Se) AND BarsSince(zz=Peak(1,zz,Se))=PeakBars(1,zz,Se),0);
 
 Now, if is it true,  it should returns -2.
 {-22}
 Se:=LastValue(FmlVar("AO GSe","GSe3"));
 SeL:=LastValue(FmlVar("AO GSe","GSe4"));
 zz:=C;
 If(If(PeakBars(1,zz,SeL)<TroughBars(1,zz,SeL),PeakBars(2,zz,Se)<=PeakBars(1,zz,SeL),PeakBars(2,zz,Se)<=TroughBars(1,zz,SeL)) AND TroughBars(4,zz,Se)<=TroughBars(1,zz,SeL) AND Trough(4,zz,Se)<=Trough(3,zz,Se) AND Trough(3,zz,Se)<=Trough(2,zz,Se) AND Peak(4,zz,Se)<=Peak(3,zz,Se) AND Peak(3,zz,Se)<=Peak(2,zz,Se) AND Peak(2,zz,Se)>=Peak(1,zz,Se) AND PeakBars(1,zz,Se)<TroughBars(1,zz,Se),zz=Peak(1,zz,Se) AND BarsSince(zz=Peak(1,zz,Se))=PeakBars(1,zz,Se),0);
 
 Now, if is it true,  it should returns -22.
 
 {-2222}
 Se:=LastValue(FmlVar("AO GSe","GSe2"));
 SeL:=LastValue(FmlVar("AO GSe","GSe3"));
 zz:=C;
 If(If(PeakBars(1,zz,SeL)<TroughBars(1,zz,SeL),PeakBars(2,zz,Se)<=PeakBars(1,zz,SeL),PeakBars(2,zz,Se)<=TroughBars(1,zz,SeL)) AND Peak(2,zz,Se)>=Peak(1,zz,Se)  AND PeakBars(1,zz,Se)<TroughBars(1,zz,Se),zz=Peak(1,zz,Se) AND BarsSince(zz=Peak(1,zz,Se))=PeakBars(1,zz,Se),0);
 
 
 Now, if is it true,  it should returns -2222. 
 
 I hope I could make my problem understandable. Thanks for your help. Best wishes.
 
 
 |