The "Flipper" strategy

Discussion in 'Technical Analysis' started by Turok, Feb 2, 2004.

  1. Turok

    Turok

    This thread is a takeoff on a thread by abogdan…
    http://www.elitetrader.com/vb/showthread.php?s=&threadid=26567

    In this thread he proposes a strategy which when applied to high beta stocks will, and I quote from his original post…“Effective return will be equal to appr. 1.97% a day which will give you annualized (compounded) about 100*Original capital. Not bad! And there is no risk! You are always "with the market".”

    Later in the thread he posts the formula in full.
    http://www.elitetrader.com/vb/showthread.php?s=&postid=409564#post409564

    Read the original post and you will see why I have called this the “flipper” strategy. I am always intrigued by strategies where “there is no risk” so after a series of comments I promised to code it up and post the results.

    ***********************************************************

    Ok, I had time this weekend to code up the abogdan’s ‘flipper’ strategy in Wealth-Lab. I will present a spreadsheet with the trade results at the end of this fairly long post(s) which will attempt to explain certain decisions I made during coding. To perform this test I downloaded over 100,000,000 records of bid/ask/trade data for KLAC. I picked this stock only because it is the original stock referred to in abogdan’s post. The data was scrubbed of erroneous (or irrelevant) ticks by removing any record that fell more than 0.5% away from the previous record.

    First let it be said that I am actively seeking comments on where I went wrong. Expect me to concede when you have a point and expect me to resist if I feel that you do not. In my experience (I am neither a newbie nor a Livermore) good trading systems end up making sense and trading logic does not magically disappear in a mist of mumbo jumbo. There are enough of us here that know how to move shares that we should be able to generally agree on that process. Let’s have at it.

    ***********************

    Continued...
     
  2. Turok

    Turok

    Continued:

    Things I DO NOT KNOW precisely about this system (or areas where abogdan’s statements conflict with his formulas):

    I am unsure how abogdan calculates his “guaranteed price move”. I will quote from his original post…”

    If you take daily price moves and for each day you take either (High - Open) or (Open -Low) which ever is greater then divide it by Open you would get daily guaranteed price move (Up or Down) For KLAC, for example, there were no days in the past 400 trading days when this move (up or down) was less than 1.045% (Let' say 1%).

    I find his formula in conflict with his conclusion. In the past 400 days, using his formula, I find more than a dozen days with less than 1.045% movement and 4 with less than 1%. (8/15, 8/25, 9/17, 9/19). Actually, there are more than that but I left out all published half market days because is seem a fair conclusion that with the added risk, this system wouldn’t be traded on such days. It is possible that my data is flawed and I would be happy for someone to point this out and back it up. Assuming good data and applying his formula to the data, the number that he starts with (1.045%) and uses for his current calculations would not have been used since March of last year and the number that should have been being used is 0.77%. This delta will play prominently in the success or failure of this system.

    Since his posted formula makes sense, I decided to ignore his conclusions and apply the formula as posted. I think what he wrote was merely in error and would be surprised if the formula is wrong.

    Other assumptions that I made in an attempt to make the results as “real” as possible…

    I thought long and hard about how to handle the transaction at the “flip triggers”. If I’m going long do I use the next offer as my transaction value, or do I take out as many offers as is necessary to get the needed shares, or do I use the following trade values etc., etc. For programming ease I finally decided to just use the FIR smoothed bid/ask values at the time of the trigger to value the transaction. In the case of smaller orders this is probably quite close. For larger orders I would expect the slippage to increase even above these calculations.

    For the profit target and trailing stops I decided to use a similarly smoothed average of the previous trades rather than bid/ask data. I consider this to be a better reflection of the actual market and probably would have used these values to trigger the flips if abogdan’s formula hadn’t specifically said otherwise.

    Continued...
     
  3. Turok

    Turok

    Continued:

    Abogdan did not post an exact formula for the share multiplier. I sure he felt he didn’t need to as it is pretty straightforward. Following is a brief explanation of how my share multiplier formula works. The intent of this formula is not unlike a Martingale strategy where one doubles each losing bet at the casino. Here of course one does not lose ones entire stake at each flip so doubling is not necessary. Abogdan originally mentions 1.1 as an example multiplier but of course later explains that that number will vary. I constructed the formula as follows:

    ExpectedProf = abs(OpenVal – ProfTarg)
    CumLoss = Total losses on trade series since open including commissions
    Needed Prof = ExpectedProf + CumLoss + 2xCommish
    AvailableRange = abs(TradeVal – ProfTarg)
    SharesNeeded = NeededProf / AvailableRange

    This formula gets us exactly where we need to be each time other than small rounding issues in WL that can become quite large when share reach epic proportions.

    All my calcs and the posted spreadsheet use a penny per share commissions. This will not exactly model every traders commission structure, but it’s close enough for pretend.

    The trigger delta referred to by abogdan was set at $0.06 for this test. I moved it up and down and for the test period this setting was the best. Close together obviously results in more flips and farther apart in more slippage.

    The profit target for this test was consistent throughout the test period…0.65% (0.73% * 0.9)

    The simulation begins on 9/16/03 and ends a few days ago. There are two or three days missing in that time and they are either short market days or the data for that day had obvious problems and I deleted results. I start with an initial 1000 shares assumption only because that is what abogdan referred to in initial post. You will notice that none of the days start out with 1000 even shares – that is the above formula doing it’s job. The more slippage incurred (wider spread) before initial purchase, the more shares it will buy to end up with the expected profit. You will occasionally see less then 1000 shares as the initial purchase as negative slippage is encountered.

    The last three columns in the spread sheet display profit for three different strategies. Unlimited flips, three max and five max. These columns are totaled at the bottom. At one point in the original thread abogdan mentions allow a day to go to 11 flips. Clearly according to this test (which is just that) that would be ruinous.

    Abogdan ask for impressions of his system and early in the thread I summarized my thoughts this way…

    >Generally I proposed that the noise will at times cause an
    >unduly large number of flips on some trading days and that
    >this will kill the gains you make on other days.

    >Generally I proposed that your slippage will at times be greater
    >than can be 're-earned' through upping your position (especially
    >on the short side) since of course the larger the position you take
    >to overcome the slippage loss the more slippage you get.

    >I still stand by both of those general positions.


    Currently the test bears those initial impressions out and so I still stand by those general positions. I am however very willing to entertain the discussion of flaws in my testing. Questions about my coding are also welcome.

    JB
     
  4. ig0r

    ig0r

    1. From one flip to another, there is like 10 cents of room, what is that for? For example...


    Short KLAC-11-05-2003-0.657 1,242 1.242 11/05/03 09:30 am 59.01 11/05/03 09:36 am 59.13 -178.13 Flip #1 -178.13
    Long  KLAC-11-05-2003-0.657 1,783 1.436 11/05/03 09:36 am 59.13 11/05/03 09:37 am 58.94 -381.98 Flip #2 -560.11
    Short KLAC-11-05-2003-0.657 3,956 2.219 11/05/03 09:37 am 58.94 11/05/03 09:43 am 59.14 -855.79 Flip #3 -1,415.90


    This was picked randomly, the same issue exists for every trade, where is the flip line here? You are shorting 59.01 and covering 59.13, long 59.13 sell 58.94, short 58.94 cover 59.14. What's going on? 10 cents in slippage/coms or am I missing something? If the flip line is 59.01, for example, you would go long 59.01, then when it came back, short 59.01, then when it came back up you would be long 59.01 (of course I would take a tick off or whatever for slippage/spread). There is something grossly wrong here, there is a reason for the multiplier, to cover the losses to slippage/coms of the previous trade :)

    Edit: Only way I can see this not being incorrect is if KLAC has such a huge spread (8-15 cents!!??), if so, I appoligize, I do not day trade stocks
     
  5. Turok

    Turok

    Hi Gary, it's a good question.

    >If the flip line is 59.01, for example, you would go long
    >59.01, then when it came back, short 59.01, then when
    >it came back up you would be long 59.01 (of course I would
    >take a tick off or whatever for slippage/spread).

    I think you have a misunderstanding of his system. If we were to use a single line (say the 59.01 as in your example) there would be a huge number of flips just from noise. Abogdan's system instead uses *two* lines (the space between he calls the "delta"

    From abogdan's post:

    Calculate Delta:

    Delta = Abs(EntryPrice - ((Ask+Bid)/2) - Commissions - slippage)

    Find optimum Delta over 250 days that has minimum losses
    using the formula Shares*Delta*Flips

    If filtered BidPrice is higher then upper limit of delta then go long
    If filtered AskPrice is lower then bottom limit of delta then go short.


    I have attached the chart shot from the initial entry and first flip for the day you chose. The red line is the smoothed ask average, the green is smoothed bid, the blue is smoothed trade and the two horizontal purple dashed lines represent the upper and lower flip trigger values and are 3 cents off center each way.

    You can see the trades trigger as the dashed lines are crossed.

    JB
     
  6. ig0r

    ig0r

    Oh ya, forgot about that. Ok, I understand now. Those numbers are using the optimal delta?
     
  7. Turok

    Turok

    >Those numbers are using the optimal delta?

    For the test period, 0.06 was the most profitable.

    JB
     
  8. abogdan

    abogdan

    Turok:

    I really appreciate the work you've done. I need to go thoroughly through all of this and get back to you with adjustments that are needed for the system. I'm on the road right now and will try to work on it as much as I can. It might take a few days, but that is what the situation is. On the end, we are running the system successfully in our offices so, I'm sure we can make it work in WLD.
    Thanks again,
     
  9. abogdan

    abogdan

    Ok, I have 15 minutes. First of all, it is really hard for me to follow your code but I'll try to make general comments that jump out right away.

    When you go in (let say Long) in order to determine your shares you have to use "Remaining Percent" which is = TargetPercent - (CurrentAsk - OpenPrice)/OpenPrice. This gives you an idea of how many shares do you need to hold to pay for all the flips plus your target profit. The way we calculate this is following:

    Target Dollar Value of profit = OpenPrice*PercentTarget*InitialShares.

    So at any time your Holding shares should be calculated from the following equation:

    Target Dollar Value of profit + All Losses That occurred before this flip = CurrentEntryPrice*SharesToBuy*Remaining Percent

    Another thing is:

    If you have reached Max amount of flips (in our case it was 11) you are not looking to make profit anymore rather your target is the losses that you encounter so far. This eliminates a lot of losses including days when there is not enough percentage gain.

    There are some other things that we do to make it better, but I need to spend more time to describe them. Please let me know whether this was helpful. Again it does work. It just a little bit more complex than the rough concept that I have described.
    Cheers,
     
  10. jaan

    jaan

    turok,

    interesting analysis!

    however, it seems to me that you have a mistake in your "Profit" calculation formula in cell K351: there you are summing *all* cells in the K column. however, the numbers in that column are *cumulative* profits, not *trade* profits. to get the grand total you should sum the daily profits instead.

    or i'm i missing something here?

    - jaan

    EDIT: i can see now that the problem in K351 calculation is not that relevant to the analysis, as the limited flip columns (L & M) do not have that problem.
     
    #10     Feb 3, 2004