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

Notification

Icon
Error

Options
Go to last post Go to first unread
magiclaas  
#1 Posted : Sunday, January 17, 2016 6:57:50 PM(UTC)
magiclaas

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 9/18/2008(UTC)
Posts: 37

HI, I VE THIS PROREAL TIME SCRIPT: //New Money index NewMoney=cumsum(close*(volume-volume[1])) Return NewMoney as "NewMoney" //Old Profit index OldProfit=cumsum(volume[1]*(close-close[1])) Return OldProfit coloured (0,0,250) as "OldProfit" in order to built an oscillator that help to understand trend by volume ... in other words something that looks like a new money in the market the cumulation values gives these oscillator PLEASE how to translate in metastock language? thank you Luigi
MS Support  
#2 Posted : Tuesday, January 19, 2016 10:07:15 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,941

Thanks: 85 times
Was thanked: 155 time(s) in 150 post(s)
Not really familiar with the script language. Is the [1] referring to the previous day? You could try the following formula but I am not sure what the oscillator is expected to look like: NewMoney:=Cum(C * (V-Ref(V,-1))); NewMoney; OldProfit:=Cum(Ref(V,-1) * (C - Ref(C,-1))); OldProfit;
Pescasub  
#3 Posted : Thursday, January 28, 2016 4:49:38 PM(UTC)
Pescasub

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 1/28/2016(UTC)
Posts: 9

Thanks: 6 times
Hello, is it possible to translate also this indicator from ProRealTime to Metastock? // Butterworth Indicator if BarIndex < 2 then BU=Close else BU=BU[1]-BU[2]/3.414+(1/3.414)*Close Endif Return BU
MS Support  
#4 Posted : Thursday, January 28, 2016 9:49:46 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,941

Thanks: 85 times
Was thanked: 155 time(s) in 150 post(s)
Not familiar with this myself, but someone did create a Butterworth Filter via this older post: http://forum.metastock.c...rworth-Filter#post153839 { 2 Pole Butterworth Filter } Data:=((H+L)/2); Period:=Input("Period",5,175,175); a1:=Exp(-1.414*3.14159/Period); b1:=2*a1*Cos(1.414*180/Period); coef2:=b1; coef3:=-a1*a1; coef1:=(1-b1+a1*a1)/4; Butter:=coef1*(Data+2*Ref(Data,-1)+Ref(Data,-2)) + coef2*PREV + coef3*Ref(PREV,-1); Butter;
Pescasub  
#5 Posted : Friday, January 29, 2016 8:16:51 AM(UTC)
Pescasub

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 1/28/2016(UTC)
Posts: 9

Thanks: 6 times
Thank you for the quickly reply, but this is two pole filter. As shown below: prevP1 = price[index-1]; prevP2 = price[index-2]; prevB1 = ifNull(price, butter[index-1]); //feedback ingredent prevB2 = ifNull(price, butter[index-2]); //feedback ingredent piPrd = Math.PI/period; a1 = Math.exp(-1.414 * piPrd); b1 = 2 * a1 * Math.cos(1.414 * piPrd); coef2 = b1; coef3 = -a1 * a1; coef1 = (1 - b1 + a1 * a1) / 4; plot: butter = coef1 * (price + (2*prevP1) + prevP2) + (coef2*prevB1) + (coef3*prevB2); Mine should be easier.
Pescasub  
#6 Posted : Sunday, January 31, 2016 9:11:10 PM(UTC)
Pescasub

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 1/28/2016(UTC)
Posts: 9

Thanks: 6 times
Any new hints?
MS Support  
#7 Posted : Monday, February 1, 2016 3:25:04 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,941

Thanks: 85 times
Was thanked: 155 time(s) in 150 post(s)
I can take a shot at it, you can see if this meets your criteria: BU:=Cum(1); BU2:=If(BU < 2,CLOSE,Ref(BU,-1) - Ref(BU,-2))/3.414+(1/3.414)*CLOSE; BU2
thanks 1 user thanked MS Support for this useful post.
Pescasub on 2/9/2016(UTC)
Pescasub  
#8 Posted : Tuesday, February 2, 2016 3:21:12 PM(UTC)
Pescasub

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 1/28/2016(UTC)
Posts: 9

