Anyone write a Visual Basic program to help their trading?

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

  1. rebtut

    rebtut

    VB is easy, but the most difficult part is not VB it will be interfacing with other programs through a proprietary API.
     
    #11     Sep 2, 2009
  2. Agree, VB is easy.
    Interfacing to a trading API is quite easy also (about 100 lines of code).



    To show what is very difficult just one example from the list:

    What is quite heavy: To formulate this in a mathematic form that can be understood by a computer.

    What means "effect"?
    - Simply "going up" / "going down" (binary)?
    - Some correlation?
    ....

    For going up / down: Perhaps 200 lines of code.
    Correlation: 500 lines and above.

    Same thing for all the other points on the list.
    Rough estimation: To implement the whole list 5000 lines of code may be needed and 1-2 man-years!

    The main difficult thing will be to
    formulate properly your ideas in a mathematical way.
    That is a quite difficult task.
     
    #12     Sep 3, 2009
  3. Add up sums, and sums of squares, and plug them into a simple formula -- that takes 500 lines of code? Wtf?
     
    #13     Sep 4, 2009
  4. richardm

    richardm

    anyone have any visual basic indicators or strategies they would like to share?
    we could start a visual basic code repository here...
     
    #14     Sep 4, 2009
  5. richardm

    richardm

    dim ap, bandavg, middleavg as datarow
    dim periods, type, factor as number
    dim Lower, Upper as datarow

    ap = ($HighBar + $LowBar + $CloseBar) / 3
    middleavg = GD(ap, 1, type, periods)
    bandavg = GD(($HighBar - $LowBar), 1, type, periods)

    Lower = middleavg - bandavg*factor
    Upper = middleavg + bandavg*factor

    plot(middleavg)
    plot(Upper)
    plot(Lower)

    SetSignalsOnCrossOver($CloseBar, Lower, Upper)
     
    #15     Sep 4, 2009
  6. richardm

    richardm

    'Startup-Script for Candlestick pattern recognition.
    'Best to be included in single pattern scripts

    DojiPercent = 0.08

    'Special Unit to find candles, preprocessing for subsequent complex combinations

    for i = Startbar($CloseBar) to LastBar()

    'Dojis analyze (minimal body)
    i2 = $HighBar - $LowBar
    if i2 <> 0 then
    BodyPercent = abs($CloseBar - $OpenBar)/i2
    IsDoji = BodyPercent < DojiPercent

    if IsBlackCandle(i) then
    USPercent = ($HighBar-$OpenBar)/i2
    LSPercent = ($CloseBar-$LowBar)/i2
    UpLimit = $OpenBar
    DownLimit = $CloseBar
    else
    USPercent = ($HighBar-$CloseBar)/i2
    LSPercent[i] = ($OpenBar[i]-$LowBar[i])/i2
    UpLimit[i] = $CloseBar[i]
    DownLimit[i] = $OpenBar[i]
    end if
    end if
    next i[/i][/i][/i][/i][/i][/i][/i]
     
    #16     Sep 4, 2009
  7. richardm

    richardm

    'Note that you will need to specify in terms of
    'your program's plot function

    dim FloatAxis, DynVol as datarow
    dim RelOpen, RelHigh, RelLow, RelClose as datarow

    'dynamic volatility calculation
    DynVol = Avg($HighBar-$LowBar, 5)*0.2

    'Relative chart calculation
    FloatAxis = Avg(($HighBar+$LowBar)/2, 5)
    RelOpen = ($OpenBar-FloatAxis)/DynVol
    RelHigh = ($HighBar-FloatAxis)/DynVol
    RelLow = ($LowBar-FloatAxis)/DynVol
    RelClose = ($CloseBar-FloatAxis)/DynVol

    Plot(RelClose, 0, RelOpen, RelHigh, RelLow, RelClose)
     
    #17     Sep 4, 2009
  8. Bob111

    Bob111

    wasting time on coding useless indicators in VB is pain in the ass. you can use something like wealth lab to test basic ideas.
    even biggest pain in ass is check the code itself, to be make sure that all calculations are correct
    here is a good stuff for those with the money.

    http://www.modulusfe.com/stockchartx/
     
    #18     Sep 4, 2009
  9. Or not so basic ones.
     
    #19     Sep 4, 2009

  10. Exactly. VB/VBA has no "framework" for trading. You need a "platform" like Tradestation or WealthLab. Everything is built into it. With VB/VBA, you must build your own framework...this is NOT trivial.
     
    #20     Sep 5, 2009