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

Notification

Icon
Error

Options
Go to last post Go to first unread
elmagd2000  
#1 Posted : Thursday, October 28, 2004 9:01:39 AM(UTC)
elmagd2000

Rank: Member

Groups: Registered, Registered Users
Joined: 10/28/2004(UTC)
Posts: 11

Was thanked: 1 time(s) in 1 post(s)
Hello all, System tester is considered a very powerful tool when you get its rules and tricks. It saves enormous time for manual testing. May you share your experience with systems tester, how do you use it? how do you think Equis would enhance it? finally, Interested to share with me your ideas about: [color=blue:b0140b6d6b]How To Backtest A System That Works With Marketorder[/color], in other words, if cond. A and cond. B are on buy or sell now and not to wait for the next bar. I noticed that in system backtest if you use delay=0 ( buy or sell at same bar ) that position is opened at bar open which is not true. What are your ideas? Thanks Hani :)
elmagd2000  
#2 Posted : Monday, February 7, 2005 10:06:12 AM(UTC)
elmagd2000

Rank: Member

Groups: Registered, Registered Users
Joined: 10/28/2004(UTC)
Posts: 11

Was thanked: 1 time(s) in 1 post(s)
Hello Patrick, Interested to share your ideas about market order in systems tester. Thanks in advance. Hani :)
Patrick  
#3 Posted : Monday, February 7, 2005 4:39:47 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 I did not give this much though. If understand properly, you want to buy as soon as the signal is generated ... Right? :) The easy way and I'm sure you have done this, is to set a delay of zero and use the close value. So you would buy at the close of the bar that generated the signal. Now I don't know of any way to get the exact price value at the time the signal, and I doubt it is even possible. But depending on your buy formula we could maybe find a workaround.
elmagd2000  
#4 Posted : Monday, February 7, 2005 6:22:16 PM(UTC)
elmagd2000

Rank: Member

Groups: Registered, Registered Users
Joined: 10/28/2004(UTC)
Posts: 11

Was thanked: 1 time(s) in 1 post(s)
Patrick wrote:
Sorry I did not give this much though. If understand properly, you want to buy as soon as the signal is generated ... Right? :)
[color=blue:403d5d519f]This is right.[/color]
Patrick wrote:
The easy way and I'm sure you have done this, is to set a delay of zero and use the close value. So you would buy at the close of the bar that generated the signal.
[color=blue:403d5d519f]I 've done that. How to set these settings in point only test? I noticed that "point only test" give better results specially in markets like forex.[/color]
Patrick wrote:
Now I don't know of any way to get the exact price value at the time the signal, and I doubt it is even possible. But depending on your buy formula we could maybe find a workaround.
[color=blue:403d5d519f]My buy formula is : Cross(H,Ref(HHV(H,20),-1)) I need to buy as soon as I get Buy signal Thanks Hani :)[/color]
Patrick  
#5 Posted : Monday, February 7, 2005 7:33:22 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)
if we stop thinking about buying at a specific time but rather at a specific value then we have solution to this. If you want to buy as soon as the price is greater than a variable X That means you want your entry price to be a tiny bit above X. ( Of course that would only work in real time and if your broker applies these buy and sell conditions for you ... blah blah :) ) Now I don't think this could done in a system tester, but it can be done in an exploration, a bit like the PS performance explorations... Using your formula and creating a copy of a points only system test (Using close and zero delay) we would have the following for an exploration : ( I'm assuming here that your exit signal is the opposite of the entry signal formula ) ColumnA Name :Long Profit Formula : BC:=Cross(H,Ref(HHV(H,20),-1)) ; SC:=Cross(Ref(LLV(L,20),-1),L); State:=If(BC,1,If(SC,-1,PREV)); Cum(If(State=1,ROC(C,1,$),0)) ColumnB Name : Short Profit Formula : BC:=Cross(H,Ref(HHV(H,20),-1)) ; SC:=Cross(Ref(LLV(L,20),-1),L); State:=If(BC,1,If(SC,-1,PREV)); Cum(If(State=-1,Neg(ROC(C,1,$)),0)) ColumnC Name : Long/Short Profit Formula : BC:=Cross(H,Ref(HHV(H,20),-1)) ; SC:=Cross(Ref(LLV(L,20),-1),L); State:=If(BC,1,If(SC,-1,PREV)); Cum(If(State=1,Roc(C,1,$),If(State=-1,Neg(ROC(C,1,$)),0))) Now let's modify this so that it calculates profit as soon as our condition is met. Which here really means "let's add a specific entry price to the formula". Earlier I said you want your entry price to be a tiny bit above X X = Ref(HHV(H,20),-1) or X = Ref(LLV(L,20),-1) + tinybit= 0.01 or tinybit= -0.01 :) Here is the final exploration ColumnA Name :Long Profit Formula : BC:=Cross(H,Ref(HHV(H,20),-1)) ; SC:=Cross(Ref(LLV(L,20),-1),L); State:=If(BC,1,If(SC,-1,PREV)); LEntryPRICE:=ValueWhen(1,Cross(State,0),Ref(HHV(H,20),-1))+0.01; LExitPRICE:=ValueWhen(1,Cross(0,State),Ref(LLV(L,20),-1))-0.01; SEntryPRICE:=ValueWhen(1,Cross(0,State),Ref(LLV(L,20),-1))-0.01; SExitPRICE:=ValueWhen(1,Cross(State,0),Ref(HHV(H,20),-1))+0.01; Cum(If(Cross(0,State),LExitPrice-LentryPrice,0)) ColumnB Name : Short Profit Formula : BC:=Cross(H,Ref(HHV(H,20),-1)) ; SC:=Cross(Ref(LLV(L,20),-1),L); State:=If(BC,1,If(SC,-1,PREV)); LEntryPRICE:=ValueWhen(1,Cross(State,0),Ref(HHV(H,20),-1))+0.01; LExitPRICE:=ValueWhen(1,Cross(0,State),Ref(LLV(L,20),-1))-0.01; SEntryPRICE:=ValueWhen(1,Cross(0,State),Ref(LLV(L,20),-1))-0.01; SExitPRICE:=ValueWhen(1,Cross(State,0),Ref(HHV(H,20),-1))+0.01; Cum(If(Cross(State,0),SEntryPrice-SExitPrice,0)) ColumnC Name : Long/Short Profit Formula : BC:=Cross(H,Ref(HHV(H,20),-1)) ; SC:=Cross(Ref(LLV(L,20),-1),L); State:=If(BC,1,If(SC,-1,PREV)); LEntryPRICE:=ValueWhen(1,Cross(State,0),Ref(HHV(H,20),-1))+0.01; LExitPRICE:=ValueWhen(1,Cross(0,State),Ref(LLV(L,20),-1))-0.01; SEntryPRICE:=ValueWhen(1,Cross(0,State),Ref(LLV(L,20),-1))-0.01; SExitPRICE:=ValueWhen(1,Cross(State,0),Ref(HHV(H,20),-1))+0.01; Cum(If(Cross(0,State),LExitPrice-LentryPrice,If(Cross(State,0),SEntryPrice-SExitPrice,0)) A few note about this, the columns name are too long I know ... I have not tested this ... And these formula will unfortunately not include the first 2 trades on each side. Do I need to put a disclaimer here saying that this is not a recommendation to buy sell ... :D
elmagd2000  
#6 Posted : Tuesday, February 8, 2005 9:14:00 AM(UTC)
elmagd2000

