Share and Money Management 0.18devel
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
gui.dialogs.DlgTrade Class Reference

Dialog to insert and change transactions. More...

Inheritance diagram for gui.dialogs.DlgTrade:

Public Member Functions

def __init__ (self, parent, kind="buy", share=None, position=None)
 Initialise dialog. More...
 
def OnActivateExistingPosition (self, unused=None)
 Activate "Existing position". More...
 
def OnActivateNewPosition (self, unused=None)
 Activate "New position". More...
 
def OnActivateBuy (self, unused=None)
 Activate "Buy" radiobutton after a secondary widget has been focused. More...
 
def OnActivateDividend (self, unused=None)
 Activate "Dividend" radiobutton after a secondary widget has been focused. More...
 
def OnActivateSell (self, unused=None)
 Activate "Sell" radiobutton after a secondary widget has been focused. More...
 
def OnActivateSplit (self, unused=None)
 Activate "Split" radiobutton after a secondary widget has been focused. More...
 
def OnActivateSwap (self, unused=None)
 Activate "Swap" radiobutton after a secondary widget has been focused. More...
 
def OnUpdateBuyValue (self, unused=None)
 Update buy value after changing buy sum. More...
 
def OnUpdateBuySum (self, unused=None)
 Update buy sum after changing buy value or share count. More...
 
def OnUpdateDividendValue (self, unused=None)
 Update dividend value after changing dividend sum. More...
 
def OnUpdateDividendSum (self, unused=None)
 Update dividend sum after changing dividend value or count. More...
 
def OnUpdateCurrency (self, unused=None)
 Update dialog after the currency has changed. More...
 
def OnUpdateExistingPosition (self, unused=None)
 Update position related widgets. More...
 
def OnUpdateNewPosition (self, unused=None)
 Update share related widgets. More...
 
def configureDecimalWidget (self, widget, value=None)
 Set format of a decimal widget (monetary or non-monetary) More...
 
def __init__ (self, *args, **kwds)
 Initialise dialog. More...
 
- Public Member Functions inherited from gui.controls.BaseDialog
def __init__ (self, *args, **kwargs)
 Initialise dialog. More...
 
def installOwnOKEventHandler (self)
 Bind own event handler for pressing OK to allow a proper validation. More...
 
def OnOK (self, event)
 Own OK button handler to validate the dialog logically using validateDialog() More...
 
def ShowModal (self)
 Show the dialog modal and process dialogs input. More...
 

Public Attributes

 locale_db
 Database of the local conventions as a dictionary. More...
 
 calc_mode
 Mode for calculation buy sum / sell sum. More...
 
 currency
 Currency selected within the dialog. More...
 
 currency_escaped
 Formatted and escaped currency (to fit mask syntax) More...
 
 position
 Position to add the current Transaction. More...
 
 integer_width
 Width of the formatted integer part of a value. More...
 
 results
 Dialog results stored after validation by _validateInput() More...
 
 share
 Share to trade with. More...
 
 today
 Today's date (native Python) More...
 
 today_wx
 Todays date (wx format) More...
 
 epoch
 Earliest date for date controls (native Python) More...
 
 epoch_wx
 Earliest date for date controls (wx format) More...
 
 defaultValues
 Default values for decimal and money widgets. More...
 
 nonBuyWidgets
 List of widgets to block in case of new position. More...
 
 widget2name
 Dictionary to convert widgets instances to human-readable names. More...
 
