OpenPit C++ SDK
C++17 SDK for the OpenPit pre-trade risk engine
openpit::param::Leverage Class Referencefinal

Fixed-point leverage multiplier with one decimal place. More...

Public Member Functions

Notional CalculateMarginRequired (const Notional &notional) const
 Calculates margin required for the supplied notional. More...
 
constexpr bool IsSet () const noexcept
 
constexpr Leverage () noexcept=default
 
constexpr bool operator!= (const Leverage &other) const noexcept
 
constexpr bool operator< (const Leverage &other) const noexcept
 
constexpr bool operator<= (const Leverage &other) const noexcept
 
constexpr bool operator== (const Leverage &other) const noexcept
 
constexpr bool operator> (const Leverage &other) const noexcept
 
constexpr bool operator>= (const Leverage &other) const noexcept
 
std::string ToString () const
 
constexpr float Value () const noexcept
 

Static Public Member Functions

static Leverage FromFloat (float multiplier)
 Creates a finite multiplier rounded to the fixed-point scale. More...
 
static Leverage FromUint16 (std::uint16_t multiplier)
 Creates an integral leverage multiplier. More...
 

Static Public Attributes

static constexpr std::uint16_t Max = 3000
 
static constexpr std::uint16_t Min = 1
 
static constexpr std::uint16_t NotSet = 0
 
static constexpr std::uint16_t Scale = 10
 
static constexpr float Step = 0.1F
 

Detailed Description

Fixed-point leverage multiplier with one decimal place.

Constructor & Destructor Documentation

◆ Leverage()

constexpr openpit::param::Leverage::Leverage ( )
constexprdefaultnoexcept

Member Function Documentation

◆ CalculateMarginRequired()

Notional openpit::param::Leverage::CalculateMarginRequired ( const Notional notional) const
inline

Calculates margin required for the supplied notional.

◆ FromFloat()

static Leverage openpit::param::Leverage::FromFloat ( float  multiplier)
inlinestatic

Creates a finite multiplier rounded to the fixed-point scale.

◆ FromUint16()

static Leverage openpit::param::Leverage::FromUint16 ( std::uint16_t  multiplier)
inlinestatic

Creates an integral leverage multiplier.

◆ IsSet()

constexpr bool openpit::param::Leverage::IsSet ( ) const
inlineconstexprnoexcept

◆ operator!=()

constexpr bool openpit::param::Leverage::operator!= ( const Leverage other) const
inlineconstexprnoexcept

◆ operator<()

constexpr bool openpit::param::Leverage::operator< ( const Leverage other) const
inlineconstexprnoexcept

◆ operator<=()

constexpr bool openpit::param::Leverage::operator<= ( const Leverage other) const
inlineconstexprnoexcept

◆ operator==()

constexpr bool openpit::param::Leverage::operator== ( const Leverage other) const
inlineconstexprnoexcept

◆ operator>()

constexpr bool openpit::param::Leverage::operator> ( const Leverage other) const
inlineconstexprnoexcept

◆ operator>=()

constexpr bool openpit::param::Leverage::operator>= ( const Leverage other) const
inlineconstexprnoexcept

◆ ToString()

std::string openpit::param::Leverage::ToString ( ) const
inline

◆ Value()

constexpr float openpit::param::Leverage::Value ( ) const
inlineconstexprnoexcept

Member Data Documentation

◆ Max

constexpr std::uint16_t openpit::param::Leverage::Max = 3000
staticconstexpr

◆ Min

constexpr std::uint16_t openpit::param::Leverage::Min = 1
staticconstexpr

◆ NotSet

constexpr std::uint16_t openpit::param::Leverage::NotSet = 0
staticconstexpr

◆ Scale

constexpr std::uint16_t openpit::param::Leverage::Scale = 10
staticconstexpr

◆ Step

constexpr float openpit::param::Leverage::Step = 0.1F
staticconstexpr