Skip to content
Advertisement

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 both 5. Otherwise it deviates in the number

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

Can’t extract table from yahoo finance

I try to run the below code but still can’t get the proper output in Excel with headers. Please help. The intended format will be in the below pic. Answer If an Excel spreadsheet isn’t mandatory, then your “result” variable can be saved as a txt file in the same formatting in terms of rows and columns by including 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 – stocks return)^2 where the stock and

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 to do it. Could you give me

Advertisement