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!
|
|
|
|
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
|
|
|
|
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...:(
|
|
|
|
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.
|
|
|
|
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
|
|
|
|
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 ;)
|
|
|
|
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 ;)
|
|
|
|
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 ;)
|
|
|
|
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
|
|
|
|
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..
|
|
|
|
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?
|
|
|
|
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?
|
|
|
|
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.