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

Notification

Icon
Error

Options
Go to last post Go to first unread
pkc111  
#1 Posted : Sunday, October 11, 2015 10:11:22 AM(UTC)
pkc111

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

henry1224  
#2 Posted : Monday, October 12, 2015 12:23:48 PM(UTC)
henry1224

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!

thanks 1 user thanked henry1224 for this useful post.
MS Support on 10/13/2015(UTC)
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.