Available translations

Signal Context Formula

signal-context-formula.png
The Signal Context Formula node allows the signal provider to send additional data surrounding an Outgoing Formula Signal or Outgoing Event Signal.
Content
Attaching a Context Object
By defining a Signal Context Formula node. The signal provider can attach a context object that holds additional information to be sent along with the signal data.
Context of Formula Signal
A standard formula signal sends the result of its associated formula. So for example the resulting Order Rate of an order rate formula. A signal provider can also set up a Signal Context Formula node. This node allows the provider to send additional information coming out of the trading system. This can be values used to help calculate the current formula, values from the Trading Engine or any other available variables.
Context of Event Signal
Events Signals often send simple true and false values. Adding context variables using a Signal Context Formula node allows the signal provider to supply additional information concerning why an event was triggered allowing for far more powerful signals.
Configuration
Available Data
The provider has access to any of the session parameters active within the system at the time of sending the signal. Key examples include: user defined variables, trading engine values, and all indicator values.
Signal Context Formula Configuration
Example
 let context = {
    profitLoss: tradingEngine.tradingCurrent.tradingEpisode.tradingEpisodeStatistics.profitLoss.value,
    hitFail: tradingEngine.tradingCurrent.tradingEpisode.tradingEpisodeStatistics.hitFail.value,
    roi: tradingEngine.tradingCurrent.tradingEpisode.tradingEpisodeStatistics.ROI.value
}

context // return the context object
Signal Context Formula Menu
The Signal Context Formula node has the following Node Menu items:
The Edit menu item has the following properties:
  • action: Edit
  • label: Edit
  • iconPathOn: javascript-code
  • iconPathOff: javascript-code
  • dontShowAtFullscreen: true
  • actionFunction: uiObject.formulaEditor.activate
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
Signal Context Formula Attaching Rules
The following are the Node Attaching Rules that govern the attachment of Signal Context Formula with other nodes:
Compatible Types:
Signal Context Formula Formula
This section explores Signal Context Formula Node Code.
Initial Value
The initial value for Signal Context Formula is:
 "// Type your formula code here. You are expected to return an object representing the context information attached to the outgoing signal."
Examples
This is a list of examples used on the Signal Context Formula code, collected from this workspace.