- Public Attributes inherited from gui.UITrade.UITrade
 static_line
 
 bn_OK
 
 bn_Cancel
 
 sb_position
 
 rbn_existing_position
 
 cc_Position
 
 rbn_new_position
 
 cc_Share
 
 cc_Currency
 
 st_WatchEntry
 
 rbn_WatchNote_append
 
 rbn_WatchNote_ignore
 
 rbn_WatchNote_replace
 
 sb_trade
 
 rbn_Buy
 
 rbn_Dividend
 
 rbn_Sell
 
 rbn_Split
 
 rbn_Swap
 
 st_BuyPrefixDate
 
 st_BuyOr
 
 dp_BuyDate
 
 st_BuyExchange
 
 cc_BuyExchange
 
 st_BuyCount
 
 st_BuyMultiSign1
 
 st_BuyValue
 
 st_BuyPlus1
 
 st_BuyFee
 
 st_BuyEqualsSign1
 
 st_BuySum
 
 tc_BuyCount
 
 st_BuyMultiSign2
 
 tc_BuyValue
 
 st_BuyPlus2
 
 tc_BuyFee
 
 st_BuyEqualsSign2
 
 tc_BuySum
 
 cb_SellCloseEmpty
 
 cb_SellWorthless
 
 cb_SellPositionReport
 
 st_DividendPrefixDate
 
 dp_DividendDate
 
 st_DividendCount
 
 st_DividendMultiSign1
 
 st_DividendValue
 
 st_DividendEqualsSign1
 
 st_DividendSum
 
 tc_DividendCount
 
 st_DividendMultiSign2
 
 tc_DividendValue
 
 st_DividendEqualsSign2
 
 tc_DividendSum
 
 st_SplitPrefixDate
 
 dp_SplitDate
 
 st_SplitOldRatio
 
 st_SplitColon1
 
 st_SplitNewRatio
 
 tc_SplitOldRatio
 
 st_SplitColon2
 
 tc_SplitNewRatio
 
 st_SwapPrefixDate
 
 dp_SwapDate
 
 st_SwapOldRatio
 
 st_SwapColon1
 
 st_SwapNewRatio
 
 st_SwapOldValue
 
 st_SwapColon2
 
 st_SwapNewValue
 
 st_SwapNewShare
 
 tc_SwapOldRatio
 
 st_SwapColon3
 
 tc_SwapNewRatio
 
 tc_SwapOldValue
 
 st_SwapColon4
 
 tc_SwapNewValue
 
 cc_SwapNewShare
 
 cb_SwapCloseEmpty
 
 cb_SwapPositionReport
 

Private Member Functions

def _getDecimal (self, widget)
 Return decimal value of any decimal or money widget. More...
 
def _setDecimal (self, widget, value)
 Set value at a decimal widget (monetary and non-monetary) More...
 
def _setCurrency (self, currency)
 Store the currency. More...
 
def _updateCalcMode (self, mode)
 Set mode for calculation buy sum / sell sum. More...
 
def _updateDateRangePosition (self)
 Update date ranges triggered by setting / selecting a position. More...
 
def _updateDateRangeShare (self)
 Update date ranges triggered by setting / selecting a share. More...
 
def _updateMoneyFormat (self, widget)
 Change widget mask to update the currency sign / code. More...
 
def _validateInput (self)
 Validate input data and store results in results. More...
 
def _prepareBuy (self)
 Prepare "Buy" transaction by storing all related values in results. More...
 
def _prepareDividend (self)
 Prepare "Dividend" transaction by storing all related values in results. More...
 
def _prepareSell (self)
 Prepare "Sell" transaction by storing all related values in results. More...
 
def _prepareSplit (self)
 Prepare "Split" transaction by storing all related values in results. More...
 
def _prepareSwap (self)
 Prepare "Swap" transaction by storing all related values in results. More...
 
def _validateDateWidget (self, widget, first)
 Validate content of a DatePickerCtrl widget. More...
 
def _validateDecimalWidget (self, widget, allowZero=False)
 Validate content of a decimal widget. More...
 
def _processInput (self)
 Create a transaction using all data. More...
 

Private Attributes

 _dateWidgets
 List of all date widgets. More...
 
 _decimalWidgets
 List of all decimal widgets (monetary and non-monetary) More...
 
 _moneyWidgets
 List of all money widgets only (subset of _decimalWidgets) More...
 
 _decimalPlaces
 Number of decimal places for all decimal widgets (monetary and non-monetary) More...
 

Additional Inherited Members

- Static Public Attributes inherited from gui.UITrade.UITrade
 flags_label = wx.ALL|wx.ALIGN_CENTER_VERTICAL
 Flags used with all label widgets (wx.StaticText) More...
 
 flags_input = wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL
 Flags used for all input widgets. More...
 
tuple max_size = (300, 27)
 Maximum widget size. More...
 

Detailed Description

Dialog to insert and change transactions.

Constructor & Destructor Documentation

◆ __init__()

def gui.dialogs.DlgTrade.__init__ (   self,
  parent,
  kind = "buy",
  share = None,
  position = None 
)

Initialise dialog.

Parameters
selfThe object pointer
parentThe parent object
kindKind of transaction, valid are sell, buy or None
shareA Share object
positionA Position object

