Skip to content

Tag: finance

Pivot function results differ from TradingView

I’m using this code to calculate pivot points. This returns an array with 0’s where there’s no pivots and the value of the pivot if there is one. When Comparing the results to TradingView (downloaded csv with pivot points), the only time it matches exactly is when lookback left and right are…

Monthly Data Produces NaNs in Dataframe

When fetching monthly data using xbbg, I have been running into an issue when I mix the BAUBIL Index with the LEGATRAH Index. I am expecting to get a dataframe with one entry at the end of each month, but end up with two in some months, with one as NaN and the other populating with data, as in the

Using PuLP to minimize two sums in python

I am trying to find the optimal weights of two indexes (stocks and bonds) to mimic as closely as possible a stocks return. (NOC stock). I am having trouble setting up PuLP to minimize the sum of squared differences. objective function: (minimize) (sum of weighted stock returns + sum of weighted bond return &#…

Scraping etoro with python

I’m trying to use Selenium to automatically connect to my etoro account and get some figures from my portfolio. I work on Google Colab and from now, here is what I have: However, I have this error message I have tried to change and use find_element_by_class, by_xpath, etc but I couldn’t find how t…