Skip to content

Instantly share code, notes, and snippets.

View capm's full-sized avatar

Christian Portocarrero capm

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@capm
capm / Bloomberg-xbbg.ipynb
Last active July 1, 2024 07:45
Bloomberg and xbbg python library example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@capm
capm / 20190918-JupyterBloombergAPI.md
Last active May 4, 2022 07:44
Install instructions for the Bloomberg API with Anaconda Jupyter

Bloomberg API with Python

Requirements

  • Windows 10 x64.
  • Latest version of Anaconda.

Setting up the environment

First, we need to install Visual Studio Build Tools in the Bloomberg terminal. You can get the latest version of VS Tools 2019 here. VS Tools allow us to compile and package applications from source.

VSBuildTools

After installing VS Build Tools, you should update your anaconda packages. Use the following code on your Anaconda Powershell Prompt (run it with admin privileges):

@capm
capm / SMV-FM-ValorCuota.vbs
Last active May 23, 2022 22:07
Code to download data from mutual funds from the SMV website.
Sub ValorCuota()
'
' ValorCuota Macro
'
' Turn off all features
'BestPractices (0)
' Declare variables
' Workbooks and worksheets

Principles of Adult Behavior

  1. Be patient. No matter what.
  2. Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him.
  3. Never assume the motives of others are, to them, less noble than yours are to you.
  4. Expand your sense of the possible.
  5. Don’t trouble yourself with matters you truly cannot change.
  6. Expect no more of anyone than you can deliver yourself.
  7. Tolerate ambiguity.
  8. Laugh at yourself frequently.
@capm
capm / vbFunctions.vbs
Last active September 28, 2022 15:33
Common functions I use in VBA.
Private Sub Auto_Open()
Call FXSBS
End Sub
Attribute VB_Name = "capmFunctions"
'XXXXX
Public Function RightToLeftChar(InputData As String, InputChar As String) As String
'
RightToLeftChar = Right(InputData, Len(InputData) - WorksheetFunction.Find("|", WorksheetFunction.Substitute(InputData, InputChar, "|", Len(InputData) - Len(WorksheetFunction.Substitute(InputData, InputChar, "")))))
End Function
@capm
capm / FXSBS.vbs
Created April 4, 2017 14:58
Download USDPEN FX rate from SBS website
Sub FXSBS()
'
' FXSBS Macro
'
' Declare variables
Dim wbMain As Workbook
Dim wsMain As Worksheet
Dim urlFX As String
Dim dateStart As Date, dateEnd As Date
' Internet objects
@capm
capm / MutualFunds.R
Created June 15, 2016 22:23
Mutual fund main variables data manipulation.
#####
## Load packages
#library(gdata)
library(readxl)
library(data.table)
library(tidyr)
library(magrittr)
library(SIT)
#####
@capm
capm / Excel-DateMultiFunction.vbs
Last active January 21, 2016 22:11
Excel VBA Function: Date pattern recognition and replacement.
Function DateMultiFunction(InputDate As String, InputType As Integer) As String
' 0: True or False
' 1: Replace date
' 2: Extract string
' Declare variables
Dim regEx As New RegExp
Dim strPattern As String
'
@capm
capm / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console