Announcement

Collapse
No announcement yet.

Updating array items in Global Values

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Updating array items in Global Values

    Folks,

    I have a question that requires some help from my adv. efs buddies.. I've built a "dynamic equity allocation" model for a client that is trading about 70+ stocks in realtime. We're recently added an "equity control module" that allows him to control the actions of each efs chart. One portion of this equity control module is a running, realtime calculation of realized+unrealized profits/losses..

    I'm handling this by creating an array of structures and placing it into global memory (setGlobalVariable) - lets call this the "UR_array". Then, when an efs fires a trade, we pull from the equity pool, update the UR_array, fire the trade, verify the trade (twice), then adjust the equity pool and UR_array as needed..

    The problem he is reporting is that the UR_array tends to lag his actual account often..

    Now, the only way I've found to update an array item once it is placed into global memory is

    a. pull down the entire array
    b. locate the array item to update/add, and update it
    c. post back into memory the entire array.

    My question is....

    is there a way to update only "single array items" from the global memory?

    For example, lets say I have an array of 100 items

    var my_array = new Array(100);

    lets assume I want to update item 20 and make it 25.00, I would simply use.. (assuming it was initialized)

    my_array[20] = 25.00;

    is there a way to do this what an array that has been posted into the global memory?
    Brad Matheny
    eSignal Solution Provider since 2000

  • #2
    Hello Brad,

    To the best of my knowledge, I don't believe there is a way to update a single element of your UR_array as EFS does not currently have a method for referencing that object, which is outside the EFS environment. The only way currently is to first retrieve the object with the getGloablValue() call, manipulate the object and then place it back to the global space with setGlobalValue(). The functionality you're asking for is an interesting idea, but I'm not sure it's possible. I would encourage you to submit a request to development at IDEAS.

    Have you considered using a custom dll? If your "equity control module" is a separate application you may want to explore that route. You could write your own custom functions to update the individual array elements that would be stored in that application. I haven't personally done this, but just thought I'd throw out an idea for you to explore.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      Thanks Jason

      Will try to resolve this on my own..

      B
      Brad Matheny
      eSignal Solution Provider since 2000

      Comment

      Working...
      X