Learn R Programming

⚠️There's a newer version (3.2) of this package.Take me there.

Trading (version 3.1)

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.1

License

GPL-3

Maintainer

Tasos Grivas

Last Published

February 22nd, 2025

Functions in Trading (3.1)

CrossSampleEntropy

Angular distance metrics
Curve-class

Curve Class
CalcUKThunderBallPnL

PnL calculation for UKThunderBall backtesting
Carbon_Footprint

Carbon Footprint
EquityIndexFuture-class

Equity Index Future Class
EuroJackpotResults

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

Equity Option Index Class
EuroLotteryBacktesting

Euromillions/EuroJackpot Backtesting
Collateral-class

Collateral Class
EuroMillionsExample

Euromillions analysis example
IRDSwapVol-class

IRD Swap Volatility Class
Equity-class

Equity Class
EuroJackpotExample

Eurojackpot analysis example
EquityOptionSingle-class

Equity Option Single Class
EuroMillionsResults

Returns all the EuroMillions results until the end of 2023
DynamicBeta

Time Varying Beta via Kalman filter & smoother
CommSwap-class

Commodity Swap Class
FxForward-class

FX Forward Class
IRDSwap-class

IRD Swap Class
InformationAdjustedCorr

Information Adjusted Correlation
ParseTrades

Parse trades through a .csv file.
EuroLotteryAllCombinations

Returns all the possible number combinations for EuroMillions/EuroJackpot
HashTable-class

Hashtable Class
roulette_pl_calculator_specific_number

Roulette P&L betting on a specific number
roulette_pl_calculator_martingale

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

UK Lottery analysis example
UKLotteryResults

Returns all the UKLottery results until the beginning of 2025
IRDSwaption-class

IRD Swaption Class
SampleEntropy

Sample Entropy
IRDFuture-class

IRD Future Class
OtherExposure-class

OtherExposure Class
Total_Carbon_Emissions

Total Carbon Emissions
OuterJoinMerge

Returns all possible combinations of two dataframes
top5

Top 5 most or least lucky numbers for EuroMillions/EuroJackpot
InformationAdjustedBeta

Information Adjusted Beta
UKThunderballExample

UK ThunderBall analysis example
VariationOfInformation

Variation of Information
capped_fibonacci_seq

Fibonacci sequence up to a specified maximum number
NormXASampEn

Normalized Cross Sample Entropy
UKLotteryBacktesting

UKLottery Backtesting
Weighted_Average_Carbon_Intensity

Weighted Average Carbon Intensity
martingale_strategy_repetitions

Martingale Strategy Repetitions
SetForLifeExample

Set For Life analysis example
SetForLifeBacktesting

Set For Life Backtesting
UKThunderBallResults

Returns all the EuroJackpot results until the end of 2023
SelectDerivatives

Select the derivatives out of a trades' list
FxSwap-class

Fx Swap Class
GetTradeDetails

Returns a list with the populated fields of a Trade Object
SetForLifeResults

Returns all the EuroJackpot results until the end of 2023
roulette_pl_calculator_dalembert

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

UK ThunderBall Backtesting
roulette_pl_calculator_fibonacci

Roulette P&L betting based on the Fibonacci Betting System
roulette_pl_calculator_labouchere

Roulette P&L betting based on the Labouchere Betting System
BondFuture-class

Bond Future Class
CalcEuroLotteryPnL

PnL calculation for EuroMillions/EuroJackpot backtesting
CalcSetForLifePnL

PnL calculation for Set For Life backtesting
CDS-class

CDS Class
AngularDistance

Angular distance metrics
CSA-class

CSA Class
CalcUKLotteryPnL

PnL calculation for UKLottery backtesting
CDOTranche-class

CDO tranche Class
CDX-class

CDX Class
Bond-class

Bond Class
Commodity-class

Commodity Class
Carbon_Intensity

Carbon Intensity
Chebyshev_distance

Chebyshev distance
CommodityForward-class

Commodity Forward Class