Package: Trading 3.0

Trading: CCR, Advanced Correlation & Beta Estimates, Betting Strategies

Contains performance analysis metrics of track records including entropy-based correlation and dynamic beta based on the Kalman filter. The normalized sample entropy method has been implemented which produces accurate entropy estimation even on smaller datasets while for the dynamic beta calculation the Kalman filter methodology has been utilized. On a separate stream, trades from the five major assets classes and also functionality to use pricing curves, rating tables, CSAs and add-on tables. The implementation follows an object oriented logic whereby each trade inherits from more abstract classes while also the curves/tables are objects. Furthermore, odds calculators and P&L back-testing functionality has been implemented for the most widely used betting/trading strategies including martingale, DAlembert, Labouchere and Fibonacci. Back-testing has also been included for the EuroMillions and EuroJackpot lotteries. Furthermore, some basic functionality about climate risk has been included.

Authors:Tasos Grivas

Trading_3.0.tar.gz
Trading_3.0.zip(r-4.5)Trading_3.0.zip(r-4.4)Trading_3.0.zip(r-4.3)
Trading_3.0.tgz(r-4.4-any)Trading_3.0.tgz(r-4.3-any)
Trading_3.0.tar.gz(r-4.5-noble)Trading_3.0.tar.gz(r-4.4-noble)
Trading_3.0.tgz(r-4.4-emscripten)Trading_3.0.tgz(r-4.3-emscripten)
Trading.pdf |Trading.html
Trading/json (API)

# Install 'Trading' in R:
install.packages('Trading', repos = c('https://sa-ccr.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/sa-ccr/trading/issues

On CRAN:

betacorrelationcounterparty-credit-riskfinanceportfolio-optimizationtrading

4.62 score 7 stars 2 packages 20 scripts 156 downloads 55 exports 51 dependencies

Last updated 9 months agofrom:c124346d31. Checks:OK: 1 NOTE: 6. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 16 2024
R-4.5-winNOTENov 16 2024
R-4.5-linuxNOTENov 16 2024
R-4.4-winNOTENov 16 2024
R-4.4-macNOTENov 16 2024
R-4.3-winNOTENov 16 2024
R-4.3-macNOTENov 16 2024

Exports:AngularDistanceBondBondFutureCalcEuroLotteryPnLcapped_fibonacci_seqCarbon_FootprintCarbon_IntensityCDOTrancheCDSCDXChebyshev_distanceCollateralCommodityCommodityForwardCommSwapCrossSampleEntropyCSACurveDynamicBetaEquityEquityIndexFutureEquityOptionIndexEquityOptionSingleEuroJackpotExampleEuroJackpotResultsEuroLotteryAllCombinationsEuroLotteryBacktestingEuroMillionsExampleEuroMillionsResultsFxForwardFxSwapGetTradeDetailsHashTableInformationAdjustedBetaInformationAdjustedCorrIRDFutureIRDSwapIRDSwaptionIRDSwapVolmartingale_strategy_repetitionsNormXASampEnOtherExposureOuterJoinMergeParseTradesroulette_pl_calculator_dalembertroulette_pl_calculator_fibonacciroulette_pl_calculator_labouchereroulette_pl_calculator_martingaleroulette_pl_calculator_specific_numberSampleEntropySelectDerivativestop5Total_Carbon_EmissionsVariationOfInformationWeighted_Average_Carbon_Intensity

Dependencies:cellrangerclicolorspacecpp11crayondata.tablefansifarverggplot2gluegmpgtableherehmsisobandjsonlitelabelinglatticelifecyclemagrittrMASSMatrixmgcvmunsellnlmePerformanceAnalyticspillarpkgconfigpngprettyunitsprogressquadprogR6rappdirsRColorBrewerRcppRcppAlgosRcppTOMLreadxlrematchreticulaterlangrprojrootscalestibbleutf8vctrsviridisLitewithrxtszoo

Readme and manuals

Help Manual

Help pageTopics
Angular distance metricsAngularDistance
Bond ClassBond
Bond Future ClassBondFuture
PnL calculation for EuroMillions/EuroJackpot backtestingCalcEuroLotteryPnL
Fibonacci sequence up to a specified maximum numbercapped_fibonacci_seq
Carbon FootprintCarbon_Footprint
Carbon IntensityCarbon_Intensity
CDO tranche ClassCDOTranche
CDS ClassCDS
CDX ClassCDX
Chebyshev distanceChebyshev_distance
Collateral ClassCollateral
Commodity ClassCommodity
Commodity Forward ClassCommodityForward
Commodity Swap ClassCommSwap
Angular distance metricsCrossSampleEntropy
CSA ClassCSA
Curve ClassCurve
Time Varying Beta via Kalman filter & smootherDynamicBeta
Equity ClassEquity
Equity Index Future ClassEquityIndexFuture
Equity Option ClassEquityOption
Equity Option Index ClassEquityOptionIndex
Equity Option Single ClassEquityOptionSingle
Eurojackpot analysis exampleEuroJackpotExample
Returns all the EuroJackpot results until the end of 2023EuroJackpotResults
Returns all the possible number combinations for EuroMillions/EuroJackpotEuroLotteryAllCombinations
Euromillions/EuroJackpot BacktestingEuroLotteryBacktesting
Euromillions analysis exampleEuroMillionsExample
Returns all the EuroMillions results until the end of 2023EuroMillionsResults
FX Forward ClassFxForward
Fx Swap ClassFxSwap
Returns a list with the populated fields of a Trade ObjectGetTradeDetails
Hashtable ClassHashTable
Information Adjusted BetaInformationAdjustedBeta
Information Adjusted CorrelationInformationAdjustedCorr
IRD Future ClassIRDFuture
IRD Swap ClassIRDSwap
IRD Swaption ClassIRDSwaption IRDSwaption-class
IRD Swap Volatility ClassIRDSwapVol
Martingale Strategy Repetitionsmartingale_strategy_repetitions
Normalized Cross Sample EntropyNormXASampEn
OtherExposure ClassOtherExposure
Returns all possible combinations of two dataframesOuterJoinMerge
Parse trades through a .csv file.ParseTrades
Roulette P&L betting based on the D'Alembert Betting Systemroulette_pl_calculator_dalembert
Roulette P&L betting based on the Fibonacci Betting Systemroulette_pl_calculator_fibonacci
Roulette P&L betting based on the Labouchere Betting Systemroulette_pl_calculator_labouchere
Roulette P&L betting based on a modified martingale strategyroulette_pl_calculator_martingale
Roulette P&L betting on a specific numberroulette_pl_calculator_specific_number
Sample EntropySampleEntropy
Select the derivatives out of a trades' listSelectDerivatives
Top 5 most or least lucky numbers for EuroMillions/EuroJackpottop5
Total Carbon EmissionsTotal_Carbon_Emissions
Variation of InformationVariationOfInformation
Weighted Average Carbon IntensityWeighted_Average_Carbon_Intensity