Automated System With Limit Orders

Discussion in 'Automated Trading' started by mindfull, Oct 15, 2005.

  1. I don't think they offer datas for this purpose, you
    have to buy them, no alternative
     
    #11     Oct 16, 2005
  2. NanaTrader,

    What I was saying is that if you have means to do so you can in fact record all levels of the order book, their prices, and their volumes, at snapshots or each and every time any of them change. I have such data but it is not for sale. A good programmer could use such data to insert his orders into the book in a backtest at a precise level and make sure all of his order was executed. Again, this takes good data and some work to accomplish.

    In terms of modeling limit orders without precise tick data you can do some compromises using probabilities of filling. Consider the case of entering a short limit order in a backtest. The market is at 100. You may get your signal to enter a short limit order at 102 and you only want your order in the market for 5 minutes. Three things can happen.

    1) Data shows no executions ever touch your price.
    2) Data shows an execution at your price but none higher.
    3) Data shows an execution at your price and many executions higher than your price.

    So in case 2 you're not sure you would get filled in realtime but you could assign a probability of this of say 20%. Here's what the code would look like.

    if max(market(bar:bar+5))>limitprice,

    %record your trade here at limitprice

    else

    if max(market(bar:bar+5))==limitprice,
    prob=0.20;
    didwefill=rand(); %random number between 0 and 1
    if didwefill <=prob,

    %record your trade here at limit price

    end;
    end;

    end;

    Did you get that? See how if our random variable fell under 0.20 (20%) we allowed the fill to process, but if not we did not?


    Also why is it a bad idea to use auto papertrading as a validation if you do it properly?
     
    #12     Oct 16, 2005
  3. paper trading is fine for weeding out code errors, logic errors and understanding the dynamics of what you are doing.

    But I think it's prudent to then give yourself a trial period of real trading with reduced capital before pronouncing the final evaluation. I think most people who have traded some decent size would agree with this point - the behaviour of depth/liquidity is quite .. unpredictable, and it's nuances cannot be captured in most simple simulations.

    Just one man's opinion.
     
    #13     Oct 16, 2005
  4. this is a simple and good idea. It's always good to know what fill rate you need in order to stay positive. You'll always get filled on trades going against you, so there is a significant bias here.
     
    #14     Oct 17, 2005
  5. Choad

    Choad

    Ain't that the truth! :(
     
    #15     Oct 17, 2005
  6. That's actually not the truth. I spent a couple years believing this until I did some extensive testing on faster strategies.
     
    #16     Oct 17, 2005
  7.  
    #17     Oct 20, 2005
  8. toe

    toe

    I am a Quant Developer user, it does allow you to record quote and depth data from your data provider. However my guess is that trying keep a track of where your order is in the queue this way would be near impossible.

    I think the idea of a randomised filter if a trade just touches youe quote is a good one. And if you really want to be pedantic then trade it live long enough to analise what the random filter should be set at.
     
    #18     Oct 23, 2005
  9. You really sound like a quant, albeit of the random kind. Love to see you guys live in the market while trying out settings for random filters.
    :D
    PS: don't let any feelings of being pedantic hold you back.
     
    #19     Oct 23, 2005
  10. toe

    toe

    "You really sound like a quant, albeit of the random kind. Love to see you guys in the market while trying out settings for random filters."

    ha ha, sure but it seems he's tested it well enough to be otherwise confident in the system, and that this is the final confirmation he needs. He did say it misses trades in realtime trading (which are filled in backtest), he can only know that if he's traded it. So just use that data and dont be taken by no-nonsense :D

    Also another way to do it without 'peeking' would be to set a limit order only after four trades have already been made beyond your limit. If you are filled then your trade will be the fifth trade beyond your limit (meaning you assume you are always fifth in the queue).
     
    #20     Oct 23, 2005