Anyone write a Visual Basic program to help their trading?

Discussion in 'Trading Software' started by monty21, Mar 26, 2009.

  1. I've heard from the investment banking world that traders can write their own Visual Basic programs without a background in computer program. Has any of you done this?

    Considering you aim to write a fairly simple program, how much would the project take?]... 3 months, 6 months or one year?

    Also, what are the limitations of VB for such a program. Can real-time quotes/data be incorporated?

    If anyone has a strong Visual Basic background and knows how to incorporate real-time data into a program, please send a PM and maybe we could work on some things.
  2. Brabed


    I work with Excel / VBA. It has the best of both worlds for a trading system developer, the ability to code in VB and the ability to easily store data without learning all of the database SQL type stuff. Although VB and VBA are slightly different. Also, getting real time data is very simple with a DDE link in a spreadsheet, then you can manipulate that data any way you want with VBA code.

    I've thought about other languages, but this one meets all of my needs. I don't know if this answers your question but I hope it helps.
  3. Bob111


    what do you mean by fairly simple?
    just describe a little bit more
    i don't think that this is possible for person who does not know anything at all about programming. VB is great language,easy to learn,but it's not just point and click. don't know about limitations..i can't see any..unless there is something really complex OR there is specific requirements from broker...i work with VB and IB's API for years..incorporate their real time data is pretty simple. many samples are available at TWSAPI yahoo group.
    keep in mind one more thing-write a code is easy, testing is most time consuming part.
  4. I understand the basics of VB and how is works. I'm more worried about the computer language part though... I'm confident I would learn what I have to do but it may consume too much time because I'm a beginner nevertheless.

    I want to start with a simple concept. For example, track how stocks that are priced over $100 trade (stocks will be filtered: a minimum volume, mkt cap and other features) and whether they outperform/underperform the S&P 500, Dow, Nasdaq, Russell 2000 for the day. Later, track by every 5 minutes. I'm pretty sure I can accomplish this with Excel alone, but it would get much more complex. There are as many as 100 variables and I would ultimately combine them. My goal is not to develop a trading system wit buying signals, but more of a visual tool that "computerizes" my intuition.

    My description may be quite confusing, so I'll give another example. Say that I'm trading the S&P futures, I would like to know what is making the mkt move. Instead of looking at 30 charts simultaneously I want a program that quantifies my variables.

    1) List earning stocks (big cap stocks that influence mkt) and quantify how they are performing relative to the mkt.

    2) Economic releases and effect on mkt 10 minutes before release, during release, 10 minutes after.

    3) How important stocks are trading (i.e. GS, XOM, whatever moves the mkt). Are they on highs, at lows...where are the heading relative to the mkt.

    4) Important commodities...and is it coorelated to mkt... OIL!

    5 )Which sectors and maybe even more specifically industries are outpeforming/underperforming the mkt. (If consumer staples are best, then its bearsh mkt sentiment).

    6) What are bonds doing? For sentiment purposes...30 yr Treasury steeply rising? May be bearish..

    7) Is the dollar doing any extraodinary?

    8) How S&Ps are trading at assumed Support/Resistance levels. (previous days low, highs, historical levels.)

    9) How is Europe closing shortly before 10am?

    These variables continue... I am looking to quantify them so I can speculate whether the mkt is becoming increasingly bearish, bullish or staying neutral.
  5. You can do quite a lot, surprisingly with both vb and vba, however, I've found sometimes, nested functions can be very tedious to actually write (SVMs, anything having to do with matrix computations and or parameter solving), so you can also combine tools. I.e. maybe let another tool handle some of the more complicated functions. Also, if you do not write the sub functions efficiently, they can be a drag on performance.

    Regarding relationships during extremes etc.. downturns show strong visible correlations across many instruments.
    I just started reading LONG/SHORT market dynamics, and although I'm not too impressed yet, they show some clever ways to see this phenomenon using excel as the tool.

    There is definitely a lot of room for creativity in this field, the key is sifting through mountains of ideas and finding something that is useful OOS, and that requires a great deal of leg work.

    Amongst other well known relationships, take a look at the steepness of the yield curve before the recent bounce, that is usually a good indicator that a bottom is near. Same thing happened at the top (inverted), although sometimes they take a while to kick in, and we all know about rational markets and patience.:D
  6. Bob111


    you call this fairly simple? :D :D :D

    buy 100 XYZ if MA >X-that's fairly simple.
    now let's go to details...
    because it's involve real time/historical data subscription,validation of this data,validation of connection for data and order,check if data is streaming, store the data,extract the data,calculations,placing order,receive and handle respond from order server, if filled-calculate and place stop,if not fill-do something else,if filled and price hit the stop and did go thru it-what to do, if stock is halted-what to do,if market data screwed-what to do,if internet connection dropped-what to do.
    all this is a must for this little "system" above..because from my experience-if you skip any of them(there is could be much more)-they will screw you soon is only couple variables in this one and you talking about 100's...i would suggest you to take a 6-9 month's programmers course..cost few K's but if the teachers are good-imo well worth it..i personally think to code what you describe above from scratch with little or no knowledge is impossible.
  7. Thanks for the input and honesty. My concept does get quite complex, but initially I just want to learn a simple formula and see how it works. I couldn't apply it for trading, but it would be the first building block.

    I don't use moving averages, oscillators and the vast majority of indicators (only economic ones). I've never meet anyone that is consistently profitable over the long run that has strategies such as, "buy when the 20-day moving averages crosses over the 9-day RSI" :p
  8. Bob111


    i never use them either :D
    it's just an example...i can say buy XYZ if price reach X...or support or whatever..
    anyway-as i said above-if you are IB's customer(actually even if you not)-you can join TWSAPI yahoo group and grab some examples from there and use them as your starting point with IB demo. same for MB trading, but IB's activeX much easier to use with VB
  9. I'm glad to hear that VB and VBA could help me achieve my goal.

    I'll look into the long-short mkt dynamics.

    Thanks about your yield-curve curve insight... is this backtested and a normal phenomenon? My philosophy is that the mkt continually evolves and changes and therefore history does not allows repeat itself (I know this improves the probability though). I guess my trading is more intuitive for the moment.
  10. richardm


    I have heard that tradersstudio has a code wizard which is in a visual basic like language - - also has optimization stuff like neural networks and genetic algorithms...
    #10     Aug 24, 2009