Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/2/2009(UTC) Posts: 31
|
Is there a way to program in Metastock Formuar language a product of all e.g. closing values without a prev function? product:=value1*value2*value3....*last value for example as in: product:=C*PREV; is very slow. In other words I am looking for the product equivalent of the cum() function. I keep looking and trying.. but if someone figures this out earlier please post here! Many thanks, Klaus
|
|
|
|
Rank:: Advanced Member
Groups: Registered, Registered Users Joined: 11/25/2006(UTC) Posts: 79
|
you may try:
exp(sum(log(close),lastvalue(cum(1))));
btw how much ram does your computer have?
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/2/2009(UTC) Posts: 31
|
Thanks wblam!
Brilliant idea to use the sum of logs...! Should have thought of that earlier :)
Too tired to test it now though.
My notbook has only 256MB so that is certainly an issue I guess.
Does anyone have an idea if extra ram can speed up these kind of calcluation significantly. Would doubling the Ram roughly double the speed?
Thanks for the idea,
Klaus
|
|
|
|
Rank:: Advanced Member
Groups: Registered, Registered Users Joined: 11/25/2006(UTC) Posts: 79
|
Assume that close=10 and you load 200 days of data. The answer will be 10 to the power of 200! I do not think MS or your computer can handle it.
|
|
|
|
Rank:: Advanced Member
Groups: Registered, Registered Users Joined: 11/25/2006(UTC) Posts: 79
|
Giorgos' answer in here is more correct:
http://tradersconsortium.com/community/index.php?showtopic=24533&pid=26963&st=0entry26963
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/2/2009(UTC) Posts: 31
|
Fortunately I don't really want to multiply closing prices every bar - this was just an example, of course. For what I need it, the above solution works fine with me.
|
|
|
|
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.