Creating this dialog using the arguments share and position causes an ValueError exception.

Exceptions
ValueErrorFor unknown transaction kinds
ValueErrorIf share and position is set

Reimplemented from gui.UITrade.UITrade.

Member Function Documentation

◆ _getDecimal()

def gui.dialogs.DlgTrade._getDecimal (   self,
  widget 
)
private

◆ _prepareBuy()

def gui.dialogs.DlgTrade._prepareBuy (   self)
private

◆ _prepareDividend()

def gui.dialogs.DlgTrade._prepareDividend (   self)
private

Prepare "Dividend" transaction by storing all related values in results.

See also
results

References gui.dialogs.DlgTrade._getDecimal(), gui.UITrade.UITrade.dp_DividendDate, gui.dialogs.DlgTrade.results, gui.UITrade.UITrade.tc_DividendCount, and gui.UITrade.UITrade.tc_DividendValue.

Referenced by gui.dialogs.DlgTrade._validateInput().

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

◆ _prepareSell()

def gui.dialogs.DlgTrade._prepareSell (   self)
private

Prepare "Sell" transaction by storing all related values in results.

See also
results

References gui.dialogs.DlgTrade._getDecimal(), gui.dialogs.DlgTrade.calc_mode, gui.UITrade.UITrade.cb_SellCloseEmpty, gui.UITrade.UITrade.cb_SellPositionReport, gui.UITrade.UITrade.cb_SellWorthless, gui.UITrade.UITrade.cc_BuyExchange, gui.UITrade.UITrade.dp_BuyDate, gui.dialogs.DlgTrade.results, gui.UITrade.UITrade.tc_BuyCount, gui.UITrade.UITrade.tc_BuyFee, and gui.UITrade.UITrade.tc_BuySum.

Referenced by gui.dialogs.DlgTrade._validateInput().

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

◆ _prepareSplit()

def gui.dialogs.DlgTrade._prepareSplit (   self)
private

Prepare "Split" transaction by storing all related values in results.

See also
results

References gui.dialogs.DlgTrade._getDecimal(), gui.UITrade.UITrade.dp_SplitDate, gui.dialogs.DlgTrade.results, gui.UITrade.UITrade.tc_SplitNewRatio, and gui.UITrade.UITrade.tc_SplitOldRatio.

Referenced by gui.dialogs.DlgTrade._validateInput().

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

◆ _prepareSwap()

def gui.dialogs.DlgTrade._prepareSwap (   self)
private

Prepare "Swap" transaction by storing all related values in results.

See also
results

References gui.dialogs.DlgTrade._getDecimal(), gui.UITrade.UITrade.cb_SwapCloseEmpty, gui.UITrade.UITrade.cb_SwapPositionReport, gui.UITrade.UITrade.cc_SwapNewShare, gui.UITrade.UITrade.dp_SwapDate, gui.dialogs.DlgTrade.results, gui.UITrade.UITrade.tc_SwapNewRatio, gui.UITrade.UITrade.tc_SwapNewValue, gui.UITrade.UITrade.tc_SwapOldRatio, and gui.UITrade.UITrade.tc_SwapOldValue.

Referenced by gui.dialogs.DlgTrade._validateInput().

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

◆ _processInput()

def gui.dialogs.DlgTrade._processInput (   self)
private

Create a transaction using all data.

Reimplemented from gui.controls.BaseDialog.

References gui.dialogs.DlgTrade.position, gui.panel.PanelOpenPositionDetails.position, smm.objects.Transaction.position, and gui.dialogs.DlgTrade.results.

Referenced by gui.controls.BaseDialog.ShowModal().

Here is the caller graph for this function:

◆ _setCurrency()

def gui.dialogs.DlgTrade._setCurrency (   self,
  currency 
)
private

Store the currency.

See also
currency
currency_escaped

References gui.dialogs.DlgTrade.currency, smm.objects.Share.currency, smm.objects.DailyQuote.currency, smm.objects.Position.currency, and gui.dialogs.DlgTrade.currency_escaped.

Referenced by gui.dialogs.DlgTrade.OnUpdateCurrency(), and gui.dialogs.DlgTrade.OnUpdateExistingPosition().

Here is the caller graph for this function:

◆ _setDecimal()

def gui.dialogs.DlgTrade._setDecimal (   self,
  widget,
  value 
)
private

