Question for Sterling users About DDE link and Excel.

Discussion in 'Automated Trading' started by CowboyBlue, Jul 24, 2009.

  1. Didnt really know where to put this but i thought that this forum would probably have most of the technically inclined users.

    So my questions is as follows:

    I am using the DDE Link to link Sterling to excel, to backtest a system. This system trades the entire list of S&P500 stocks, so i have a list of 500 stocks with the %change and Last price linked in, then when my set of variables kicks in excel takes a snapshot and records the PNL of the positions. The problem i am having is that the DDE link keeps on kicking out on me and it stops recording, is there any way around this?? Am i just linking to much information for Sterling to handle??

    Any help is appreciated

    -Thx in advance

  2. Anyone?
  3. Could you provide details of the following, I dont get it.
    I dont use Stearling (IB) but maybe I could help.
    edit: I was refering to "then when my set of variables kicks in excel takes a snapshot and records the PNL of the positions"
  4. Dont really wanna say to much about the strategy itself but basically excel freezes the price in a cell where my variables have lined up, so i know the price i entered at then from the current price column i can see how big of a winner or loser something is, then excel will also take a snapshot of my pnl if i was holding all my entries every 15 minutes throughout the day.

    The problem is that My link to sterling just cuts out randomly every 45 or so minutes throughout the day so i have to keep coming back and checking on it throughout the day, basically my link for prices is through sterling and that is what keeps cutting out on me.
  5. Try adding some VBA

    Use VBA's ontime method to run an update macro at now + 15 minutes. When your macro updates have it call the ontime macro so it creates a loop updating every 15 minutes.

    Sub TimedUpdate()
    Application.OnTime Now + TimeValue("00:15:00"), "MyMacro"
    end sub

    and in "MyMacro" call timedupdate

    Google: VBA Application.Ontime