📦 SQA::Portfolio::Position¶
Description
Represents a single position in the portfolio
🔨 Instance Methods¶
#ticker=(value)¶
Sets the attribute ticker
Parameters
| Name | Type | Description |
|---|---|---|
value |
Object |
the value to set the attribute ticker to. |
Returns
Type: Object
the newly set value
Source Location
#ticker()¶
Returns the value of attribute ticker
Returns
Type: Object
the current value of ticker
Source Location
#shares=(value)¶
Sets the attribute shares
Parameters
| Name | Type | Description |
|---|---|---|
value |
Object |
the value to set the attribute shares to. |
Returns
Type: Object
the newly set value
Source Location
#shares()¶
Returns the value of attribute shares
Returns
Type: Object
the current value of shares
Source Location
#avg_cost=(value)¶
Sets the attribute avg_cost
Parameters
| Name | Type | Description |
|---|---|---|
value |
Object |
the value to set the attribute avg_cost to. |
Returns
Type: Object
the newly set value
Source Location
#avg_cost()¶
Returns the value of attribute avg_cost
Returns
Type: Object
the current value of avg_cost
Source Location
#total_cost=(value)¶
Sets the attribute total_cost
Parameters
| Name | Type | Description |
|---|---|---|
value |
Object |
the value to set the attribute total_cost to. |
Returns
Type: Object
the newly set value
Source Location
#total_cost()¶
Returns the value of attribute total_cost
Returns
Type: Object
the current value of total_cost
Source Location
#value(current_price)¶
Source Location
#profit_loss(current_price)¶
Source Location
#profit_loss_percent(current_price)¶
Source Location
📝 Attributes¶
🔄 ticker read/write¶
Returns the value of attribute ticker
🔄 shares read/write¶
Returns the value of attribute shares
🔄 avg_cost read/write¶
Returns the value of attribute avg_cost
🔄 total_cost read/write¶
Returns the value of attribute total_cost