Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 9/19/2009(UTC) Posts: 27
|
Hi,
Here is my problem.
I would like to put values returned by several indicators in an array. (then to use this array with an external function).
How to do It?
For example, I have three EMA EmaD:=Mov(C,pdsD,E); EmaW:=Mov(C,pdsW,E); EmaM:=Mov(C,pdsM,E);
I would like to put this three EMA in an array. How to do it?
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/26/2009(UTC) Posts: 76 Location: Toronto, Canada
|
Hi,
Here is a possible solution but I'm not sure if that's what your are looking for. You could either average the 3 EMAs and combine them to produce a single data array. The solution is:
EmaD:=Mov(C,pdsD,E);
EmaW:=Mov(C,pdsW,E);
EmaM:=Mov(C,pdsM,E);
SMEMA:= (EmaD+EmaW+EmaM)/3 (or you could not average them just produce the sum of those)
That will give you one array and you could input that array in an indicator - e.i.ROC(SMEMA,5,%)
Hope it helps,
VT
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 9/19/2009(UTC) Posts: 27
|
It doesn't help me ;(
I need to get the exact values of the indicators in an array. Moreover, it was an example, it could be EMA, Price and a Boolean to put in array.
Thks to have tried btw ;-)
|
|
|
|
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)
|
For example, I have three EMA EmaD:=Mov(C,pdsD,E); EmaW:=Mov(C,pdsW,E); EmaM:=Mov(C,pdsM,E);
you could use the Formula Variable Call Function
fmlvar("formula_name","variable_name")
or Formula Call Function
fml("formula_name")
to define your data arrays
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 12/14/2009(UTC) Posts: 140 Location: Austria
|
I think you have to use 3 params/arrays
e.g. EmaD:=Mov(C,pdsD,E); EmaW:=Mov(C,pdsW,E); EmaM:=Mov(C,pdsM,E);
ExtFml( "mydll.myfunction", EmaD, EmaW, EmaM)
and in msx in your function "myfunction" in your dll "mydll" - you will need 3 MSXDataArray as Inputs
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 9/19/2009(UTC) Posts: 27
|
There is no way to add the 3 params in one array... to call ExtFml with only one array which would contains 3 values??
Such as:
EmaD:=Mov(C,pdsD,E); EmaW:=Mov(C,pdsW,E); EmaM:=Mov(C,pdsM,E);
EmaArray:= RHAAAAAAWhyItDoesNotExist(EmaD, EmaW, EmaM);
ExtFml( "mydll.myfunction", EmaArray);
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 12/14/2009(UTC) Posts: 140 Location: Austria
|
correct ;) the MSXDataArray is only a "vector" and you can only transfer 1 indicator (Security) per param to your dll
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 12/14/2009(UTC) Posts: 140 Location: Austria
|
But it would be possible to write a msx-function wich adds indicators to a matrix as new column...
e.g.
EmaD:=Mov(C,pdsD,E); EmaW:=Mov(C,pdsW,E); EmaM:=Mov(C,pdsM,E);
ExtFml( "mydll.addCol2Matrix", EmaD); ExtFml( "mydll.addCol2Matrix", EmaW); ExtFml( "mydll.addCol2Matrix", EmaM);
the matrix must be a global var in your "mydll" - like it is in the gv.dll (globalVar)
Afterwards you would be possible to store the wwhole matrix with an other function: ExtFml( "mydll.saveMatrix", "d:\mytest.csv");
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 9/19/2009(UTC) Posts: 27
|
Thks for your reply vienna. I'm doing exactly how you have said in your post ;-)
|
|
|
|
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.