Offering auto-trading long-only options system "sys13"

Discussion in 'Trading' started by botpro, Jan 20, 2016.

Thread Status:
Not open for further replies.
  1. botpro

    botpro

    Ok, my Black-Scholes-Merton method used in the system you can find here for inspection:
    http://www.elitetrader.com/et/index...es-merton-options-pricing-engine-in-c.297419/

    Let me know if you find something unusual...
     
    #131     Jan 26, 2016
  2. ospkfne

    ospkfne

    OK, I reviewed your options pricing code and it looks good too.

    Now having both GBM and BSM algorithms available I can try to show you why using them you can't demonstrate a profitable option trading system. The short answer is both GBM and BSM are designed to be fair and unbiased, which makes them impossible to be exploited in a long run and the only way to make money with them is just plain dumb luck. If real markets were completely efficient, then they would behave exactly like GBM and all these online traders would become online gamblers, playing rock-paper-scissors among themselves while losing money on commissions, taxes, and data fees. Fortunately real markets are not always "efficient" and therefore can be exploited by smart traders who know what they are doing.

    To show you that you can't really exploit market instruments built on GBM and BSM I created a simple program that puts both algorithms together and then simulates what would be your profits if you bought any CALL or PUT option, hold them for N bars (during which the GBM is moving the underlying stock), then sold them at their fair price. You pick your stock price, exercise price, volatility, days to expiration, and number of holding bars. The code will simulate the option buy / sell scenario (as described above) 1000 times every time generating different random path, and in the end it will print the average profit. You will see that whatever parameters you choose, after 1000 simulations your overall profit on both calls and puts will always be close to 0.

    I would like to hear from you how do you want to build a profitable system using GBM and BSM if any option is fairly priced at any time so its expected profit is 0. However you combine these fairly prices instruments together, whatever portfolio you construct, the overall expected profit of your system tested on GBM should always be close to 0.

    Here is the code (BuySell.cpp) I put together and the complete project including your original GBM and BSM algorithms is attached.

    Good luck!

    Code:
    /*
        Compile: g++ -Wall -O2 -std=c++11 BuySell.cpp
    
        NOTE: before compiling, please make sure both GBM.cpp and BSM.cpp are present in the same directory as this file, and that their main() functions are commented out
    
        Usage Example: ./a.out 90 100 30 252 7800 > replays.csv
       
            The example will simulate buying 1 CALL option (exercise price $100, 252 days till expiration, 30% stock volatility) when stock price is $90
            then simulate brownian stock movement for 7800 bars (10 days)
            them sell 1 CALL option at the current fair price
           
            This scenario is then replayed 1000 times, with everything being the same, except different random path is generated for the stock.
           
            For comparison the price of PUT is also calculated.
           
            After 1000 replays the average profit of all CALL and PUT trades is printed out.
            The detailed information about all 1000 replays has been redirected into replays.csv file which can be opened and further analyzed with Excel.
    */
    
    #include "GBM.cpp" // make sure main() in GBM.cpp is commented out in this file
    #include "BSM.cpp" // make sure main() in BSM.cpp is commented out in this file
    
    int main(int argc, char* argv[])
      {
        if (argc < 6) { printf("%s dbSpot dbStrike dbAnnVola%% dbExpDays holdBars\n", argv[0]); return 1; }
    
        const double dbSpot       = atof(argv[1]);
        const double dbStrike     = atof(argv[2]);
        const double dbAnnVolaPct = atof(argv[3]);
        const double dbExpDays    = atof(argv[4]);
        const double holdBars    = atof(argv[5]);
     
          const int replayCycles = 1000;
          const int nBarsPerDay = 780;
         
          const double holdDays = (double)holdBars / nBarsPerDay;
         
          double totalCallProfit = 0;
          double totalPutProfit = 0;
         
        printf("ReplayCycle, stockStartPrice, callBuyPrice, putBuyPrice, stockEndPrice, callSellprice, putSellPrice, CALL PROFIT, PUT PROFIT\n");
          for(int c = 1; c <= replayCycles; c++)
          {
            BSM B;
    
            //
            // Start
            //
            double stockStartPrice = dbSpot;
            B.calc(stockStartPrice, dbStrike, dbAnnVolaPct, dbExpDays);
            double callBuyPrice = B.Call.Value;
            double putBuyPrice = B.Put.Value;
           
            // Move stock by n holdBars
            GBM G(dbSpot, dbAnnVolaPct, nBarsPerDay);
       
              for (size_t b = 1; b <= holdBars; ++b)
            {
               G.generate();
            }
           
            //
            // End
            //
            double stockEndPrice = G.get_cur();
            B.calc(stockEndPrice, dbStrike, dbAnnVolaPct, dbExpDays-holdDays);
            double callSellPrice = B.Call.Value;
            double putSellPrice = B.Put.Value;
           
            double callProfit = callSellPrice - callBuyPrice;
            double putProfit = putSellPrice - putBuyPrice;
           
            totalCallProfit += callProfit;
            totalPutProfit += putProfit;
           
            printf("%d, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f\n",
                c, stockStartPrice, callBuyPrice, putBuyPrice, stockEndPrice, callSellPrice, putSellPrice, callProfit, putProfit);
           
        }
       
        double avgCallProfit = totalCallProfit / replayCycles;
        double avgPutProfit = totalPutProfit / replayCycles;
       
        fprintf(stderr, "=== SUMMARY ===\n");
        fprintf(stderr, "After %d replays the AVG CALL PROFIT=$%.6f and AVG PUT PROFIT=$%.6f\n", replayCycles, avgCallProfit, avgPutProfit);
       
        return 0;   
      }
    
     
    #132     Jan 27, 2016
    gkishot, dartmus and VPhantom like this.
  3. botpro

    botpro

    Thanks for the review.

    Oh oh...
    I haven't tested your code yet, but it is clear that...
    ...you have no *strategy* (ie. no system); then no wonder that it can't work.

    An options system (esp. mine) actively trades the options, it does not apply buy&hold...

    I'll reply later more...
     
    #133     Jan 28, 2016
    VPhantom likes this.
  4. botpro

    botpro

    Ok, now I tested your code. Thx for it.
    But, as already said, it lacks a strategy. A system needs a strategy.
    Otherwise the outcome is a zero-sum game as expected, and as your pgm demonstrates.

    I would suggest to add a strategy, ie. make a system of it, and then test the result of the system over many runs.

    Nevertheless a good experience for me to see what others think of a "system" ;-)
     
    Last edited: Jan 28, 2016
    #134     Jan 28, 2016
  5. ospkfne

    ospkfne

    OK, glad you tried my program and it looks like you agree that buying and selling any single option at any time has ~0 expected profit if the option is priced using GBM and BSM.

    Now why don't you verify profitability of your sys13 as follows:

    1.) Your sys13 generates N trades that give you overall profit of 1000+%

    2.) For each of these trades you should be able to print the option type (CALL/PUT), strike price, spotPrice, expiration date, buy time, sell time, buy option price, sell option price

    3.) For each trade run my program enter: strike price, spotPrice, expiration days, holdingBar = (sell time - buy time)

    4.) My program should confirm that every single of the trades generated by your sys13 has expected profit close to 0 if applied in simulated environment using GBM and BSM.

    5.) How can a system be profitable if it's consisting of N trades with 0 expected profit?

    Possible reasons:
    - Bug in your code
    - Curve fitting due to testing sample too small
    - Your system might be looking into the "future" to make buy/sell decisions

    If you don't publish more of your code, it's very difficult for me to help you find a bug/flaw in your system. But maybe, after reading this you realize that something doesn't add up in your system and it will motivate you to fix its issues.
     
    Last edited: Jan 28, 2016
    #135     Jan 28, 2016
    dartmus and garachen like this.
  6. botpro

    botpro

    Yes, after 252 trading days, ie. a full year of daily trading with 50 bots, some of them doing multiple trades each day,
    totalling more than 2000 roundtrip trades a year (ie. more than 4000 orders).
    The more profit per period one can make (say 1%), and the more periods one can make in t (say 252), the better the result should be, and is, especially since the profits are reinvested from the moment on they are made, ie. compounding is applied implicitly.

    And: you seem still not have understood the true role of GBM in this.

    Sure, but I doubt you can analyze that mass of data. And these data I've not ready for presentation,
    it is currently stored in the runlog file of the pgm which has a size of about 200 MB for each run,
    together with much debug prints etc.
    I've posted 6 results, they contain each an XLS to be analyzed in Excel or LibreOffice-Calc with daily summary results. You will see that the system makes
    on average only about a meager 1% profit per day. So what? Is that really unrealistic?

    Sorry, I doubt you can judge my program. It seems to me that you have never ever written a system.
    Therefore it is IMO useless to discuss this any further with you, especially since you are only interested
    to discredit me as it seems. Or are you seriously interessted in this offer, and just want to go sure?
    Otherwise: why should I waste my time with you? That time is better spent in improving/extending the program, trying out some new ideas & strategies etc... It's all very time-consuming...

    And: your testing method is flawed, because buying a Call _and_ Put with same params is per definition a zero-hedge, ie. locking the status-quo... Nothing else have you done...
    A trading strategy is something different.
     
    Last edited: Jan 28, 2016
    #136     Jan 28, 2016
  7. botpro

    botpro

    Last edited: Jan 28, 2016
    #137     Jan 28, 2016
  8. ospkfne

    ospkfne

    It's only 2000 records per year, one record per roundtrip trade. That should not be a problem to process with my program to check if buy and sell price of options match.

    Trust me I am pretty good at judging other's programs. Very often a fresh pair of eyes finds a bug that original developer can't see. But I understand you don't want to release your intellectual property. There are still a few ways how you can get help: 1. Whoever you show your algorithm would sign an NDA (non-disclosure agreement). 2. You could patent your algorithm and then you are protected in exchange for publishing it.

    Don't take it personally. I am not trying to discredit you as a person, I am just trying to help you understand why there must be something wrong, because your claims are a financial equivalent of "perpetual motion machine of the first kind", a machine which produces work without the input of energy. It thus violates the first law of thermodynamics. (Wikipedia)

    I see that you are tired of our discussion and I agree, we don't have to continue and waste each other's time. Best of luck man with your trading and business activities. I am still willing to help you, you can PM me if you want to follow up privately.
     
    Last edited: Jan 28, 2016
    #138     Jan 28, 2016
    dartmus and garachen like this.
  9. botpro

    botpro

    "Trading options gives you tremendous opportunity for huge gains. 500%+ gains are not unheard of at all."
    These are not my words, you can find it here:
    http://www.financialpicks.com/optiontrade.html

    I have also seen several old postings here on ET saying 500% p.a. is very well possible with options.

    And stock trading systems which make 50% to 150% are "normal" as well.
    If that is possible with stocks, can then the leveraged result of options trading be any surprise anymore?

    I would suggest that you admit to yourself that system trading works. If you don't believe in that then I don't know what you want.
    OTOH if you believe that systems can and do work, well, then this question arises: why do you doubt/question the result of my system?

    Systems trading as used in this system is about taking higher risks and managing that risk good, and then being rewarded for it.
     
    Last edited: Jan 28, 2016
    #139     Jan 28, 2016
  10. ospkfne

    ospkfne

    It's very simple and I am repeating it all the time! You claim that your system can produce profits while tested in a simulated environment using 100% efficient, unbiased, and fair pricing algorithms GBM and BSM. That is impossible in theory. You are basically claiming that you can make money by betting on random coin flips.

    If you claimed your system produced the same profit while tested with real historical data that may have many flaws, biases, inefficiencies, I could not oppose your claims as strongly.
     
    #140     Jan 28, 2016
    gkishot and dartmus like this.
Thread Status:
Not open for further replies.