# Tag Info

0

The problem is quantlib supports only IRS. But you're trying to find NDS valuation. IRS valuation: PV (present value) of the interest payments on the fixed lags: $$f(x) = \sum \limits_{i=1}^{n} \delta({T}_{j-1},{T}_{j}) \cdot K \cdot P(0, T_j)$$ PV (present value) of the interest payments on the floating lags: ...

1

Assuming you are using the inputs from this line: #print("Input to pricer :::",800,' Strike: ',1600.0,' Implied Vol: ',57.82902561325027,' Option Type: ','Call'," Exp Date: ","2021-09-17 00:00:00"," Underlier Ticker: ","TSLA US Equity") it seems you are using the volatility wrong, because your input should be 0.578290, which is 57.8290%, and not 57....

0

Please provide a reproducible example: use dput to provide a small dataset for which the error occurs. In any case, this particular error message tells you that R could not compute f < 0, most likely because f is NA. Which probably means that for some parameter values, the function you pass to fminconevaluates to NA. A somewhat dirty trick to protect from ...

1

this I just want to add some details to noob2 comments and also answer your second question inside the comments. So first lets consider a standard normal distribution $X_0$. This means that $X_0$ has mean zero ($\mu = 0$) and standard deviation 1 ($\sigma = 1$). Let's write $\Phi^{-1}(\alpha)$ for the $\alpha$ quantile of $X_0$. In R you can compute \$ \...

0

You should replace the european payoff line at time=T: W = max(S*d.ˆ([M:-1:0]’).*u.ˆ([0:M]’)-E,0); by the cash or nothing payoff at time T: W=S*d.ˆ([M:-1:0]’).*u.ˆ([0:M]’); for i=0:1:M if (W(i,T)>E) W(i,T)=A; else if (W(i,T)==E) W(i,T)=A/2; else W(i,T)=0; I'm not sure that my code will work on Matlab but I'm sure you can modify it to make it ...

4

I would start by saying that yes, this is an acceptable precision. However, the reason you are not getting the same result is because, by default, QuantLib has accuracy=1.0e-8 and maxEvaluations=100. You can set these parameters like this: bond.bondYield(bond_price, dayCount, ql.Simple, ql.Quarterly, ql.Date(), 1.0e-16, 100) This will get you much closer....

1

If you want people to help you, you really should provide a reproducible example. In particular, you should mention where the Nelson.Siegel function comes from. But as a guess, the maturities (mat) very likely have to be sorted in increasing order.

1

This question should be asked in StackOverflow. In any case: lista_arg.append(arg) is a method that returns None So you should use it just as: lista_arg.append(arg) and not: lista_arg = lista_arg.append(arg) because you are assigning None to your lista_arg variable...

0

I want to implement exactly same principle in C# and realized that i should start opposite. Start from finding Higher High or Lower Low and then checking RSI. After finding HH or LL checking RSI is trivial task. To find HH or LL you could use ZigZag indicator. At investopedia you could find how to calculate it in more details. Also you could check Python ...

0

The following paper provides a solution to the technique you are employing: Predicting stock and stock price index movement using Trend Deterministic Data Preparation and machine learning techniques The abstract reads: ...The first approach for input data involves computation of ten technical parameters using stock trading data (open, high, low & ...

Top 50 recent answers are included