◆ _updateCalcMode()

def gui.dialogs.DlgTrade._updateCalcMode (   self,
  mode 
)
private

Set mode for calculation buy sum / sell sum.

See also
calc_mode
OnUpdateBuySum()
OnUpdateBuyValue()

References gui.dialogs.DlgTrade.calc_mode, gui.dialogs.DlgTrade.OnUpdateBuySum(), gui.UITrade.UITrade.st_BuyPlus1, and gui.UITrade.UITrade.st_BuyPlus2.

Referenced by gui.dialogs.DlgTrade.OnActivateBuy(), and gui.dialogs.DlgTrade.OnActivateSell().

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

◆ _updateDateRangePosition()

def gui.dialogs.DlgTrade._updateDateRangePosition (   self)
private

Update date ranges triggered by setting / selecting a position.

References gui.dialogs.DlgTrade._dateWidgets, gui.dialogs.DlgTrade.epoch_wx, gui.dialogs.DlgTrade.position, gui.panel.PanelOpenPositionDetails.position, smm.objects.Transaction.position, and gui.dialogs.DlgTrade.today_wx.

Referenced by gui.dialogs.DlgTrade.OnUpdateExistingPosition().

Here is the caller graph for this function:

◆ _updateDateRangeShare()

def gui.dialogs.DlgTrade._updateDateRangeShare (   self)
private

Update date ranges triggered by setting / selecting a share.

References gui.dialogs.DlgTrade._dateWidgets, gui.dialogs.DlgTrade.epoch_wx, and gui.dialogs.DlgTrade.today_wx.

Referenced by gui.dialogs.DlgTrade.OnUpdateNewPosition().

Here is the caller graph for this function:

◆ _updateMoneyFormat()

def gui.dialogs.DlgTrade._updateMoneyFormat (   self,
  widget 
)
private

Change widget mask to update the currency sign / code.

See also
_seeFormatMoney()

References gui.dialogs.DlgTrade._getDecimal(), gui.dialogs.DlgTrade._setDecimal(), and gui.dialogs.DlgTrade.configureDecimalWidget().

Referenced by gui.dialogs.DlgTrade.OnUpdateCurrency(), and gui.dialogs.DlgTrade.OnUpdateExistingPosition().

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

◆ _validateDateWidget()

def gui.dialogs.DlgTrade._validateDateWidget (   self,
  widget,
  first 
)
private

Validate content of a DatePickerCtrl widget.

Parameters
selfThe object pointer
widgetDatePickerCtrl widget
firstDate of the first transaction as wx.DateTime
Returns
True for valid widgets or False for invalid widgets

References gui.controls.BaseDialog._markWidget(), and gui.dialogs.DlgTrade.today_wx.

Referenced by gui.dialogs.DlgTrade._validateInput().

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

◆ _validateDecimalWidget()

def gui.dialogs.DlgTrade._validateDecimalWidget (   self,
  widget,
  allowZero = False 
)
private

Validate content of a decimal widget.

Parameters
selfThe object pointer
widgetDecimal widget
allowZeroAllow 0 value
Returns
True for valid widgets or False for invalid widgets

References gui.dialogs.DlgTrade._getDecimal(), and gui.controls.BaseDialog._markWidget().

Referenced by gui.dialogs.DlgTrade._validateInput().

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

◆ _validateInput()

def gui.dialogs.DlgTrade._validateInput (   self)
private

Validate input data and store results in results.

See also
_validateDateWidget()
_validateDecimalWidget()
_prepareBuy()
_prepareDividend()
_prepareSell()
_prepareSplit()
_prepareSwap()

Reimplemented from gui.controls.BaseDialog.

