Rank: Advanced Member
Groups: Registered, Registered Users Joined: 6/5/2005(UTC) Posts: 35
|
Refer to this post for a new free dll:
http://forum.equis.com/viewtopic.php?t=1529
It contains a function called WriteRef. This function is an "assignment operator", here is how it works:...
WAIT, before you read on, know that this function is very advanced, and you should probably not use it unless you understand what is going on...but if you do know what you are doing, then you may see that this could potentially be used for many different things, some of which may have not been possible before in MS formula language....8:-)
[code:1:428057d130]result := WriteRef(StartingArray, AssnArray, startPos, endPos);[/code:1:428057d130]
This is basically an assignment operator that lets you set a section, or even just one element of, an array.
So for a simple example, I could do this:
[code:1:428057d130]x := 10;
x := ExtFml( "ASI.RefWrite", x, 12, -4,-4) ;[/code:1:428057d130]
and I get an array that is filled with the number 10, except for the fourth bar (*from the last, see below), which is now set to equal 12. (The lower index should always be first.)
[code:1:428057d130]x := 10;
x := ExtFml( "ASI.RefWrite", x, 12, -7,-4) ;[/code:1:428057d130]
and I get an array that is filled with the number 10, except for the fourth bar, fifth, sixth, and seventh bars (*before today, see below), which is now set to equal 12.
another example,
[code:1:428057d130]x := 10;
x := ExtFml( "ASI.RefWrite", x, Close, -7,-4) ;[/code:1:428057d130]
and I get an array that is filled with the number 10, except for the fourth bar, fifth, sixth, and seventh bars (*before today, see below), which is now set to equal whatever the close is over that same range in time.
Notice that the startPos and endPos do not function like the inputs in the Ref() function, instead, they are static, and thus, the same array gets created on every bar. Thus the array is really a static array, and not a time-series array. The indicies that are used above are references from the most recent day, so "today" is really the "beginning" of the array.
Finally,
There are other methods of writing to an array, that can accomplish things that this method cannot, and I would be glad to offer some variations of this function that accomplish something specific if you can present a use for it here...I'm not sure how you guys envisioned an assignment operator..it may have been different that mine ??
Hope you guys find this stuff useful,
Brad Ulrich
Developer
The Dynamic Market Lab, LLC
www.thedml.com
|