Share and Money Management  0.16
Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Private Attributes | List of all members
smm.objects.DailyQuote Class Reference

Class to handle quotes. More...

Inheritance diagram for smm.objects.DailyQuote:

Public Member Functions

def __str__
 Returns the content of this instance as string.
- Public Member Functions inherited from smm.objects.SMMBaseObject
def __init__
 Initialise the instance and set attributes optionally.
def __repr__
 Returns the representation of this object as string.
def update
 Update instance arguments.
def add2db
 Add an object to the database.

Static Public Member Functions

def get
 Query DailyQuote objects.
def getCount
 Returns the number of daily quotes.
def getLast
 Returns the latest DailyQuote for a share.

Static Public Attributes

dictionary arguments
string psTopic = 'smm.dailyquote'
tuple id = Int(default=AutoReload, primary=True)
 Unique ID for each object.
tuple share_id = Int()
 Property to store the ID of the referred Share object.
tuple share = Reference(share_id, Share.id)
 Reference to the Share object
tuple exchange_id = Int()
 Property to store the ID of the referred Exchange object.
tuple exchange = Reference(exchange_id, Exchange.id)
 Reference to the Exchange object
tuple currency_id = Int()
 Property to store the ID of the referred Currency object.
tuple currency = Reference(currency_id, Currency.id)
 Reference to the Currency object
tuple open = Decimal()
 Opening value of the share.
tuple close = Decimal()
 Closing value of the share.
tuple high = Decimal()
 Highest value of the day.
tuple low = Decimal()
 Lowest value of the day.
tuple date = Date()
 Day of quotation.
tuple volume = Int()
 Trade volume in shares.
tuple source = Int()
 Data source.
tuple event = Unicode()
 Event releated to this quote.
- Static Public Attributes inherited from smm.objects.SMMBaseObject
dictionary arguments
 Set of argument names for keyword arguments.
tuple encoding = sys.stdout.encodingorsys.getdefaultencoding()
 Encoding of all character strings.
 psTopic = None
 Publish Subscribe Topic for this class.

Static Private Attributes

string __storm_table__ = "t_dailyquote"
 Use given table to store all of this class inside.

Detailed Description

Class to handle quotes.

Note
This class handles daily quotes only. Another class will handle intraday quotes.
There is not field to track share splits as well as dividend currently.
Test:
tests.test_objects.TestObjects.test_DailyQuote_objects()

Member Function Documentation

def smm.objects.DailyQuote.__str__ (   self)

Returns the content of this instance as string.

References smm.objects.SMMBaseObject._encode(), smm.objects.DailyQuote.close, smm.objects.Share.currency, smm.objects.DailyQuote.currency, smm.objects.DailyQuote.date, smm.objects.Share.exchange, smm.objects.DailyQuote.exchange, smm.objects.DailyQuote.high, smm.objects.Exchange.id, smm.objects.Currency.id, smm.objects.Share.id, smm.objects.DailyQuote.id, smm.objects.DailyQuote.low, smm.objects.DailyQuote.open, smm.objects.DailyQuote.share, and smm.objects.DailyQuote.volume.

Referenced by smm.objects.SMMBaseObject.__repr__().

Here is the call graph for this function:

Here is the caller graph for this function:

def smm.objects.DailyQuote.get (   date = None,
  id = None,
  share = None 
)
static

Query DailyQuote objects.

There are three ways for querying objects:

  • Querying by id returns a DailyQuote object or None
  • Query special entries described using share and/or date
  • Querying without parameters to get all DailyQuote objects

Querying with share and date returns an DailyQuote object or None.

The last two ways returns always a storm.store.ResultSet.

Parameters
idReturns a quote specified by the id.
shareReturns quotes specified by share.
dateReturns a quote specified by date.
Sorting:
The result is ordered ascending by date
Test:
tests.test_objects.TestObjects.test_DailyQuote_get()
def smm.objects.DailyQuote.getCount ( )
static

Returns the number of daily quotes.

def smm.objects.DailyQuote.getLast (   share,
  currency = None 
)
static

Returns the latest DailyQuote for a share.

Parameters
shareQuerying for this Share object
currencySpecifiy the currency for the DailyQuote
Test:
tests.test_objects.TestObjects.test_DailyQuote_getLast()

Member Data Documentation

string smm.objects.DailyQuote.__storm_table__ = "t_dailyquote"
staticprivate

Use given table to store all of this class inside.

dictionary smm.objects.DailyQuote.arguments
static
Initial value:
{
'share_id': None,
'share': None,
'exchange_id': None,
'exchange': None,
'currency_id': None,
'currency': None,
'open': 'decimal',
'close': 'decimal',
'high': 'decimal',
'low': 'decimal',
'date': None,
'volume': 'decimal',
'source': None,
'event': 'unicode',
}
tuple smm.objects.DailyQuote.close = Decimal()
static

Closing value of the share.

Referenced by smm.objects.DailyQuote.__str__().

tuple smm.objects.DailyQuote.currency = Reference(currency_id, Currency.id)
static
tuple smm.objects.DailyQuote.currency_id = Int()
static

Property to store the ID of the referred Currency object.

tuple smm.objects.DailyQuote.date = Date()
static
tuple smm.objects.DailyQuote.event = Unicode()
static

Event releated to this quote.

It's more like a note ...

Currently supported events:

  • split
    split:1:2
  • bid - bid price (German: Geldkurs)
  • ask - ask price (German: Briefkurs)

Adapt functions below to add a new event:

tuple smm.objects.DailyQuote.exchange = Reference(exchange_id, Exchange.id)
static

Reference to the Exchange object

Referenced by smm.objects.DailyQuote.__str__().

tuple smm.objects.DailyQuote.exchange_id = Int()
static

Property to store the ID of the referred Exchange object.

tuple smm.objects.DailyQuote.high = Decimal()
static

Highest value of the day.

Referenced by smm.objects.DailyQuote.__str__().

tuple smm.objects.DailyQuote.id = Int(default=AutoReload, primary=True)
static
tuple smm.objects.DailyQuote.low = Decimal()
static

Lowest value of the day.

Referenced by smm.objects.DailyQuote.__str__().

tuple smm.objects.DailyQuote.open = Decimal()
static
string smm.objects.DailyQuote.psTopic = 'smm.dailyquote'
static
tuple smm.objects.DailyQuote.share = Reference(share_id, Share.id)
static
tuple smm.objects.DailyQuote.share_id = Int()
static

Property to store the ID of the referred Share object.

tuple smm.objects.DailyQuote.source = Int()
static

Data source.

tuple smm.objects.DailyQuote.volume = Int()
static

Trade volume in shares.

Referenced by smm.objects.DailyQuote.__str__().


The documentation for this class was generated from the following file: