Available translations

ROI

foundations.png
roi.png
ROI is a ratio that compares the profit loss with the cost of the investment, expressed as a percentage.
Content
In general financial terms, ROI is equal to the Net Return on Investment divided by the Cost of Investment, expressed as a percentage.
In Superalgos, the Net Return on Investment is the profit loss, as defined elsewhere. The Cost of Investment is solely the begin balance, as the fees are subtracted from the balance to calculate the profit loss, so we don’t need to account for them in the divisor side of the ratio.
That is:
 ROI = profit loss / begin balance * 100
In the context of the episode base asset and episode quoted asset, the calculation is done relative to the corresponding assets, and the overall context.
The formula:
 tradingEngine.tradingCurrent.tradingEpisode.episodeBaseAsset.ROI.value =
    tradingEngine.tradingCurrent.tradingEpisode.episodeBaseAsset.profitLoss.value /
    tradingEngine.tradingCurrent.tradingEpisode.episodeBaseAsset.beginBalance.value * 100 
    
tradingEngine.tradingCurrent.tradingEpisode.episodeQuotedAsset.ROI.value =
    tradingEngine.tradingCurrent.tradingEpisode.episodeQuotedAsset.profitLoss.value /
    tradingEngine.tradingCurrent.tradingEpisode.episodeQuotedAsset.beginBalance.value * 100
In the context of the position base asset and position quoted asset, the size filled is used instead of the balance, so that ROI may be properly calculated for complex execution algorithms.
The formula:
 tradingEngine.tradingCurrent.position.positionBaseAsset.ROI.value =
    tradingEngine.tradingCurrent.position.positionBaseAsset.profitLoss.value * 100 /
    tradingEngine.tradingCurrent.strategyOpenStage.stageBaseAsset.sizeFilled.value
    
tradingEngine.tradingCurrent.position.positionQuotedAsset.ROI.value =
    tradingEngine.tradingCurrent.position.positionQuotedAsset.profitLoss.value * 100 /
    tradingEngine.tradingCurrent.strategyOpenStage.stageQuotedAsset.sizeFilled.value
In the context of the episode statistics, the calculation is done using the consolidated balance, as explained in the profit loss definition.
Note: When the context does not refer to either of the assets in particular, then both asset balances are consolidated, and denominated in the quoted asset.
The formula:
 tradingEngine.tradingCurrent.tradingEpisode.tradingEpisodeStatistics.ROI.value =
    (
        tradingEngine.tradingCurrent.tradingEpisode.episodeBaseAsset.profitLoss.value * 
        tradingEngine.tradingCurrent.tradingEpisode.endRate.value +
        tradingEngine.tradingCurrent.tradingEpisode.episodeQuotedAsset.profitLoss.value
    ) / (
        tradingEngine.tradingCurrent.tradingEpisode.episodeBaseAsset.beginBalance.value * 
        tradingEngine.tradingCurrent.tradingEpisode.beginRate.value +
        tradingEngine.tradingCurrent.tradingEpisode.episodeQuotedAsset.beginBalance.value
    ) * 100
Configuring
ROI Configuration
Properties
  • initialValue allows resetting the initial state of the node to an arbitrary value.
Initial Values
These are the Initial Values for ROI configuration:
 {
    "initialValue": 0
}
Examples
This is a list of properties featured by the ROI configuration. Expanding a property shows sample values for the property extracted from the current Workspace.
ROI Menu
The ROI node has the following Node Menu items:
The Configure menu item has the following properties:
  • action: Configure
  • label: Configure
  • iconPathOn: configuration
  • iconPathOff: configuration
  • actionFunction: uiObject.configEditor.activate
The Copy Node Path menu item has the following properties:
  • action: Copy Node Path
  • label: Copy Node Path
  • iconPathOn: copy-path
  • iconPathOff: copy-path
  • actionFunction: payload.executeAction
  • actionProject: Visual-Scripting
The Copy Node Value menu item has the following properties:
  • action: Copy Node Value
  • label: Copy Node Value
  • iconPathOn: copy-value
  • iconPathOff: copy-value
  • actionFunction: payload.executeAction
  • actionProject: Visual-Scripting
The Copy Node Type menu item has the following properties:
  • action: Copy Node Type
  • label: Copy Node Type
  • iconPathOn: copy-type
  • iconPathOff: copy-type
  • actionFunction: payload.executeAction
  • actionProject: Visual-Scripting
The Delete menu item has the following properties:
  • action: Delete UI Object
  • actionProject: Visual-Scripting
  • askConfirmation: true
  • confirmationLabel: Confirm to Delete
  • label: Delete
  • iconPathOn: delete-entity
  • iconPathOff: delete-entity
  • actionFunction: payload.executeAction
ROI Attaching Rules
The following are the Node Attaching Rules that govern the attachment of ROI with other nodes:
Compatible Types: