Learn R Programming

Trading (version 3.2)

Trade Objects, Advanced Correlation & Beta Estimates, Betting Strategies

Description

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.

Copy Link

Version

Install

install.packages('Trading')

Monthly Downloads

286

Version

3.2

License

GPL-3

Maintainer

Tasos Grivas

Last Published

April 13th, 2025

Functions in Trading (3.2)

Carbon_Intensity

Carbon Intensity
CalcUKThunderBallPnL

PnL calculation for UKThunderBall backtesting
Curve-class

Curve Class
CommSwap-class

Commodity Swap Class
EuroLotteryBacktesting

Euromillions/EuroJackpot Backtesting
CommodityForward-class

Commodity Forward Class
EuroLotteryAllCombinations

Returns all the possible number combinations for EuroMillions/EuroJackpot
EuroJackpotResults

Returns all the EuroJackpot results until the end of 2023
InformationAdjustedBeta

Information Adjusted Beta
IRDSwaption-class

IRD Swaption Class
EuroMillionsExample

Euromillions analysis example
Equity-class

Equity Class
IRDSwap-class

IRD Swap Class
DynamicBeta

Time Varying Beta via Kalman filter & smoother
HashTable-class

Hashtable Class
IRDFuture-class

IRD Future Class
InformationAdjustedCorr

Information Adjusted Correlation
NormXASampEn

Normalized Cross Sample Entropy
IRDSwapVol-class

IRD Swap Volatility Class
GetTradeDetails

Returns a list with the populated fields of a Trade Object
EquityOptionSingle-class

Equity Option Single Class
ParseTrades

Parse trades through a .csv file.
EquityIndexFuture-class

Equity Index Future Class
FxSwap-class

Fx Swap Class
SetForLifeResults

Returns all the EuroJackpot results until the end of 2023
EquityOptionIndex-class

Equity Option Index Class
SetForLifeBacktesting

Set For Life Backtesting
SelectDerivatives

Select the derivatives out of a trades' list
SetForLifeExample

Set For Life analysis example
UKThunderballExample

UK ThunderBall analysis example
VariationOfInformation

Variation of Information
UKLotteryResults

Returns all the UKLottery results until the beginning of 2025
Total_Carbon_Emissions

Total Carbon Emissions
UKLotteryExample

UK Lottery analysis example
roulette_pl_calculator_martingale

Roulette P&L betting based on a modified martingale strategy
roulette_pl_calculator_specific_number

Roulette P&L betting on a specific number
EuroJackpotExample

Eurojackpot analysis example
Weighted_Average_Carbon_Intensity

Weighted Average Carbon Intensity
EuroMillionsResults

Returns all the EuroMillions results until the end of 2023
top5

Top 5 most or least lucky numbers for EuroMillions/EuroJackpot
FxForward-class

FX Forward Class
OuterJoinMerge

Returns all possible combinations of two dataframes
OtherExposure-class

OtherExposure Class
UKLotteryBacktesting

UKLottery Backtesting
SampleEntropy

Sample Entropy
UKThunderballBacktesting

UK ThunderBall Backtesting
martingale_strategy_repetitions

Martingale Strategy Repetitions
UKThunderBallResults

Returns all the UK ThunderBall results until the beginning of 2025
roulette_pl_calculator_dalembert

Roulette P&L betting based on the D'Alembert Betting System
capped_fibonacci_seq

Fibonacci sequence up to a specified maximum number
roulette_pl_calculator_labouchere

Roulette P&L betting based on the Labouchere Betting System
roulette_pl_calculator_fibonacci

Roulette P&L betting based on the Fibonacci Betting System
CDOTranche-class

CDO tranche Class
CalcEuroLotteryPnL

PnL calculation for EuroMillions/EuroJackpot backtesting
CalcSetForLifePnL

PnL calculation for Set For Life backtesting
CalcUKLotteryPnL

PnL calculation for UKLottery backtesting
AngularDistance

Angular distance metrics
BondFuture-class

Bond Future Class
CSA-class

CSA Class
Bond-class

Bond Class
CDS-class

CDS Class
CDX-class

CDX Class
Chebyshev_distance

Chebyshev distance
Commodity-class

Commodity Class
Carbon_Footprint

Carbon Footprint
CrossSampleEntropy

Angular distance metrics
Collateral-class

Collateral Class