Last active
August 4, 2019 04:52
-
-
Save wlinInspire/9ceef8a1fb86fe274d22bc21d805a35e to your computer and use it in GitHub Desktop.
How to Build an Automated Trading System using R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(IBrokers) | |
| tws <- twsConnect(verbose = FALSE) | |
| symbol <- 'ABC' | |
| quantity <- 100 | |
| lmtPrice <- 10 | |
| placeOrder(twsconn=tws, | |
| Contract=twsSTK(symbol), | |
| Order=twsOrder(reqIds(tws), | |
| "BUY", | |
| quantity, | |
| "LMT", | |
| lmtPrice = as.character(lmtPrice), | |
| tif = 'GTC')) | |
| twsDisconnect(tws) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment