VBA for backtesting

Discussion in 'Strategy Building' started by Huskeez, Oct 17, 2013.

  1. Huskeez

    Huskeez

    Anyone here use VBA via Excel to test trading strategies/backtest/calculate probabilities etc

    Just wondering before I dive head first into it! xxoxoxoxooxxooxoxxo
     
  2. Have you considered hiring a freelancer to do the coding?
    If you know some programming, you can even design the codes
    and farm each part to different programmers.
     
  3. fx0011

    fx0011

    Could you enlighten me as to why someone would choose to use VBA code when there are so many free backtesting programs around, like Ninjatrader for example? AM I missing something?
     
  4. Bob111

    Bob111

    you missing a lot.i'm not familiar with NT,but i'm pretty sure that there is plenty of conditions not covered in NT. in VBA you can work with classic database (such as MS access) for example or using variety of files. can you do portfolio testing in NT? can you filter trades that are above current ask or below bid (plenty trades like this on stocks)?
    can you scrap data from websites in NT? and many many more
    bottom line-FLEXIBILITY(VBA might be a bit limited,but VB (for example) will give you a COMPLETE flexibility. you can do whatever with it.
     
  5. gmst

    gmst

    +111
    Great points.
     
  6. Not VBA via Excel but plain Visual Basic, yes.

    But what is the question?
     
  7. Bob111

    Bob111

  8. I am migrating all my automated system to the XL arena for the sake of this word, flexibility.

    Tough project but decision made.

    Hopefully, on New Year, i would have something to play with.
     
  9. Murray Ruggiero

    Murray Ruggiero Sponsor

    Developing a backtester in Excel is too slow , I wrote one 15 years ago and even did a 9 part series on Excel in Futures magazine. About 12 years ago I release a trading platform which you programmed in VBA for Excel, but it was too slow.

    If your doing toy strategies and what to play you can use Excel. Speed is a issue, If you want flexibility and a rich environment you need to code a lot of things in C++ and support multi-threads. Even .NET is hard because if you don't know how to code it is very slow, for example Variant's used in VB 6.0 need to be object in VB.NET which makes them run even 5-10 times slower than even the old VB 6.0 code. You need to use strong typing.
     
  10. Bob111

    Bob111

    slow is 'relative'. it might be slow if one doing back testing on 5-10 years of tick data on old PC for whole stock market :)
    but it doen't mean that it would be slow to use in backtesting let say on EOD data,stored in binary format on decent machine like average i5 with SSD
    not to mention the obvious fact that VBA is much more 'user friendly' than .net or c++ :)
     
    #10     Feb 3, 2014