Ask coding questions

← Back to all posts
Interface with stock price data feed JP Morgan Chase Module 1
Tee12345 (3)

Hello everyone, i'm a java developer who is trying to solve a python challenge from JP Morgan. I'm stuck in module 1 trying to update this method. Please if you're familiar with this project, please how do i update this method ? Thanks for your help in advance.

def getDataPoint(quote):

stock = quote[stock]
bid_price = float(quote['top_bid'])
ask_price = float(quote['top_ask'])
price = bid_price
return stock, bid_price, ask_price, stock

Comments
hotnewtop
Vandesm14 (2727)

I don't know what the goal of the project is, so I have no idea if it'll work or not.

Tee12345 (3)

Hi, @Vandesm14 This is the task - (Task starts here) -> A trader would like to be able to monitor two historically correlated stocks and be able to visualize when the correlation between the two weakens (i.e. one stock moves proportionally more than the historical correlation would imply). This could indicate a potential trade strategy to simultaneously buy the relatively underperforming stock and sell the relatively outperforming stock. Assuming the two prices subsequently converge, the trade should be profitable <- (Task ends here)
This method def getDataPoint(quote) is to "Produce all of the needed values to generate a datapoint" and i am to update this function.
I'm getting data feed from JP Morgan server but am stuck on how to update this method. Thanks for any help.