References gui.dialogs.DlgTrade._prepareBuy(), gui.dialogs.DlgTrade._prepareDividend(), gui.dialogs.DlgTrade._prepareSell(), gui.dialogs.DlgTrade._prepareSplit(), gui.dialogs.DlgTrade._prepareSwap(), gui.controls.BaseDialog._unmarkWidget(), gui.dialogs.DlgTrade._validateDateWidget(), gui.dialogs.DlgTrade._validateDecimalWidget(), gui.controls.ShareDetailsPanel.cc_Currency, gui.controls.PositionDetailsPanel.cc_Currency, gui.UIShare.UIShare.cc_Currency, gui.UITrade.UITrade.cc_Currency, gui.UITrade.UITrade.cc_Position, gui.controls.PositionDetailsPanel.cc_Share, gui.controls.WatchDetailsPanel.cc_Share, gui.UITrade.UITrade.cc_Share, gui.UITrade.UITrade.dp_BuyDate, gui.UITrade.UITrade.dp_DividendDate, gui.UITrade.UITrade.dp_SplitDate, gui.UITrade.UITrade.dp_SwapDate, gui.dialogs.DlgTrade.OnActivateExistingPosition(), gui.dialogs.DlgTrade.position, gui.panel.PanelOpenPositionDetails.position, smm.objects.Transaction.position, gui.UITrade.UITrade.rbn_Buy, gui.UITrade.UITrade.rbn_Dividend, gui.UITrade.UITrade.rbn_existing_position, gui.UITrade.UITrade.rbn_new_position, gui.UITrade.UITrade.rbn_Sell, gui.UITrade.UITrade.rbn_Split, gui.UITrade.UITrade.rbn_Swap, gui.dialogs.DlgTrade.results, gui.UITrade.UITrade.tc_BuyCount, gui.UITrade.UITrade.tc_BuyFee, gui.UITrade.UITrade.tc_BuyValue, gui.UITrade.UITrade.tc_DividendCount, gui.UITrade.UITrade.tc_DividendSum, gui.UITrade.UITrade.tc_DividendValue, gui.UITrade.UITrade.tc_SplitNewRatio, gui.UITrade.UITrade.tc_SplitOldRatio, gui.UITrade.UITrade.tc_SwapNewRatio, gui.UITrade.UITrade.tc_SwapNewValue, gui.UITrade.UITrade.tc_SwapOldRatio, and gui.UITrade.UITrade.tc_SwapOldValue.

Referenced by gui.controls.BaseDialog.OnOK().

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

◆ configureDecimalWidget()

def gui.dialogs.DlgTrade.configureDecimalWidget (   self,
  widget,
  value = None 
)

Set format of a decimal widget (monetary or non-monetary)

Parameters
selfThe object pointer
widgetDecimal widget
valueValue to set
See also
defaultValues

References gui.dialogs.DlgTrade._decimalPlaces, gui.dialogs.DlgTrade._moneyWidgets, gui.dialogs.DlgTrade._setDecimal(), gui.dialogs.DlgTrade.currency_escaped, gui.dialogs.DlgTrade.integer_width, and gui.dialogs.DlgTrade.locale_db.

Referenced by gui.dialogs.DlgTrade._updateMoneyFormat().

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

◆ OnActivateBuy()

def gui.dialogs.DlgTrade.OnActivateBuy (   self,
  unused = None 
)

Activate "Buy" radiobutton after a secondary widget has been focused.

References gui.dialogs.DlgTrade._updateCalcMode(), gui.UITrade.UITrade.rbn_Buy, and gui.UITrade.UITrade.rbn_Sell.

Referenced by gui.dialogs.DlgTrade.OnActivateNewPosition().

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

◆ OnActivateDividend()

def gui.dialogs.DlgTrade.OnActivateDividend (   self,
  unused = None 
)

Activate "Dividend" radiobutton after a secondary widget has been focused.

References gui.UITrade.UITrade.rbn_Dividend.

◆ OnActivateExistingPosition()

def gui.dialogs.DlgTrade.OnActivateExistingPosition (   self,
  unused = None 
)

Activate "Existing position".

Enable all transactions

All transaction kind are possible with an existing position.

See also
OnActivateNewPosition()

References gui.dialogs.DlgTrade.nonBuyWidgets, gui.dialogs.DlgTrade.OnUpdateExistingPosition(), gui.UITrade.UITrade.rbn_existing_position, gui.UITrade.UITrade.rbn_WatchNote_append, gui.UITrade.UITrade.rbn_WatchNote_ignore, and gui.UITrade.UITrade.rbn_WatchNote_replace.

Referenced by gui.dialogs.DlgTrade._validateInput().

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

◆ OnActivateNewPosition()

def gui.dialogs.DlgTrade.OnActivateNewPosition (   self,
  unused = None 
)

Activate "New position".

Disable all transactions except "buy"

The only transaction kind for a new transaction (within this dialog) is to "buy" something. Thereby all non-buy transactions will be disabled to a new position.

See also
OnActivateExistingPosition()

