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

Notification

Icon
Error

Options
Go to last post Go to first unread
bearishbull  
#1 Posted : Tuesday, July 5, 2005 9:27:43 AM(UTC)
bearishbull

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/30/2005(UTC)
Posts: 71

ma1:= 150; ma2:= 15; ma3:= 10; ma4:= 200; eind:=19; exitlong:=Cross(Mov(C, ma2, S), C) OR (Hour() =(eind-1) AND Minute()=55); exitshort:=Cross(C, Mov(C, ma3, S))OR (Hour() =(eind-1) AND Minute()=55); buy:= Cross(Mov(C, 3, S),Mov(C, ma1, S)) AND (Hour() <= eind) and c>Mov(C, ma2, S); sell:=Cross(Mov(C, ma4, S),Mov(C, 3, S)) AND (Hour() < eind) and c<Mov(C, ma3, S); status:=If(buy,2,If(exitlong,1,If(sell,-2,If(exitshort,-1,Prev)))); EL:= status = 2 and (ref(status, -1)=1 OR ref(status, -1)=-1); ES:= status = -2 and (ref(status, -1)=1 OR ref(status, -1)=-1); XL:= status = 1 and ref(status, -1)=2; XS:=status =-1 and ref(status,-1) = -2;
what is wrong in the formule? I need only buy or sellshort signals after exit signals exitlong only afer long and exitshort only after short..why don't this work?
Patrick  
#2 Posted : Tuesday, July 5, 2005 4:49:44 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
I finally found the forumla I was talking about and posted it in the the Training Lesson 4 post. Take alook at it but I believe you need to repleace the last piece of your code with this : EL:=Cross(Status,1.5); XL:=Cross(1.5,Status) AND Ref(Status,-1)=2; ES:=Cross(-1.5,Status); XS:=Cross(Status,-1.5) AND Ref(Status,-1)=-2; Patrick :mrgreen:
bearishbull  
#3 Posted : Tuesday, July 5, 2005 5:36:12 PM(UTC)
bearishbull

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/30/2005(UTC)
Posts: 71

Patrick wrote:
I finally found the forumla I was talking about and posted it in the the Training Lesson 4 post. Take alook at it but I believe you need to repleace the last piece of your code with this : EL:=Cross(Status,1.5); XL:=Cross(1.5,Status) AND Ref(Status,-1)=2; ES:=Cross(-1.5,Status); XS:=Cross(Status,-1.5) AND Ref(Status,-1)=-2; Patrick :mrgreen:
The entry signals work perfectly now, but some exit signals don't do what they have to do. I don't get double signals but now there are apearing exit signals on places where they dn't belong, some are waaaay to early..I read the code 1000 times and it should work...don't know what's wrong :(.. edit: ok, let me explain it like this, I want the signals in the expert exactly the same as the signals in this system tester code: {buy} speling:= 0.02; eind:=19; Cross( mov(c,3,s),Mov(C, 150, S)+speling ) and (C > Mov(C, 15, S)-speling) and hour() <=eind {sell} eind:= 19; speling:= 0.02; C<Mov(C, 15, S)-0.02 or (minute() = 55 and hour() = eind-1) {sell short} speling:=0.02; eind:=19; Cross(Mov(C, 150, S)-speling , mov(c,3,s) ) and c < Mov(C, 15, S)+speling and hour() <=eind {buy to cover} eind:= 19; speling:= 0.02; C>Mov(C, 15, S)+speling or (minute() = 55 and hour() = eind-1) --- I tried it for 2 days now and it just don't work, getting frustraded right now :D
Patrick  
#4 Posted : Tuesday, July 5, 2005 6:29:26 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
Try this ... Now if it does not work tell me what chart you tried it on, what periodicity, how much data you have loaded and why it's wrong ... maybe the date and time it was wrong even. {Enter Long} speling:= 0.02; eind:=19; EL:=Cross( mov(c,3,s),Mov(C, 150, S)+speling ) and (C > Mov(C, 15, S)-speling) and hour() <=eind; XL:=C<Mov(C, 15, S)-0.02 or (minute() = 55 and hour() = eind-1); ES:=Cross(Mov(C, 150, S)-speling , mov(c,3,s) ) and c < Mov(C, 15, S)+speling and hour() <=eind; XS:=C>Mov(C, 15, S)+speling or (minute() = 55 and hour() = eind-1); status:=If(EL,2,If(XL,1,If(ES,-2,If(XS,-1,PREV)))); FEL:=Cross(Status,1.5); FXL:=Cross(1.5,Status) AND Ref(Status,-1)=2; FES:=Cross(-1.5,Status); FXS:=Cross(Status,-1.5) AND Ref(Status,-1)=-2; FEL {Exit Long} speling:= 0.02; eind:=19; EL:=Cross( mov(c,3,s),Mov(C, 150, S)+speling ) and (C > Mov(C, 15, S)-speling) and hour() <=eind; XL:=C<Mov(C, 15, S)-0.02 or (minute() = 55 and hour() = eind-1); ES:=Cross(Mov(C, 150, S)-speling , mov(c,3,s) ) and c < Mov(C, 15, S)+speling and hour() <=eind; XS:=C>Mov(C, 15, S)+speling or (minute() = 55 and hour() = eind-1); status:=If(EL,2,If(XL,1,If(ES,-2,If(XS,-1,PREV)))); FEL:=Cross(Status,1.5); FXL:=Cross(1.5,Status) AND Ref(Status,-1)=2; FES:=Cross(-1.5,Status); FXS:=Cross(Status,-1.5) AND Ref(Status,-1)=-2; FXL {Enter Short} speling:= 0.02; eind:=19; EL:=Cross( mov(c,3,s),Mov(C, 150, S)+speling ) and (C > Mov(C, 15, S)-speling) and hour() <=eind; XL:=C<Mov(C, 15, S)-0.02 or (minute() = 55 and hour() = eind-1); ES:=Cross(Mov(C, 150, S)-speling , mov(c,3,s) ) and c < Mov(C, 15, S)+speling and hour() <=eind; XS:=C>Mov(C, 15, S)+speling or (minute() = 55 and hour() = eind-1); status:=If(EL,2,If(XL,1,If(ES,-2,If(XS,-1,PREV)))); FEL:=Cross(Status,1.5); FXL:=Cross(1.5,Status) AND Ref(Status,-1)=2; FES:=Cross(-1.5,Status); FXS:=Cross(Status,-1.5) AND Ref(Status,-1)=-2; FES {Exit Short} speling:= 0.02; eind:=19; EL:=Cross( mov(c,3,s),Mov(C, 150, S)+speling ) and (C > Mov(C, 15, S)-speling) and hour() <=eind; XL:=C<Mov(C, 15, S)-0.02 or (minute() = 55 and hour() = eind-1); ES:=Cross(Mov(C, 150, S)-speling , mov(c,3,s) ) and c < Mov(C, 15, S)+speling and hour() <=eind; XS:=C>Mov(C, 15, S)+speling or (minute() = 55 and hour() = eind-1); status:=If(EL,2,If(XL,1,If(ES,-2,If(XS,-1,PREV)))); FEL:=Cross(Status,1.5); FXL:=Cross(1.5,Status) AND Ref(Status,-1)=2; FES:=Cross(-1.5,Status); FXS:=Cross(Status,-1.5) AND Ref(Status,-1)=-2; FXS
bearishbull  
#5 Posted : Tuesday, July 5, 2005 6:47:58 PM(UTC)
bearishbull

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/30/2005(UTC)
Posts: 71

