Consulting

Results 1 to 3 of 3

Thread: Market- making algorithm

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Market- making algorithm

    I need help with writing a vb. code for a market making algorithm that shall run on Rotman Interactive Trader. The security is called OGO.
    Rules are :
    1. Create a VBA function to trade algorithmically. Function to run once per second.
    2. Function should cancel any open orders.
    3. Function should then submit two limit orders, one to buy and one tosell.
    4. limit your exposure, either by reducing your tradingvolume as your position increases, or adjusting your spread.
      5. Mmax trade size is 6000 shares. Yourposition limit is ±35000shares. You will not be able to exceed this limit. Tradingcommissions are $0.01, but you get a $0.005 rebate for submitting limit orders(providing liquidity to the market).







    This is what I have so far. Some things are missing and others may not be correct and I am not sure how to finish the algorithm vb code.


    OptionExplicit

    Function MarketMaking(timeRemaining As Integer) As String

    'Declare the Rotman API
    Dim Trader As RIT2.API
    Set Trader = New RIT2.API

    Dim status As Variant 'Needed to place orders

    MarketMaking = "Have 2 Orders"

    If Range("B6").Value <> 2 Then
    'Cancel my open orders
    Trader.CancelOrderExpr ("Price>0")
    'All orders have price > 0

    status = Trader.AddOrder("OGO", 1000, Range("D4").Value - 0.05, Trader.BUY, Trader.LMT)
    status = Trader.AddOrder("OGO", 1000, Range("D4").Value + 0.05, Trader.SELL, Trader.LMT)

    MarketMaking = "Placed 2 Orders"
    End If
    End Function
    Last edited by SamT; 03-06-2018 at 09:16 AM. Reason: Removed some linefeeds from code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •