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

Notification

Icon
Error

Options
Go to last post Go to first unread
bradulrich  
#1 Posted : Thursday, August 18, 2005 3:53:14 AM(UTC)
bradulrich

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
Jose  
#2 Posted : Thursday, August 18, 2005 7:50:53 AM(UTC)
Jose

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)
Interesting stuff, Brad. Can variables be used for StartingArray, startPos & endPos? jose '-) http://metastocktools.com
bradulrich  
#3 Posted : Thursday, August 18, 2005 12:41:57 PM(UTC)
bradulrich

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/5/2005(UTC)
Posts: 35

Jose, not in this version, but I don't think the change would be *that* tough. In fact, I think I have a version that does, but I wanted to start with something simple to see if that is what you (and others) had in mind. I think I can get back with something in a couple days.... Brad
bradulrich  
#4 Posted : Thursday, August 18, 2005 12:43:07 PM(UTC)
bradulrich

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/5/2005(UTC)
Posts: 35

An Array (or variable) can be used for the starting array, but not the start and endPos.
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.