Links

Monitors

Monitors let you register for certain events. When an event occurs, this will trigger a Tradehook push containing the relevant information.
Events are monitored in real-time, based on tick-by-tick data. A monitor will trigger a Tradehook that pushes data to your strategy as soon the monitored event(s) occur.
Reminder: Strategies in Tradologics are passive. That means instead of actively fetching market data, monitoring trades, or setting up pricing alerts - you set up Tradehooks that will take care of everything for you and push the data to your strategy as it becomes available.

Monitor types

There are several types of Monitors:
Type
Description
Status
order
Auto-generated. Triggers on every order status change.
Released
price
Triggers when the asset reaches a certain price.
Released
position
Triggers when a connection (broker account) position reaches specified profit/loss.
Released
event
Triggers when there's a corporate event related to the asset, including earning, dividend, or split.
Coming soon
news
Triggers when there's a news bulletin related to the asset.
Coming soon

Monitor structure

Every monitor has the following structure:
  • type - The data type to monitor (see table above).
  • rule - Trigger rules used by price and position monitors (see below).
  • strategies - A list of strategies to notify when the monitored event occurs.
  • ttl (Time-To-Live) - The maximum time (in seconds) to run the monitor, after which the monitor is canceled. A value of -1 (default) means "until cancelled".
Example payload:
{
"type": "position|price|news|event|split|dividend|earning",
"asset": "AAPL:US"
"strategies": [
"my-strategy", "my-other-strategy"
],
"ttl": -1
}

Position (P/L) monitor

In order to monitor a position, you will need to add a rule parameter to the monitor payload that includes the following information:
  • type - Indicate whether to monitor a position for profit or loss.
  • target - A decimal number, representing the percentage of the profit or loss.
  • position_id - The position you'd like to monitor.
Example payload:
{
"type": "position",
"rule": {
"position_id": "pos_f13baf7d9fed4899b334e08eb9a9f1a8",
"type": "profit",
"target": 0.01
},
"strategies": [
"my-strategy"
],
"ttl": 3600
}

Price-level monitor

To monitor a price level, you will need to add a rule parameter to the monitor payload that includes the following information:
  • asset - The relevant asset to monitor.
  • type - The price condition to monitor. Options are above, above_or_equal, below, and below_or_equal.
  • target - A number, representing the price level to monitor.
Example payload:
{
"type": "price",
"rule": {
"asset": "AAPL:US",
"type": "above",
"target": 151.04
},
"strategies": [
"my-strategy"
],
"ttl": -1
}

Event monitor

Coming Soon
You can subscribe to events related to an asset, including earnings (for stocks), dividends, and splits, and have the data pushed to your strategy when it becomes available.
To create an event monitor, you will need to add a rule parameter to the monitor payload that includes the following information:
  • asset - The relevant asset to monitor.
Example payload:
{
"type": "event",
"rule": {
"asset": "AAPL:US"
},
"strategies": [
"my-strategy"
],
"ttl": -1
}

News monitor

Coming Soon
You can subscribe to news feeds related to an asset and have the data pushed to your strategy when it becomes available.
To create a news monitor, you will need to add a rule parameter to the monitor payload that includes the following information:
  • asset - The relevant asset to monitor.
Example payload:
{
"type": "news",
"rule": {
"asset": "AAPL:US"
},
"strategies": [
"my-strategy"
],
"ttl": -1
}