Announcement

Collapse
No announcement yet.

Getting the Index or stock price on trade open & close

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

  • Getting the Index or stock price on trade open & close

    Hi all,

    I'm right in on the ground floor here so I'm sure you can help.

    When I open a trade in EFS, I want to record the actual level of the index or stock price when the trade is actioned and output all the open and close prices to excel.

    So if I open a long at 3.02pm, I want the EFS program to take the index level and send it to excel and do that continually throughout the backtest so I eventually have a spreadsheet in excel with all the open and close prices of my trades.

    Can that be done easily ?

    Thanks

  • #2
    Hello Neil,

    In my opinion, this would not be an easy routine. What you're describing would not be entirely possible as EFS does not have the ability to send data to specific cells in Excel. You can create a DDE link from EFS to an Excel spreadsheet, but that link would go to a specific cell where you enter the DDE formula. So as new triggers occur in your EFS, there isn't a way to tell Excel to enter the new price in a different cell. If VBA in Excel could detect the event where the DDE value changed, then you could have a VBA macro copy the new price to specified cells. However, I'm not sure VBA has that ability. I think your best bet would be to use File I/O in your EFS to build a text file of comma separated data. You could then import that text file into Excel.
    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
      Hello Jason,

      OK - would you have any examples of code showing how to use the I/O function to build a text file of comma separated data? I have never done that before.

      Many thanks.

      Neil

      Comment


      • #4
        Hello Neil,

        You can find all of our EFS Reference material in our EFS KnowledgeBase (see link below my signature). Here's a direct link to the File Object information. If you need more code examples, try using the search feature at the top of the forums. You'll find many threads discussing File I/O.
        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