Is their a Site to BackTesting effect of VIX on Assets/ETFs

Discussion in 'App Development' started by marshg, Sep 3, 2015.

  1. marshg

    marshg

    Hi:
    I am not a programmer nor do I intend to learn (unless very simple), but I am interested in backtesting the effect VIX levels have on various assets/etfs. Ex. when the SMA of VIX is > 20, the VQT returns x%. Is there a website that allows one to do that without programming yourself; if not is there a clever programmer here who could write such a program that a non-programmer could use? [obviously for pay].

    any help would be appreciated.
    thanks,
    Marshall
     
  2. WeToddDid2

    WeToddDid2

    Isn't VIX reflective of the marketNOT the market/asset prices reflective of the VIX?

    In other words, do you understand what the VIX is?

    It sounds as though you are saying the VIX goes up therefore the price of various assets go down. Is that what you are saying?
     
  3. sprstpd

    sprstpd

    I know you don't want to learn programming but a website like Quantopian or QuantConnect would make your backtest pretty easy to do. Python is probably easier to start with so I'd choose Quantopian. Plus both websites they have lots of data to use that you wouldn't have to get yourself. So it might be worth your time to learn just a little bit of programming and see if you could do it yourself. Plus then you wouldn't have to pay somebody else to do it and you could probably use your experience to code up other backtests that you come up with.
     
  4. marshg

    marshg

    thanks for your responses.
    WeToddDid2: yes, I definitely understand what the VIX is and when it hits certain levels it indicates a regime change in market psychology. Thus, it can be a good indicator for figuring when to be in or out of the market or shift assets. I'm surprised it isn't used more.

    sprstpd: I've been to Quantopian many times, but was intimidated by the idea of posting/using myself so never tried. How long do you guess it would take a beginner to learn [who is reasonably computer literate]? Also, I wonder if anyone would offer online coaching in it [?]. My business has done well so I don't mind getting outside help/paying for it.
     
  5. [​IMG]

    I had R up and I recommend the language highly for this type of study.
    I realize you are looking for a site to do it in a very easy manner; I'm not aware of one. In your case, you might want to start out just trying to do the exercise in excel (spreadsheet)... it is easier to start out and allows you flexibility, IMO.

    The graphic is a histogram overlay comparing next day vqt returns (cl-cl) by signal threshold (here it is the SMA of vix equal to 20). Little difference outside of outliers (as one might, reasonably, expect).
     
    Last edited: Sep 3, 2015
  6. marshg

    marshg

    dtrader: First, I wish there was an emoticon for gratitude--thanks so much for your efforts/work. I also wish I could buy you a virtual beer. I hope I'm not pushing my luck or exposing my ignorance as a helpless cause to ask for some explanation. I'm guessing this indicates overall it works well to be in VQT when vix sma is >20. Assuming that is correct, is there anything more specific? Also, since I suspect I'd have better luck with asking for R programmers to help than do myself, per chance do you have any recommendations for finding such a person or perhaps are you willing to handle various such inquiries should I have them? If so, please let me know your rates or some equivalent. I assume you can private message me. Again, thanks for your help!
     
  7. marshg

    marshg

    oh, looking at the chart more carefully and rereading. I see it's showing there isn't much advantage to investing when VIX >20. I think that's what you noted. Assuming that's correct, sorry to miss that the first time!
     
  8. marshg: I coded a backtest tool that may be useful for extracting such information on past data. I arbitrarily chose a 5 D SMA for VIX, and threw in SPY,IWM,TLT, with VQT, started with 100K each, and traded per what I think your example intended from 6/1/2012 to 9/1/2015. Below is the script used, and a "rough around the edges" chart of the closed trade PnL for each.

    upload_2015-9-4_11-54-18.png

    Script: fodder.script, that produced above:
    # Backtest Script
    # Parsed by primary scripting program
    #
    # The processing of this script is case-sensitive.
    #
    BEGIN Script

    # Note: Script is processed in sequence.
    StartDate = 06/01/2012;
    StopDate = 09/01/2015;

    LOAD_SYMBOLS "VIX,SPY,IWM,TLT,VQT"; # Creates day, week, and month containers for subsequent reference!
    VIX_SMA:=MovingAverage(VIX->day,5,SMA); # arbitriarily chose 5 day period for SMA, change to desired value.
    EntrySignal := AND(*->day>0,VIX->VIX_SMA>20); # get signal for all items: SMA > 20
    ExitSignal := AND(*->day>0,VIX->VIX_SMA<20);
    StartingCapital := 400000; # How much capital to invest (divided by # positions for each position)
    ReinvestCapital := 1;
    MaxNumPositionsPermitted := 4; # 4 symbols traded independently and in parallel (capital each will be 100K to start)
    TRADE.filter:="VIX"; # Remove this from all Trades, as is used as signal, not for trading!
    TradeLog := TRADE(*->EntrySignal,*->ExitSignal,MaxNumPositionsPermitted,StartingCapital,ReinvestCapital);
    Chart *_STATIC->TradeLog; # Report Closed trade PnL

    END Script
     
  9. marshg

    marshg

    stepandfetchit: Wow; thanks for this!!! I can only look at this very quickly right now. But looks very helpful; Is the bright green line the VIX itself? I can't immediately tell what it represents.
     
  10. marshg:
    That Green line represent the total PnL of all 4 (IWM, SPY, TLT, and VQT). To simplify I'll remove the other symbols and just provide results for VQT, and add a other graphs to clarify when/why trades were taken. Note: During this period there were only 5 trades, and long VQT only for these short intervals. That may not be what you intended. Used Closing daily pricing for all trades.
    Below is the closing trade PnL for VQT only (note only 5 trades)
    upload_2015-9-5_16-58-24.png

    Below is the VIX with the 5-day SMA, with the EntrySignal added to show when trade is long VQT.
    upload_2015-9-5_17-1-2.png
    Below is the daily chart for VQT with a marker for when long position was held.
    upload_2015-9-5_17-3-1.png
    I uploaded the TradeLog which contains the trades placed for this test, change to .csv to observe in Excel.

    If I misinterpreted what you want, please clarify & I'll change the script accordingly.
     
    #10     Sep 5, 2015