module QuantLib.Prices
        ( PriceType (..)
        , CallPrice (..)
        , IntervalPrice (..)
        ) where

-- | Price types
data PriceType = Bid | Ask | Last | Close | Mid | MidEq | MidSafe
        deriving (Int -> PriceType -> ShowS
[PriceType] -> ShowS
PriceType -> String
(Int -> PriceType -> ShowS)
-> (PriceType -> String)
-> ([PriceType] -> ShowS)
-> Show PriceType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PriceType] -> ShowS
$cshowList :: [PriceType] -> ShowS
show :: PriceType -> String
$cshow :: PriceType -> String
showsPrec :: Int -> PriceType -> ShowS
$cshowsPrec :: Int -> PriceType -> ShowS
Show, PriceType -> PriceType -> Bool
(PriceType -> PriceType -> Bool)
-> (PriceType -> PriceType -> Bool) -> Eq PriceType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PriceType -> PriceType -> Bool
$c/= :: PriceType -> PriceType -> Bool
== :: PriceType -> PriceType -> Bool
$c== :: PriceType -> PriceType -> Bool
Eq)

-- | Call price
data CallPrice = DirtyPrice {
        CallPrice -> Double
cpPrice         :: Double
        } | CleanPrice {
        cpPrice         :: Double
        } deriving (Int -> CallPrice -> ShowS
[CallPrice] -> ShowS
CallPrice -> String
(Int -> CallPrice -> ShowS)
-> (CallPrice -> String)
-> ([CallPrice] -> ShowS)
-> Show CallPrice
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CallPrice] -> ShowS
$cshowList :: [CallPrice] -> ShowS
show :: CallPrice -> String
$cshow :: CallPrice -> String
showsPrec :: Int -> CallPrice -> ShowS
$cshowsPrec :: Int -> CallPrice -> ShowS
Show, CallPrice -> CallPrice -> Bool
(CallPrice -> CallPrice -> Bool)
-> (CallPrice -> CallPrice -> Bool) -> Eq CallPrice
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CallPrice -> CallPrice -> Bool
$c/= :: CallPrice -> CallPrice -> Bool
== :: CallPrice -> CallPrice -> Bool
$c== :: CallPrice -> CallPrice -> Bool
Eq, Eq CallPrice
Eq CallPrice
-> (CallPrice -> CallPrice -> Ordering)
-> (CallPrice -> CallPrice -> Bool)
-> (CallPrice -> CallPrice -> Bool)
-> (CallPrice -> CallPrice -> Bool)
-> (CallPrice -> CallPrice -> Bool)
-> (CallPrice -> CallPrice -> CallPrice)
-> (CallPrice -> CallPrice -> CallPrice)
-> Ord CallPrice
CallPrice -> CallPrice -> Bool
CallPrice -> CallPrice -> Ordering
CallPrice -> CallPrice -> CallPrice
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: CallPrice -> CallPrice -> CallPrice
$cmin :: CallPrice -> CallPrice -> CallPrice
max :: CallPrice -> CallPrice -> CallPrice
$cmax :: CallPrice -> CallPrice -> CallPrice
>= :: CallPrice -> CallPrice -> Bool
$c>= :: CallPrice -> CallPrice -> Bool
> :: CallPrice -> CallPrice -> Bool
$c> :: CallPrice -> CallPrice -> Bool
<= :: CallPrice -> CallPrice -> Bool
$c<= :: CallPrice -> CallPrice -> Bool
< :: CallPrice -> CallPrice -> Bool
$c< :: CallPrice -> CallPrice -> Bool
compare :: CallPrice -> CallPrice -> Ordering
$ccompare :: CallPrice -> CallPrice -> Ordering
$cp1Ord :: Eq CallPrice
Ord)

-- | Interval price
data IntervalPrice = IntervalPrice {
        IntervalPrice -> Double
ipOpen  :: Double,
        IntervalPrice -> Double
ipHigh  :: Double,
        IntervalPrice -> Double
ipLow   :: Double,
        IntervalPrice -> Double
ipClose :: Double
        } deriving (Int -> IntervalPrice -> ShowS
[IntervalPrice] -> ShowS
IntervalPrice -> String
(Int -> IntervalPrice -> ShowS)
-> (IntervalPrice -> String)
-> ([IntervalPrice] -> ShowS)
-> Show IntervalPrice
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IntervalPrice] -> ShowS
$cshowList :: [IntervalPrice] -> ShowS
show :: IntervalPrice -> String
$cshow :: IntervalPrice -> String
showsPrec :: Int -> IntervalPrice -> ShowS
$cshowsPrec :: Int -> IntervalPrice -> ShowS
Show, IntervalPrice -> IntervalPrice -> Bool
(IntervalPrice -> IntervalPrice -> Bool)
-> (IntervalPrice -> IntervalPrice -> Bool) -> Eq IntervalPrice
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IntervalPrice -> IntervalPrice -> Bool
$c/= :: IntervalPrice -> IntervalPrice -> Bool
== :: IntervalPrice -> IntervalPrice -> Bool
$c== :: IntervalPrice -> IntervalPrice -> Bool
Eq)