Rank: Advanced Member
Groups: Registered, Registered Users Joined: 4/27/2005(UTC) Posts: 130
|
I know I can use the points only backtester in metastock but the bottomline is I don't trust the results. Can anyone help me with this design working off a latching system.
{Back tester for points only}
x:=fml("Your Formule Name here");
{Alway use a latching formula this system is design to work with a latch only}
buy:=ValueWhen(1,x=1 AND ref(x=0,-1) OR x=1 AND ref(x=-1,-1),O);
sell:=ValueWhen(1,x=-1 AND ref(x=0,-1) OR x=-1 AND ref(x=1,-1),O);
buyexit:=ValueWhen(1,x=0 AND ref(x=1,-1) OR x=-1 AND ref(x=1,-1),O);
sellexit:=ValueWhen(1,x=0 AND ref(x=-1,-1) OR x=1 AND ref(x=-1,-1),O);
{Profit}
profitbuy:=If(buyexit>buy,buyexit-buy,0);
profitsell:=If(sellexit<sell,sell-sellexit,0);
{Lost}
lostbuy:=If(buyexit<buy,buy-buyexit,0);
lostsell:=If(sellexit>sell,sellexit-sell,0);
profitable:=cum(profitbuy+profitsell);
notprofitable:=cum(lostbuy+lostsell);
profitable;
notprofitable;
{Design Idea is when the latch turns on I want the value of the open and when the latch
goes off I want the value of the open subtract from when the latch turned on. Then I want
to add up all the value from the profitable ones and then subtract that value from all the
unprofitable values for a total. The total should then tell me if the system is profitable
or not}
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 1/19/2005(UTC) Posts: 1,065 Location: Koh Pha-Ngan, Earth
Was thanked: 2 time(s) in 2 post(s)
|
|
|
|
|
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.