dynamic exit in excel

Discussion in 'Automated Trading' started by Jgills, Apr 22, 2012.

  1. Jgills


    I am using excel/VBA and i am not yet familiar with c/c++, or other programming languages

    If you think this is the type of problem that is more easily solved in another language, please say so and i'll take this as my time to start learning something else. if you can also point out a good reference to begin learning i would appreciate it.

    i'm trying to program my spreadsheet to do the following:

    if a trade is on, look at the P&L as it moves through time, if the loss is x or below or z # intervals have passed, close the trade.

    If the gain is y or above, set a stop at y*some threshhold and if it continues higher keep moving the stop until it is hit.

    any ideas?
  2. Simple stuff in Easy Language....which is specific to trading. VBA/Excel is not. You've got a lot of functionality to build before you can do this.
    You need functions for determining your position, your time-in-trade, and then a trailing stop function for those positions in the money.
    Good luck !
  3. Jgills


    can easylanguage do calculations such as x day back standard dev, correlations, etc.? im assuming it can
  4. Yep - out-of-the-box.
    Both Tradestation and Multicharts support Easy Language....which was just renamed in MC to avoid copyright infringement.
    I'm excellent at Excel/VBA, but I don't want to waste time creating a trading platform....that's a daunting task in any language. I once considered it, but now I'm definitely moving to Multicharts.
  5. Crispy


    Dont mean to thread jack, but I have excel exit question also.

    I trade ES options with open e-cry. They dont accept stops, and that wouldnt work anyway as price can be points away from my the actual stop level before it actually prints....

    So...is there a way to build functionality that says "if price goes bid X, sell at mkt". If so who can do it and what would it cost me? Ideally I want to just have a cell that I can put my stop in and be done with it instead of watching ticks all day.
  6. That's called a "local" or "workstation" stop. Other stops are "server-side" (broker) or Exchange stop. As you are aware, BUY stops are always above the market, otherwise they convert to a market order...and vice-versa for SELL stops. So it's important that the software detects this condition and warns you before placing the stop order. Many platforms don't do this...which is an oversight IMHO.
    I got "burnt" so many times by making that mistake.
    The good news about "local" stops: no fees or delays for Cancelling and Replacing that order (CAR).
    Bad news: not as fast or as efficient as server-side or exchange stop orders.
  7. Crispy


    Great, I learned something new today! I never heard local/workstation stop terminology.

    Yes, server side stops are simply no good for certain products. ES options def one of those...

    Im not excel savvy outside of using third party add-ins and some light calculations that drive my model. So, how difficult is it to build the program that creates the local/workstation? And would you know what it should cost me(ballpark) to have someone to write it?
  8. I take it you are talking Interactive Broker's platform then ?
  9. Crispy


    Open e cry.
  10. I've got the OEC Excel docs....you are aware they do support STOP orders ?:
    Here's an example of a stop limit:


    This likely goes to the OEC Servers.
    The other technique is to track the price locally and place a market order when your stop price is hit.
    #10     Apr 24, 2012