Announcement

Collapse
No announcement yet.

Scripting Challange

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

  • Scripting Challange

    EFS Gurus,
    I am an experienced programmer, competent in EFS as well but do not have enough info related to the issue below.
    I would like to have two scripts work using the following paradigm (assuming eSignal is up and running):

    Script 1.
    Read an .ini (or other file) and have a list of symbols to work with.
    For each symbol script 1 load/reload a script (script 2) that will process that symbol (input parameter to script 2)

    Script 2.
    Fills the defaults of the parameters read from script 1.
    Run so as to finish n bars and unload itself.

    1. Is this possible at all?
    2. I read the documentation about using DLL's and I think I can get the Windowss dll that processes .ini files to work (it would be nice if someone have sample code that I can use though).

    Thanks for all your help

    Avraham (Bey) Melamed

  • #2
    Hello Bey,

    1. Unlikely. EFS does has file I/O. However, EFS has a symbol limit of 7. You can access data for up to 7 symbols within a single EFS, but you will not be able to programmatically change the chart symbol to process a study on a list of symbols or unload studies.

    2. This one is uncharted territory. If you can get this to work, you'd be the first that I know of. Perhaps there are some other programmers in the community that can provide some more input for you here.
    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
      Working with DLL's

      Jason,
      Thanks for your response.

      I did not understand your comment about the 7 symbol limit.
      I am aware of the file i/o protocols (functions) and have no difficulty working with it.

      I was trying to write code using the Windows' Kernel32.dll in order to read an ini file (trying to avoid having to write a file parser).
      One of the functions in this DLL is the famous
      GetPrivateProfileStringA function that is used to read .ini (configuration) files.
      This function returns an error code (0 if all is OK or non zero for an error) and passes back the result of a topic within a section in a .ini file in its third parameter which is an output parameter (sValue in my code).

      However, when I use this dll, the local variable is not set - it remains undefined.
      Either my use of the function is wrong or eSignal did not provide for the facility of having a dll set the contents of an efs variable via an output parameter. The facility to set a value from the return of a dll function DOES work.

      See attached file (TryINIDll.efs) for the trivial sample I wrote and upon which I arrived at this observation.

      Am I doing something wrong?
      Do you know of some script that reads an INI file?

      Bey
      Attached Files

      Comment


      • #4
        Hello Bey,

        EFS 7 symbol limit:

        The EFS functions, getValue(), open(), high(), low() and close() all have an optional symbol parameter to allow you to access data from symbols that are different than the current chart symbol. This allows you to do spreads within an EFS as one example. EFS limits the number of total symbols that may be accessed through a single EFS to 7.

        DLLs:

        The DLL object in EFS was intended to be used with custom DLLs to give third party developers added functionality through EFS as well as an additional means of protecting their intellectual property. I'm not an expert on windows dlls, but it seems as though there are some other returns you're describing that EFS is not recognizing from the windows dll. I don't think the DLL object was not intended to be used with windows DLLs. At any rate, I see in your comments that x = 0, which indicates that the dll.call() is working. However, in your script, I don't see any code that is changing the value of sValue. It is declared as undefined and passed to the dll.call() as undefined. In your debugPrintln statement, sValue, is still undefined as I would expect. Changing the values of a variable through EFS must be performed directly. Somewhere in your code there must be a "sValue =" action, for lack of a better word. I don't think you're going to be able to accomplish what you're trying to do with the windows DLL without some modification to EFS or the DLL object. You can send a request directly to the development team to review this at [email protected].
        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

        Working...
        X