QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
IntervalPrice Class Reference

interval price More...

#include <prices.hpp>

+ Collaboration diagram for IntervalPrice:

Public Types

enum  Type { Open , Close , High , Low }
 

Public Member Functions

 IntervalPrice ()
 
 IntervalPrice (Real open, Real close, Real high, Real low)
 
Inspectors
Real open () const
 
Real close () const
 
Real high () const
 
Real low () const
 
Real value (IntervalPrice::Type) const
 
Modifiers
void setValue (Real value, IntervalPrice::Type)
 
void setValues (Real open, Real close, Real high, Real low)
 

Helper functions

Real open_
 
Real close_
 
Real high_
 
Real low_
 
static TimeSeries< IntervalPricemakeSeries (const std::vector< Date > &d, const std::vector< Real > &open, const std::vector< Real > &close, const std::vector< Real > &high, const std::vector< Real > &low)
 
static std::vector< RealextractValues (const TimeSeries< IntervalPrice > &, IntervalPrice::Type)
 
static TimeSeries< RealextractComponent (const TimeSeries< IntervalPrice > &, IntervalPrice::Type)
 

Detailed Description

interval price

Tests:
Inspectors, Modifiers, and Helper functions are tested.

Definition at line 66 of file prices.hpp.

Member Enumeration Documentation

◆ Type

enum Type
Enumerator
Open 
Close 
High 
Low 

Definition at line 68 of file prices.hpp.

Constructor & Destructor Documentation

◆ IntervalPrice() [1/2]

Definition at line 57 of file prices.cpp.

+ Here is the caller graph for this function:

◆ IntervalPrice() [2/2]

IntervalPrice ( Real  open,
Real  close,
Real  high,
Real  low 
)

Definition at line 61 of file prices.cpp.

Member Function Documentation

◆ open()

Real open ( ) const

Definition at line 75 of file prices.hpp.

+ Here is the caller graph for this function:

◆ close()

Real close ( ) const

Definition at line 76 of file prices.hpp.

+ Here is the caller graph for this function:

◆ high()

Real high ( ) const

Definition at line 77 of file prices.hpp.

+ Here is the caller graph for this function:

◆ low()

Real low ( ) const

Definition at line 78 of file prices.hpp.

+ Here is the caller graph for this function:

◆ value()

Real value ( IntervalPrice::Type  t) const

Definition at line 64 of file prices.cpp.

+ Here is the caller graph for this function:

◆ setValue()

void setValue ( Real  value,
IntervalPrice::Type  t 
)

Definition at line 79 of file prices.cpp.

+ Here is the call graph for this function:

◆ setValues()

void setValues ( Real  open,
Real  close,
Real  high,
Real  low 
)

Definition at line 99 of file prices.cpp.

+ Here is the call graph for this function:

◆ makeSeries()

TimeSeries< IntervalPrice > makeSeries ( const std::vector< Date > &  d,
const std::vector< Real > &  open,
const std::vector< Real > &  close,
const std::vector< Real > &  high,
const std::vector< Real > &  low 
)
static

Definition at line 104 of file prices.cpp.

+ Here is the call graph for this function:

◆ extractValues()

std::vector< Real > extractValues ( const TimeSeries< IntervalPrice > &  ts,
IntervalPrice::Type  t 
)
static

Definition at line 132 of file prices.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extractComponent()

TimeSeries< Real > extractComponent ( const TimeSeries< IntervalPrice > &  ts,
IntervalPrice::Type  t 
)
static

Definition at line 143 of file prices.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ open_

Real open_
private

Definition at line 104 of file prices.hpp.

◆ close_

Real close_
private

Definition at line 104 of file prices.hpp.

◆ high_

Real high_
private

Definition at line 104 of file prices.hpp.

◆ low_

Real low_
private

Definition at line 104 of file prices.hpp.