Questions tagged [financialinstrument]
15 questions
13
votes
2 answers
Is there a general manual for the R packages, "quantstrat","blotter","FinancialInstrument" etc. other than the function help files and demos?
I'd like to learn how to use these packages, but I cannot seem to find any vignettes that offer something other than extensive code snippets. I'd like to learn about how they all fit together and something akin to a "walk through".
I've found some…

n.e.w
- 1,128
- 10
- 23
3
votes
0 answers
Multicurrency strategy - Blotter & Quantstrat
I would want to rebound on this thread
http://r.789695.n4.nabble.com/Multi-currency-example-for-blotter-td1692132.html
Basically, I'm backtesting a strategy using quantstrat where I have instruments in several currencies but I would want an…

NicolasB
- 83
- 5
2
votes
1 answer
Simple American Option Pricing via Monte Carlo Simulation in R - Results are too high
I am more of a novice in R and have been trying to built a formula to price american type options (call or put) using a simple Monte Carlo Simulation (no regressions etc.). While the code works well for European Type Options, it appears to overvalue…

novice1337
- 21
- 2
2
votes
1 answer
How to get current "symbol" inside custom function when applyIndicators or applyStrategy in quantstrat
i would like to access the current symbol string eg "GOOG" inside my custom indicator function. Here is the most basic example i could make.
require(quantstrat)
Sys.setenv(TZ="UTC")
symbols <- c("GOOG", "AAPL")
getSymbols(symbols,…

GeV 126
- 351
- 1
- 3
- 14
2
votes
1 answer
R: Quantstrat TxnFees Multiplier
I am trying to run a backtesting strategy in R's Quantstrat package. The instrument is Wheat futures and is quoted in US cents. The contract size is 5000 bushels. I have therefore added the following code.
future(symbols,
currency = "USD",
…

youjustreadthis
- 622
- 3
- 9
- 24
2
votes
1 answer
R - FinancialInstrument Package Changing Symbol Names when using stock
I'm currently in the process of building a strategy using quantstrat/blotter. The price data that I'm using uses numbers as the security identifiers and these numbers are therefore the column names as well as what I use for the synbol names in…

user6893
- 143
- 1
- 2
- 9
2
votes
1 answer
How to setup futures instruments in FinancialInstrument to lookup data from CSIdata
Background
I am trying to setup my trade analysis environment. I am running some rule based strategies on futures on different brokers and trying to aggregate trades from different brokers in one place. I am using blotter package as my main tool for…

CHP
- 16,981
- 4
- 38
- 57
1
vote
1 answer
Pricing a Forward Rate Agreement using QuantLib Python
Can someone please help with the pricing of the following forward rate agreement using QuantLib Python?
A 3x6 forward rate agreement, with a notional of $100,000, the FRA rate being 6%, The FRA settlement date is after 3 months (90 days) and the…

ql.user2511
- 369
- 2
- 12
1
vote
1 answer
Exporting FinancialInstrument:::.instrument to foreach workers and unpacking it
I am doing some parallel processing and need to access instrument properties from FinancialInstrument:::.instrument environment at each worker spawned by parallel processing.
Simple instrument.list <- as.list(FinancialInstrument:::.instrument) and…

Samo
- 2,065
- 20
- 41
0
votes
0 answers
Difference between Clean Price, Dirty Price and NPV using QuantLib Python
I used QuantLib Python to price a fixed rate bond.
I used ql.ActualActual(ql.ActualActual.ISMA, schedule) to ensure that cash flows are the same for each coupon payment period.
For discounting, I used ql.Actual360() as day count convention.
My codes…

ql.user2511
- 369
- 2
- 12
0
votes
1 answer
AlphaVantage API Technical Indicators: Do they use only information of the past?
I am writing because I found no public documentation or code to solve this doubt. I have been using the AlphaVantage APIs for a project about stock markets prediction with Machine Learning. I have been using a lot of technical indicators of the…
0
votes
1 answer
Instantly update fields of forms - Django
I am still on the way to learning Django.
I am going to create an app. That would essentially be an instant financial ratios calculator. Which would comprise of various forms (say like Loan calculations, Mortgage calculations, interest calculations,…

G.Jan
- 132
- 2
- 10
0
votes
1 answer
How to discount Cashflows with variable discount rates and sum all cashflows
I am trying to price a bond that will pay coupons (c) semiannually for 4 years (which means 8 coupon payments in total) and return the principal (p) amount along with the 8th payment (c+p). The discount rate (dr) to discount each cashflows will be…

Fin123
- 1
- 1
0
votes
2 answers
Instrument objects in R's `FinancialInstrument` package. `ls(envir=FinancialInstrument:::.instrument)`
I'd like to load one of my xts object as financial instrument in my environment (vs. getting the symbols from yahoo, google, etc) but I can't.
My xts is a EURUSD daily OHLC series.
ls(envir=FinancialInstrument:::.instrument) is giving me :
[1] "IWM"…

Olivier.S
- 15
- 5
-1
votes
1 answer
R: FinancialInstrument initialize cross currency instrument not working
I want to initialize a curreny pair using FinancialInstrument. The data contains exchange rates for a certain currency pair (e.g. USD_CHF, USD_EUR etc.).
But this doesn't work, why?
> currency("USD")
[1] "USD"
>…

MichiZH
- 5,587
- 12
- 41
- 81