I do it on a 5min chart of the eurobund futures contract...I post a picture with the signals of the system tester and the signals of the expert code you send me. the signals on the system tester are 1 bar late and that is correct, the problem is the exit signal in this example. The exitsignal of the expert is not correct
Patrick  
#6 Posted : Tuesday, July 5, 2005 6:58:58 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
Sorry ... Are the exit signals a bar late .... ? I still don't really know what the problem is, remember this is not my system so I don't know how it is upposed to act. :D Also could you tell me what your sytem tester entry options are? Do you use "realistic prices" or something else?
bearishbull  
#7 Posted : Tuesday, July 5, 2005 7:04:51 PM(UTC)
bearishbull

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/30/2005(UTC)
Posts: 71

Patrick wrote:
Sorry ... Are the exit signals a bar late .... ? I still don't really know what the problem is, remember this is not my system so I don't know how it is upposed to act. :D Also could you tell me what your sytem tester entry options are? Do you use "realistic prices" or something else?
it supposed to act like a system test of the codes I posted above the problem in the picture I send is the exitsignal..it should exit 0.02 points under the ma15 like the exitsignal from the systemtest does. entry is indeed realistic prices.. and uhm, forget what I said about a bar late :), the system test signals are on open next bar (realistic market prices) and explorer signals at close of current bar, but that's not my problem. Problem is the exit signals on places where there shouldn't be no exit signal like you can see on the chart I sended...Hope you understand me now :) Englisch is not my native language so I try my best to explain :D
Patrick  
#8 Posted : Tuesday, July 5, 2005 7:07:41 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
Alright then I think I know what the problem is ... Try replacing XL:=C<Mov(C, 15, S)-0.02 or (minute() = 55 and hour() = eind-1); XS:=C>Mov(C, 15, S)+speling or (minute() = 55 and hour() = eind-1); BY XL:=Cross(Mov(C, 15, S)-0.02,C) or (minute() = 55 and hour() = eind-1); XS:=Cross(C,Mov(C, 15, S)+0.02) or (minute() = 55 and hour() = eind-1); Sorry let's see if the cross takes care of it ...
bearishbull  
#9 Posted : Tuesday, July 5, 2005 7:21:58 PM(UTC)
bearishbull

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/30/2005(UTC)
Posts: 71

