Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 8/11/2005(UTC) Posts: 104
|
Hi, Could you tell me how to write a MetaStock “LOOP” formula? ------------------------------------------------------- Beginning at periods=6 to periods=50 tx:=360*X*periods; cosinepart:=sum(cleandata*cos(tx),50); sinpart:=sum(cleandata*sin(tx),50); pr:=(power(cosinepart,2))+(power(sinpart,2)); Maxpr:=Max(Maxpr,pr); ---------------------------------------------------------------- {How do I then set up the value of dynamic variable “pr” Is the formula below suitable? How do I then put “pr” in a data Array for the Variable Period?} ExtFml( "ForumDll.VarREF", Data Array, Variable Period) ----------------------------------------------------------------- Best Regards. Derek
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
Derek,
There is no looping function in the MetaStock Formula language. To compute the DFT you will need to use the MetaStock Developers Kit and another programming language to write this as an addin.
wabbit [:D]
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 1/19/2005(UTC) Posts: 1,065 Location: Koh Pha-Ngan, Earth
Was thanked: 2 time(s) in 2 post(s)
|
Derek Worswick wrote:pr:=(power(cosinepart,2))+(power(sinpart,2));
How do I then set up the value of dynamic variable “pr”
==========
Power - variable
==========
{ Power(DataArray,VariablePower) MS function.
With thanks to MG Ferreira.
http://www.metastocktools.com }
{ Data array }
DataArray:=C;
{ Variable Power example }
VariablePower:=DataArray/Mov(DataArray,63,S);
{ Power(DataArray,VariablePower) equivalent }
VarPower:=Exp(Log(DataArray)*VariablePower);
{ Output }
VarPower
jose '-)
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 8/11/2005(UTC) Posts: 104
|
Hi,
Thank you for your replies on the question of a MetaStock “LOOP” Formula.
Best regards,
Derek
|
|
|
|
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.