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

Notification

Icon
Error

Options
Go to last post Go to first unread
flep  
#1 Posted : Thursday, February 18, 2010 4:27:03 PM(UTC)
flep

Rank: Newbie

Groups: Registered, Registered Users
Joined: 2/18/2010(UTC)
Posts: 7

Hi everyone! I'm new in metastock and I need help:( Many, many thanks in advance!!! This is my problem: My system formula (which I'm using in real but I want to test it in metastock): [(Maximum from last session-minimum from last session)*5+(maximum from previous session-minimum from previous session)*2]/7. It's universal system, I mean it gives signals for buy and sell. For example: I have long position in SP500 and my system gives number 15=it means that when sp500 will drop from opening by 15 points I should change my positions to short. How can I change my system into metastock language? Thank You VERY much!
johnl  
#2 Posted : Thursday, February 18, 2010 7:10:59 PM(UTC)
johnl

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/7/2005(UTC)
Posts: 602



If last session is yesterday and previous session is day before yesterday
It should look something like:

a1:=(Ref(H,-1)-Ref(L,-1))*5;
a2:=(Ref(H,-2)-Ref(L,-2))*2;
a3:=(a1+a2)/7;
a3

flep  
#3 Posted : Friday, February 19, 2010 2:40:54 AM(UTC)
flep

Rank: Newbie

Groups: Registered, Registered Users
Joined: 2/18/2010(UTC)
Posts: 7

Thank You John. Sorry for this (propably) stupid question, but what is a1,a2,etc? In metastock to programme new formula I have to fill up "enter long", "enter short", etc. The biggest problem is how metastock should know that this universal system give a signal to sell (when I have buy option) or buy (when I have sell option). Maybe I should take a start position (for example " we start from long and then system starts"). Sorry for being annoying...:(
vienna  
#4 Posted : Friday, February 19, 2010 6:19:13 AM(UTC)
vienna

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 12/14/2009(UTC)
Posts: 140
Location: Austria

using the formula from john I would use following code:

enter long:
a1:=(Ref(H,-1)-Ref(L,-1))*5;
a2:=(Ref(H,-2)-Ref(L,-2))*2;
a3:=(a1+a2)/7;
If(C>O+a3),1,0);

enter short:
a1:=(Ref(H,-1)-Ref(L,-1))*5;
a2:=(Ref(H,-2)-Ref(L,-2))*2;
a3:=(a1+a2)/7;
If(C<(O-a3),1,0);

If you wanted the formula in intraday, I'm sorry but can not help because I have only End Of Day Data.
flep  
#5 Posted : Friday, February 19, 2010 7:33:56 AM(UTC)
flep

Rank: Newbie

Groups: Registered, Registered Users
Joined: 2/18/2010(UTC)
Posts: 7

Thank You Vienna! You put a light on my system:) I have last question: instead of "C>(O+a3)" it shouldn't be "O smaller than a3" and instead of "C smaller than(O-a3)" it shouldn't be "O>a3" ? PS sorry for "smaller than" which means "<" but the forum have some bug and it doesn't show it
vienna  
#6 Posted : Saturday, February 20, 2010 5:53:33 AM(UTC)
vienna

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 12/14/2009(UTC)
Posts: 140
Location: Austria

I will try to explain it with an example with the dow jones index
you have currently a close of 10402, previous Close of 10392 and a day range of 10339 - 10438 (rounded Values)

a1:=(Ref(H,-1)-Ref(L,-1))*5;
a2:=(Ref(H,-2)-Ref(L,-2))*2;

this means:
a1 and a2 would be currently something approximatly around 500 and 200

a3:=(a1+a2)/7;

a3 would be something approximatly about 700/7=100

the Open of Dow Jones Index is about 10387

using:
If(C<(O-a3),1,0);
If(C>(O+a3),1,0);

means:
if (10402 < (10387-100) , 1 , 0)
if (10402 > (10387+100) , 1 , 0)

using:
If(O<a3,1,0)
If(O>a3,1,0)

means:
If(10387<100,1,0) will deliver every time a 0 because the difference of high to low will never exceed the Open Value.
If(10387>100,1,0) will deliver every time a 1

hope i have explained it in an understandable way?

PS: with firefox there is no problem with the "<" sign ;)
flep  
#7 Posted : Tuesday, February 23, 2010 4:41:34 AM(UTC)
flep

Rank: Newbie

Groups: Registered, Registered Users
Joined: 2/18/2010(UTC)
Posts: 7

Thank You Vienna! You did explain it in very understoodable way:) Now I know where I had the error but there is still one thing to solve: I take position by checking whether the index from OPEN goes by points counted in a3. In Your example it would be something like: I have long and if tomorrow index drops from OPENING by 100 points I change it to short. It should be something like: If("Dow Jones during session will achive" "smaller than"(O-a3),1,0); If("Dow Jones during session will achive">(O+a3),1,0); How to translate it into Metastock language? Thanks in advance (like always;) )! PS I use Chrome, normally it's better than firefox ;)
vienna  
#8 Posted : Tuesday, February 23, 2010 4:57:17 AM(UTC)
vienna

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 12/14/2009(UTC)
Posts: 140
Location: Austria

I don't understand what you mean by "Dow Jones during session will achive". Do you mean the Last_Value - the intraday (current = after open but before close) value of Dow Jones?

PS: I have never tried chrome - ff always met all my needs ;)
flep  
#9 Posted : Tuesday, February 23, 2010 6:24:52 AM(UTC)
flep

Rank: Newbie

Groups: Registered, Registered Users
Joined: 2/18/2010(UTC)
Posts: 7

Just like You said-intraday:) FF was the best, now try chrome;) especially if You are using Gmail
vienna  
#10 Posted : Tuesday, February 23, 2010 6:55:41 AM(UTC)
vienna

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 12/14/2009(UTC)
Posts: 140
Location: Austria

I'm sorry but I have no intraday data so I don't know how (with which character) to access it ...
I suspect C but I'm not sure.. maybe some can help here who has experience with intraday formulas..
flep  
#11 Posted : Tuesday, February 23, 2010 11:54:27 AM(UTC)
flep

Rank: Newbie

Groups: Registered, Registered Users
Joined: 2/18/2010(UTC)
Posts: 7

Thank You Vienna for everything! I'm at the dead end... can anybody help me?
henry1224  
#12 Posted : Tuesday, February 23, 2010 2:50:24 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)
dear Flep,

what time frame are you charting? 1min bars 5 min bars 1hour bars or daily charts?

do you want the open of today's market in your system?

is your trading range from the previous day or from the previous bars?


flep  
#13 Posted : Tuesday, February 23, 2010 3:14:58 PM(UTC)
flep

Rank: Newbie

Groups: Registered, Registered Users
Joined: 2/18/2010(UTC)
Posts: 7

Henry it's 1min, yes I want the open of today's market in system, trading range is from previous day:) thanks in advance!
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.