ouch..with your last code you indeed deleted that first false signal I sended..but looking through the chart I now found another :(. Strange how such a simple formule in system tester can be so complex in expert
Patrick  
#10 Posted : Tuesday, July 5, 2005 7:37:25 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
By just looking at the chart the expert seems right ... Are you sure you are running a points only test in the system tester? If you are not please run points only test and see that matches the expert. Patrick :mrgreen:
bearishbull  
#11 Posted : Tuesday, July 5, 2005 7:40:17 PM(UTC)
bearishbull

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/30/2005(UTC)
Posts: 71

no, the systemtester is right..the stopsign (the 1st stop you see) is from the expert. The second stop (the stop under ma15) is from the system tester....the systemtest is points only, nothing wrong with the system test. I made the systemtest first and now I try to make the same in expert.
Patrick  
#12 Posted : Tuesday, July 5, 2005 9:03:42 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
:-k Can you send me a bar chart with the open high low close and MA values for the signal days ... Here is the way I see it ...
bearishbull  
#13 Posted : Wednesday, July 6, 2005 6:13:51 AM(UTC)
bearishbull

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/30/2005(UTC)
Posts: 71

here you have it in barchart en the way I see it. almost Correct about the enter signal (it's a sellshort signal, not a buy :)) edit: I think that I see what goes wrong. the conditions on the place where the experts exit are the conditions for a exit long...strange.
Patrick  
#14 Posted : Wednesday, July 6, 2005 7:13:49 AM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
Change this part of all the signals ... FEL:=Cross(Status,1.5); FXL:=Cross(1.5,Status) AND Ref(Status,-1)=2; FES:=Cross(-1.5,Status); FXS:=Cross(Status,-1.5) AND Ref(Status,-1)=-2; TO FEL:=Cross(Status,1.5); FXL:=Status=1 AND Ref(Status,-1)=2; FES:=Cross(-1.5,Status); FXS:=Status=-1 AND Ref(Status,-1)=-2;
bearishbull  
#15 Posted : Wednesday, July 6, 2005 7:43:38 AM(UTC)
bearishbull

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/30/2005(UTC)
Posts: 71

Patrick wrote:
Change this part of all the signals ... FEL:=Cross(Status,1.5); FXL:=Cross(1.5,Status) AND Ref(Status,-1)=2; FES:=Cross(-1.5,Status); FXS:=Cross(Status,-1.5) AND Ref(Status,-1)=-2; TO FEL:=Cross(Status,1.5); FXL:=Status=1 AND Ref(Status,-1)=2; FES:=Cross(-1.5,Status); FXS:=Status=-1 AND Ref(Status,-1)=-2;
still no good signals..because if you are enter long (status=2) and then the status change to -1 the longstop don't work anymore... it's a complex problem..I myself am busy programming on this for the last 4 days. I start to wonder if it's even possible to get the correct signals edit: I think I'm close to the solution, I got to test it first but got something like this now: EL:=Cross(tr, 1.5); XL:=tr=1 AND (BarsSince(Ref(tr=2, -1)) < BarsSince(Ref(tr=-2, -1))) AND Ref(tr, -1)<> 1; ES:=Cross(-1.5, tr); XS:=tr=-1 AND (BarsSince(Ref(tr=2, -1)) > BarsSince(Ref(tr=-2, -1))) AND Ref(tr, -1)<> -1; xs2:= (BarsSince(Ref(xs,-1)) > BarsSince(Ref(es,-1))) AND xs; xl2:= (BarsSince(Ref(xl,-1)) > BarsSince(Ref(el,-1))) AND xl; with xs2 en xl2 as exits edit: This one works!!! exept some of the first entry's are neglected, but I think (and hope) that; s because of the use of latches.
bearishbull  
#16 Posted : Friday, July 15, 2005 5:07:09 PM(UTC)
bearishbull

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/30/2005(UTC)
Posts: 71

For everyone, i finally got THE solution!! {exit long or exit short} State:=If(Cum(1)=1,0,If(EL,1,If(ES,-1,If((CL AND PREV=1) OR (CS AND PREV=-1),0,PREV)))); Result:=State=0 AND Ref(State,-1)=-1 {or for exit long} 1 result --- {enter short} State:=If(Cum(1)=1,0,If(EL,1,If(ES,-1,If((CL AND PREV=1) OR (CS AND PREV=-1),0,PREV)))); Result:=State=-1 AND Ref(State,-1)>-1 result {enter long long} State:=If(Cum(1)=1,0,If(EL,1,If(ES,-1,If((CL AND PREV=1) OR (CS AND PREV=-1),0,PREV)))); Result:=State=1 AND Ref(State,-1)<1 hope it's clear now for everyone
Users browsing this topic
Guest (Hidden)
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.