References gui.dialogs.DlgTrade.nonBuyWidgets, gui.dialogs.DlgTrade.OnActivateBuy(), gui.dialogs.DlgTrade.OnUpdateCurrency(), gui.dialogs.DlgTrade.OnUpdateNewPosition(), and gui.UITrade.UITrade.rbn_new_position.

Here is the call graph for this function:

◆ OnActivateSell()

def gui.dialogs.DlgTrade.OnActivateSell (   self,
  unused = None 
)

Activate "Sell" radiobutton after a secondary widget has been focused.

References gui.dialogs.DlgTrade._updateCalcMode(), and gui.UITrade.UITrade.rbn_Sell.

Here is the call graph for this function:

◆ OnActivateSplit()

def gui.dialogs.DlgTrade.OnActivateSplit (   self,
  unused = None 
)

Activate "Split" radiobutton after a secondary widget has been focused.

References gui.UITrade.UITrade.rbn_Split.

◆ OnActivateSwap()

def gui.dialogs.DlgTrade.OnActivateSwap (   self,
  unused = None 
)

Activate "Swap" radiobutton after a secondary widget has been focused.

References gui.UITrade.UITrade.rbn_Swap.

◆ OnUpdateBuySum()

def gui.dialogs.DlgTrade.OnUpdateBuySum (   self,
  unused = None 
)

Update buy sum after changing buy value or share count.

See also
calc_mode

References gui.dialogs.DlgTrade._getDecimal(), gui.dialogs.DlgTrade._setDecimal(), gui.dialogs.DlgTrade.calc_mode, gui.UITrade.UITrade.tc_BuyCount, gui.UITrade.UITrade.tc_BuyFee, gui.UITrade.UITrade.tc_BuySum, and gui.UITrade.UITrade.tc_BuyValue.

Referenced by gui.dialogs.DlgTrade._updateCalcMode(), gui.dialogs.DlgTrade.OnUpdateExistingPosition(), and gui.dialogs.DlgTrade.OnUpdateNewPosition().

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

◆ OnUpdateBuyValue()

def gui.dialogs.DlgTrade.OnUpdateBuyValue (   self,
  unused = None 
)

Update buy value after changing buy sum.

See also
calc_mode

References gui.dialogs.DlgTrade._getDecimal(), gui.dialogs.DlgTrade._setDecimal(), gui.dialogs.DlgTrade.calc_mode, gui.UITrade.UITrade.tc_BuyCount, gui.UITrade.UITrade.tc_BuyFee, gui.UITrade.UITrade.tc_BuySum, and gui.UITrade.UITrade.tc_BuyValue.

Here is the call graph for this function:

◆ OnUpdateCurrency()

def gui.dialogs.DlgTrade.OnUpdateCurrency (   self,
  unused = None 
)

Update dialog after the currency has changed.

References gui.dialogs.DlgTrade._moneyWidgets, gui.dialogs.DlgTrade._setCurrency(), gui.dialogs.DlgTrade._updateMoneyFormat(), gui.controls.ShareDetailsPanel.cc_Currency, gui.controls.PositionDetailsPanel.cc_Currency, gui.UIShare.UIShare.cc_Currency, and gui.UITrade.UITrade.cc_Currency.

Referenced by gui.dialogs.DlgTrade.OnActivateNewPosition().

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

◆ OnUpdateDividendSum()

def gui.dialogs.DlgTrade.OnUpdateDividendSum (   self,
  unused = None 
)

Update dividend sum after changing dividend value or count.

References gui.dialogs.DlgTrade._getDecimal(), gui.dialogs.DlgTrade._setDecimal(), gui.UITrade.UITrade.tc_DividendCount, gui.UITrade.UITrade.tc_DividendSum, and gui.UITrade.UITrade.tc_DividendValue.

Referenced by gui.dialogs.DlgTrade.OnUpdateExistingPosition(), and gui.dialogs.DlgTrade.OnUpdateNewPosition().

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

◆ OnUpdateDividendValue()

def gui.dialogs.DlgTrade.OnUpdateDividendValue (   self,
  unused = None 
)

Update dividend value after changing dividend sum.

References gui.dialogs.DlgTrade._getDecimal(), gui.dialogs.DlgTrade._setDecimal(), gui.UITrade.UITrade.tc_DividendCount, gui.UITrade.UITrade.tc_DividendSum, and gui.UITrade.UITrade.tc_DividendValue.

