Rank: Newbie
Groups: Registered Users, Subscribers, Unverified Users Joined: 10/11/2015(UTC) Posts: 3
|
Hi there
i am very new to this so apologies if this osunds a bit silly, but I have set up a new indicator (called "Universal Oscillator") in my Metastock 14 and all I want to do is backtest it using the rules buy when it crosses up above 0 and sell when it crosses down below zero.
I am in the system editor but I do not know enough about the language to create a buy order formula and a sell order formula. Any suggestions would be greatly appreciated.
Thanks
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/29/2004(UTC) Posts: 1,394 Location: Glastonbury, CT
Was thanked: 2 time(s) in 2 post(s)
|
without seeing your code
A:=Fml(“Universal Oscillator”);
Signal:=If(Cross(A,0),1,If(Cross(0,A),-1,0));
{The last line of code would be}
{for a buy signal}Signal=1 and Ref(Signal,-1)<>1
{for a sell Signal} Signal=-1 and Ref(Signal,-1)<>-1
just make sure that the last line of your custom code is your output for that formula!
|
1 user thanked henry1224 for this useful post.
|
|
|
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.