Thanks: 6 times
Thank you, i will give a try. By the way is there, apart formula Metastock Formula Primer pdf, a manual where i can find what every term means quickly? ie: C = Close, O=Open, etc...
MS Support  
#9 Posted : Tuesday, February 2, 2016 3:36:54 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,941

Thanks: 85 times
Was thanked: 155 time(s) in 150 post(s)
Basically we have what is in the F1 Help of MetaStock. There should be a primary topic called MetaStock Formula Language with several subsections, including the Price Array Identifiers as well as a section for Working With Functions.
thanks 1 user thanked MS Support for this useful post.
Pescasub on 2/9/2016(UTC)
Pescasub  
#10 Posted : Tuesday, February 2, 2016 3:41:00 PM(UTC)
Pescasub

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 1/28/2016(UTC)
Posts: 9

Thanks: 6 times
Ok. I will check. Thank you for now.
Pescasub  
#11 Posted : Tuesday, February 9, 2016 7:12:34 PM(UTC)
Pescasub

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 1/28/2016(UTC)
Posts: 9

Thanks: 6 times
How about writing this in metastock? lag=11 if BarIndex > 2 then BU=close else BU=BU[1]-BU[2]/3.414+(1/3.414)*Close endif c1=BU>BU[lag] if c1 then buy 1 share at market tomorrowopen endif c2=BU<BU[lag] if c2 then sellshort 1 share at market tomorrowopen endif
MS Support  
#12 Posted : Wednesday, February 10, 2016 9:26:15 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,941

Thanks: 85 times
Was thanked: 155 time(s) in 150 post(s)
Are you looking to use this as an indicator, system test, exploration, or expert advisor?
thanks 1 user thanked MS Support for this useful post.
Pescasub on 2/11/2016(UTC)
Pescasub  
#13 Posted : Thursday, February 11, 2016 9:38:28 AM(UTC)
Pescasub

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 1/28/2016(UTC)
Posts: 9

Thanks: 6 times
I would like to use mainly as an indicator, but if it useful also as a system test and expert advisor. Thank you.
MS Support  
#14 Posted : Friday, February 12, 2016 3:09:00 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,941

Thanks: 85 times
Was thanked: 155 time(s) in 150 post(s)
In looking at the formula a bit, I am not quite sure what the following is supposed to represent: BU[1]-BU[2] Is this supposed to refer to the difference between the Close price 1 bar and Close price 2 bars ago?
Pescasub  
#15 Posted : Saturday, February 13, 2016 3:41:28 PM(UTC)
Pescasub

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 1/28/2016(UTC)
Posts: 9

Thanks: 6 times
if BarIndex < 2 then BU=Close else BU=BU[1]-BU[2]/3.414+(1/3.414)*Close Endif should be in Metastock BU:=Cum(1); BU2:=If(BU < 2,CLOSE,Ref(BU,-1) - Ref(BU,-2))/3.414+(1/3.414)*CLOSE; BU2
MS Support  
#16 Posted : Monday, February 15, 2016 3:17:16 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,941

Thanks: 85 times
Was thanked: 155 time(s) in 150 post(s)
Well this formula I believe would generally work, but because your condition will virtually always be in a buy or sell state, it will repeat the signals:

Lag:=11;
BarIndex:=Cum(1);

BU:=If(BarIndex < 2,CLOSE,Ref(BarIndex,-1) - Ref(BarIndex,-2))/3.414+(1/3.414)*CLOSE;

C1:=BU>Ref(BU,-Lag);

C2:=BU<Ref(BU,-Lag);

If(C1,1,If(C2,-1,0))

There is a way you can write the formula to limit the signals to "new" buy or sell signals, meaning it would only generate a sell signal if the previous signal was a buy, as opposed to repeating the sell signal or buy signal over and over. I'm just not sure if that is what you're looking for.

Edited by user Thursday, February 18, 2016 3:03:36 PM(UTC)  | Reason: Not specified

thanks 1 user thanked MS Support for this useful post.
Pescasub on 2/15/2016(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.