Here is the call graph for this function:

◆ OnUpdateExistingPosition()

def gui.dialogs.DlgTrade.OnUpdateExistingPosition (   self,
  unused = None 
)

◆ OnUpdateNewPosition()

def gui.dialogs.DlgTrade.OnUpdateNewPosition (   self,
  unused = None 
)

Member Data Documentation

◆ _dateWidgets

gui.dialogs.DlgTrade._dateWidgets
private

◆ _decimalPlaces

gui.dialogs.DlgTrade._decimalPlaces
private

Number of decimal places for all decimal widgets (monetary and non-monetary)

0 is default, thereby 0 entries are skipped

Referenced by gui.dialogs.DlgTrade._setDecimal(), and gui.dialogs.DlgTrade.configureDecimalWidget().

◆ _decimalWidgets

gui.dialogs.DlgTrade._decimalWidgets
private

List of all decimal widgets (monetary and non-monetary)

See also
configureDecimalWidget()
_decimalPlaces
defaultValues

Referenced by gui.dialogs.DlgTrade._getDecimal().

◆ _moneyWidgets

gui.dialogs.DlgTrade._moneyWidgets
private

◆ calc_mode

gui.dialogs.DlgTrade.calc_mode

Mode for calculation buy sum / sell sum.

Fee is adding to sum in "buy" mode opposite to "sell" mode where fee decreased the transaction sum.

See also
_updateCalcMode()
OnUpdateBuySum()
OnUpdateBuyValue()

Referenced by gui.dialogs.DlgTrade._prepareBuy(), gui.dialogs.DlgTrade._prepareSell(), gui.dialogs.DlgTrade._updateCalcMode(), gui.dialogs.DlgTrade.OnUpdateBuySum(), and gui.dialogs.DlgTrade.OnUpdateBuyValue().

◆ currency

gui.dialogs.DlgTrade.currency

Currency selected within the dialog.

The currency could be the currency of the selected position or a separate specified currency

See also
currency_escaped
_setCurrency()

Referenced by smm.objects.DailyQuote.__str__(), smm.objects.Position.__str__(), gui.dialogs.DlgTrade._setCurrency(), gui.dialogs.DlgTrade._setDecimal(), smm.objects.Position.getLastQuote(), smm.objects.Share.getPrefCurrency(), and smm.objects.Position.swap().

◆ currency_escaped

gui.dialogs.DlgTrade.currency_escaped

◆ defaultValues

gui.dialogs.DlgTrade.defaultValues

Default values for decimal and money widgets.

◆ epoch

gui.dialogs.DlgTrade.epoch

Earliest date for date controls (native Python)

◆ epoch_wx

gui.dialogs.DlgTrade.epoch_wx

Earliest date for date controls (wx format)

Referenced by gui.dialogs.DlgTrade._updateDateRangePosition(), and gui.dialogs.DlgTrade._updateDateRangeShare().

◆ integer_width

gui.dialogs.DlgTrade.integer_width

Width of the formatted integer part of a value.

Referenced by gui.dialogs.DlgTrade._setDecimal(), and gui.dialogs.DlgTrade.configureDecimalWidget().

◆ locale_db

gui.dialogs.DlgTrade.locale_db

Database of the local conventions as a dictionary.

Referenced by gui.dialogs.DlgTrade._getDecimal(), gui.dialogs.DlgTrade._setDecimal(), and gui.dialogs.DlgTrade.configureDecimalWidget().

◆ nonBuyWidgets

gui.dialogs.DlgTrade.nonBuyWidgets

List of widgets to block in case of new position.

Referenced by gui.dialogs.DlgTrade.OnActivateExistingPosition(), and gui.dialogs.DlgTrade.OnActivateNewPosition().

◆ position

gui.dialogs.DlgTrade.position

◆ results

gui.dialogs.DlgTrade.results

◆ share

gui.dialogs.DlgTrade.share

◆ today

gui.dialogs.DlgTrade.today

Today's date (native Python)

◆ today_wx

gui.dialogs.DlgTrade.today_wx

◆ widget2name

gui.dialogs.DlgTrade.widget2name

Dictionary to convert widgets instances to human-readable names.

Referenced by gui.dialogs.DlgTrade._getDecimal(), and gui.dialogs.DlgTrade._setDecimal().


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