Package: Trading 3.1

Tasos Grivas

Trading: Trade Objects, Advanced Correlation & Beta Estimates, Betting Strategies

Contains performance analysis metrics of track records including entropy-based correlation and dynamic beta based on a state/space algorithm. The normalized sample entropy method has been implemented which produces accurate entropy estimation even on smaller datasets. On a separate stream, trades from the five major assets classes and also functionality to use pricing curves, rating tables, Credit Support Annex 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', the 'EuroJackpot', the UK Lotto, the Set For Life and the UK 'ThunderBall' lotteries. Furthermore, some basic functionality about climate risk has been included.

Authors:Tasos Grivas [aut, cre]

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

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

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

1.30 score 1 stars 20 scripts 150 downloads 67 exports 51 dependencies

Last updated 10 hours agofrom:0db00addde. Checks:2 OK. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKFeb 23 2025
R-4.5-linuxOKFeb 23 2025

Exports:AngularDistanceBondBondFutureCalcEuroLotteryPnLCalcSetForLifePnLCalcUKLotteryPnLCalcUKThunderBallPnLcapped_fibonacci_seqCarbon_FootprintCarbon_IntensityCDOTrancheCDSCDXChebyshev_distanceCollateralCommodityCommodityForwardCommSwapCrossSampleEntropyCSACurveDynamicBetaEquityEquityIndexFutureEquityOptionIndexEquityOptionSingleEuroJackpotExampleEuroJackpotResultsEuroLotteryAllCombinationsEuroLotteryBacktestingEuroMillionsExampleEuroMillionsResultsFxForwardFxSwapGetTradeDetailsHashTableInformationAdjustedBetaInformationAdjustedCorrIRDFutureIRDSwapIRDSwaptionIRDSwapVolmartingale_strategy_repetitionsNormXASampEnOtherExposureOuterJoinMergeParseTradesroulette_pl_calculator_dalembertroulette_pl_calculator_fibonacciroulette_pl_calculator_labouchereroulette_pl_calculator_martingaleroulette_pl_calculator_specific_numberSampleEntropySelectDerivativesSetForLifeBacktestingSetForLifeExampleSetForLifeResultstop5Total_Carbon_EmissionsUKLotteryBacktestingUKLotteryExampleUKLotteryResultsUKThunderballBacktestingUKThunderballExampleUKThunderBallResultsVariationOfInformationWeighted_Average_Carbon_Intensity

Dependencies:cellrangerclicolorspacecpp11crayondata.tablefansifarverggplot2gluegmpgtableherehmsisobandjsonlitelabelinglatticelifecyclemagrittrMASSMatrixmgcvmunsellnlmePerformanceAnalyticspillarpkgconfigpngprettyunitsprogressquadprogR6rappdirsRColorBrewerRcppRcppAlgosRcppTOMLreadxlrematchreticulaterlangrprojrootscalestibbleutf8vctrsviridisLitewithrxtszoo

Readme and manuals

Help Manual

Help pageTopics
Angular distance metricsAngularDistance
Bond ClassBond Bond-class
Bond Future ClassBondFuture BondFuture-class
PnL calculation for EuroMillions/EuroJackpot backtestingCalcEuroLotteryPnL
PnL calculation for Set For Life backtestingCalcSetForLifePnL
PnL calculation for UKLottery backtestingCalcUKLotteryPnL
PnL calculation for UKThunderBall backtestingCalcUKThunderBallPnL
Fibonacci sequence up to a specified maximum numbercapped_fibonacci_seq
Carbon FootprintCarbon_Footprint
Carbon IntensityCarbon_Intensity
CDO tranche ClassCDOTranche CDOTranche-class
CDS ClassCDS CDS-class
CDX ClassCDX CDX-class
Chebyshev distanceChebyshev_distance
Collateral ClassCollateral Collateral-class
Commodity ClassCommodity Commodity-class
Commodity Forward ClassCommodityForward CommodityForward-class
Commodity Swap ClassCommSwap CommSwap-class
Angular distance metricsCrossSampleEntropy
CSA ClassCSA CSA-class
Curve ClassCurve Curve-class
Time Varying Beta via Kalman filter & smootherDynamicBeta
Equity ClassEquity Equity-class
Equity Index Future ClassEquityIndexFuture EquityIndexFuture-class
Equity Option Index ClassEquityOptionIndex EquityOptionIndex-class
Equity Option Single ClassEquityOptionSingle EquityOptionSingle-class
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 FxForward-class
Fx Swap ClassFxSwap FxSwap-class
Returns a list with the populated fields of a Trade ObjectGetTradeDetails
Hashtable ClassHashTable HashTable-class
Information Adjusted BetaInformationAdjustedBeta
Information Adjusted CorrelationInformationAdjustedCorr
IRD Future ClassIRDFuture IRDFuture-class
IRD Swap ClassIRDSwap IRDSwap-class
IRD Swaption ClassIRDSwaption IRDSwaption-class
IRD Swap Volatility ClassIRDSwapVol IRDSwapVol-class
Martingale Strategy Repetitionsmartingale_strategy_repetitions
Normalized Cross Sample EntropyNormXASampEn
OtherExposure ClassOtherExposure OtherExposure-class
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
Set For Life BacktestingSetForLifeBacktesting
Set For Life analysis exampleSetForLifeExample
Returns all the EuroJackpot results until the end of 2023SetForLifeResults
Top 5 most or least lucky numbers for EuroMillions/EuroJackpottop5
Total Carbon EmissionsTotal_Carbon_Emissions
UKLottery BacktestingUKLotteryBacktesting
UK Lottery analysis exampleUKLotteryExample
Returns all the UKLottery results until the beginning of 2025UKLotteryResults
UK ThunderBall BacktestingUKThunderballBacktesting
UK ThunderBall analysis exampleUKThunderballExample
Returns all the EuroJackpot results until the end of 2023UKThunderBallResults
Variation of InformationVariationOfInformation
Weighted Average Carbon IntensityWeighted_Average_Carbon_Intensity