logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Borsatrader  
#1 Posted : Sunday, November 27, 2016 6:15:31 PM(UTC)
Borsatrader

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 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.


cracker  
#2 Posted : Monday, November 28, 2016 7:22:26 AM(UTC)
cracker

Rank: Newbie

Groups: Registered, Registered Users
Joined: 5/19/2006(UTC)
Posts: 7

Was thanked: 1 time(s) in 1 post(s)
Each of your codes returns N/A, 0 or 1. Multiply this by what you expect to get, say -5then you will return N/A, 0, or -5.

e.g.

Code:

{-5}
Se:=LastValue(FmlVar("AO GSe","GSe4"));
zz:=C; -5 * 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);


As for the logic.... :-(

Edited by user Monday, November 28, 2016 7:24:55 AM(UTC)  | Reason: Not specified

Borsatrader2  
#3 Posted : Wednesday, November 30, 2016 8:19:08 PM(UTC)
Borsatrader2

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 11/30/2016(UTC)
Posts: 2

Hi Cracker,

 

at first: A completely other question:

I could not find where I insert my password in this forum. I must registed me once again.

Can you send me an Email to this adres: gnufix@googlemail.com


and at second: thank you very much for your answer. Yes, your code works; but not in the same name of the indicator in the indicator builder. An another interesting question for me is, how can I integrate the formulas in the explorer for analizing, explorating.

 

I know, many quistions at once. But thanks again, Cracker.
Borsatrader2  
#4 Posted : Wednesday, November 30, 2016 8:37:12 PM(UTC)
Borsatrader2

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 11/30/2016(UTC)
Posts: 2

Hi Cracker,

 

at first: A completely other question:

I could not find where I insert my password in this forum. I must registed me once again.

Can you send me an Email to this adres: gnufix@googlemail.com


and at second: thank you very much for your answer. Yes, your code works; but not in the same name of the indicator in the indicator builder. An another interesting question for me is, how can I integrate the formulas in the explorer for analizing, explorating.

 

I know, many quistions at once. But thanks again, Cracker.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.