Tag Info

6

As far as I know there is no library. With some other researchers, we implemented this 20 years ago in scheme (yes, it was long ago, when Lisp, and not python, was the language of AI). Our methodology (that was really fast), was the following you need a time scale, one week for instance mark all the local minima and local maxima at the time scale now you ...

6

The problem is that you are not pricing the same thing, and for two reasons: The vanilla instruments you are pricing should start on spot date and have a maturity with that start as reference The frequency of the fixed leg on the OIS swap should be annual. If you change you code to: print('TENOR \t PV \t fairrate% \t fairrate% + fairspread%') calendar = ql....

4

You can use the standard black-scholes formula to price an european option. The only parameter you do not know to use the formula is the volatility. If you have the price of an american option then you can use the Cox-Ross-Rubinstein (CRR) model to backout the implied volatility. Then just use black scholes. The CRR model: In the framework of the CRR model, ...

4

First, the error is because you should input the cds_vol as a quote. So instead of cds_col use ql.QuoteHandle(ql.SimpleQuote(cds_vol)) Apart from that the .setPricingEngine() method will affect the cds_option object directly, so you should use it as: cds_option.setPricingEngine((ql.BlackCdsOptionEngine(probability, recovery_rate, risk_free_rate, ql....

4

You first run your FF three factor model. And get an estimate of $\alpha$ and $\beta$ for each factor. Then for each month $t$, you run a cross-section regression: $r_{i,t} = \lambda_0 + \hat{\beta}_i {\lambda}_t + \epsilon_{i,t}$ Where: $\hat{\beta}_i \equiv [\beta_{i, MktRf}, \beta_{i, SMB}, \beta_{i, HML}]'$, is a vector of the coefficients estimated ...

3

here is a quick list you can apply for quant finance and use as projects: Risk ( as markets seem quite uncertain ) Predict the risk factors exposure of a stock given its quarterly reports and press releases. If a stock started trading only recently, you have very little information to assess its exposure to risk factors. NLP can help by using the reports of ...

3

Try changing LocalSymbol to tradingClass and changing Last..Month to last..Month: fut_contract = Contract() fut_contract.symbol = 'MNQU0' #MNQ SEP'20 fut_contract.secType = 'FUT' fut_contract.exchange = 'GLOBEX' fut_contract.currency = 'USD' fut_contract.tradingClass = 'MNQ' fut_contract.lastTradeDateOrContractMonth = '202009' #Request Market Data app....

3

The GBM model can be written as: $$\delta S_t= \mu S_t \delta t+\sigma S_t\delta t$$ The above is short-hand for the following SDE: $$S(t)=S(0)+\int^{t}_{0}\mu S(h)dh+\int^{t}_{0}\sigma S(h)dW(h)$$ Solving the above SDE yields an expression that you implemented in your code: $$S(t)=S_0exp\left((\mu-0.5 \sigma^2)t+\sigma \sqrt{t} Z\right)$$ The Black-...

2

The drift in your code is: drift = (mu - 0.5 * sigma**2) * delta_t So I assume you are using the Geometric Brownian Motion to simulate your stock price, not just plain Brownian motion. Therefore your model is Lognormal, not Normal. Also, I assume that the time series that you're downloading is daily closing prices. The solution to the GBM model is the ...

2

A possible solution to this problem is using Neural Networks ... Recently there have been some academic papers about "Financial Vision" which would seem to meet your need, but they do involve deep neural networks, which might be a steep learning curve for you. The link to the github is https://github.com/pecu/FinancialVision from which you can get ...

2

Could you possibly use the matrix flag labelling technique? The following provides some documentation and you can always design your own custom flags. I think it will be a good tool to investigate: https://mlfinlab.readthedocs.io/en/latest/labeling/labeling_matrix_flags.html

2

This is really a career advice question, which doesn't belong here. But if it were rephrased to ask for ideas for a cool / impressive NLP school project, I'd suggest: parse a financial derivative term sheet, decide whether it is a "vanilla" trade that we know how to book, or it may have some exotic features that a human needs to look at; parse an ...

1

your problem is pattern recognition. considering you already identified the desired output pattern (entry/exit points), you can use supervised methods of machine learning to train. many are available, a support vector machine for instance, recommend you to check the scikit learn module out, it has practical and fast implementations. you would have to divide ...

1

Not sure why you would want this because you have quotes for EUR6M and EUR3M directly (Swap vs 3M and 3M Futures). Also not sure, why you would have more nodes for the 3M since both swaps and basis swaps are quoted with maturities in years. Anyway, here is an example that might be helpful: import QuantLib as ql import numpy as np import matplotlib.pyplot as ...

1

Check out https://www.npmjs.com/package/metaapi.cloud-sdk as well. This is an SDK for the MetaApi service https://metaapi.cloud. It essentially acts as a bridge for communicating with MetaTrader brokers.

1

I recommend @chrisaycock's answer for completeness. However if you want a quick and dirty way of extracting the payload, you'd use tshark instead of tcpdump: tshark -r NYSE_XDP_IMB_2.2.pcap -T fields -e data This can be useful sometimes because many exchanges (NASDAQ, Australia and SIX Swiss come to mind) typically send you historical samples with only the ...

1

I've created an example for how to access UDP packets in a pcap file. The gist is that you have to skip the Ethernet / IP / UDP headers to reach the payload. That's what gets passed to your feed handler. As for tcpdump, it won't pass the payload to you, but it's still helpful for verifying that you understand the contents when parsing. Eg., tcpdump -r ...

1

My understanding is that a Sharpe Ratio must be calculated based on the actual trading days elapsed, not on the days traded. The calculation proceeds as follows: 1) Establish a list of all trading days between 6/2/2016 and 6/9/2020. You could start with a list of all calendar days, remove Saturdays and Sundays and then remove the NYSE holidays listed on ...

Only top voted, non community-wiki answers of a minimum length are eligible