Rank: Member

Groups: Registered, Registered Users
Joined: 10/28/2004(UTC)
Posts: 11

Was thanked: 1 time(s) in 1 post(s)
Patrick wrote:
Now I don't think this could done in a system tester, but it can be done in an exploration, a bit like the PS performance explorations... [color=blue:70041ebae7]Thanks alot my friend, Why I can't use that in system tester?[/color] ( I'm assuming here that your exit signal is the opposite of the entry signal formula ) [color=blue:70041ebae7]Yes, this is right.[/color] ColumnC Name : Long/Short Profit Formula : BC:=Cross(H,Ref(HHV(H,20),-1)) ; SC:=Cross(Ref(LLV(L,20),-1),L); State:=If(BC,1,If(SC,-1,PREV)); LEntryPRICE:=ValueWhen(2,Cross(State,0),Ref(HHV(H,20),-1))+0.01; LExitPRICE:=ValueWhen(1,Cross(0,State),Ref(LLV(L,20),-1))-0.01; SEntryPRICE:=ValueWhen(2,Cross(0,State),Ref(LLV(L,20),-1))-0.01; SExitPRICE:=ValueWhen(1,Cross(State,0),Ref(HHV(H,20),-1))+0.01; Cum(If(Cross(0,State),LExitPrice-LentryPrice,If(Cross(State,0),SEntryPrice-SExitPrice,0)) Do I need to put a disclaimer here saying that this is not a recommendation to buy sell ... :D
[color=blue:70041ebae7]May my LEntry = SExit and vise versa? So I can use : LEntryPRICE:=ValueWhen([1,Cross(State,0),Ref(HHV(H,20),-1))+0.01;[/color] Thanks alot for your time. Hani :)
Patrick  
#7 Posted : Tuesday, February 8, 2005 3:32:35 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)
Quote:
Why I can't use that in system tester?
Because I don't know what the order type limit or stop really do. :oops: And I believe it may affect the results. But I will look into it and confirm that we can't use these or maybe realize that there is a much easier way using the system tester ...
Quote:
May my LEntry = SExit and vise versa? So I can use : LEntryPRICE:=ValueWhen([1,Cross(State,0),Ref(HHV(H,20),-1))+0.01;
It is actually a mistake on my part, all the valuewhen functions should use 1. I will edit the formula above and make the corrections.
elmagd2000  
#8 Posted : Tuesday, February 8, 2005 3:47:06 PM(UTC)
elmagd2000

Rank: Member

Groups: Registered, Registered Users
Joined: 10/28/2004(UTC)
Posts: 11

Was thanked: 1 time(s) in 1 post(s)
Thanks Patrick for helpful attitude and in time replies Hani :)
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.