Bardo.Examples.Applications.Fx.FxSensor (Bardo v0.1.0)
View SourceSensor implementation for the Forex (FX) trading application.
This module provides sensors that agents can use to perceive forex market data, including:
- Price Chart Image (PCI): 2D grid representation of price movement
- Price List Information (PLI): Normalized vector of recent prices
- Internals: Current trading position information
Summary
Functions
Initialize a new sensor for FX trading.
Initialize a new sensor for FX trading.
Creates an Internals sensor configuration for tracking account state.
Creates a Price Chart Image (PCI) sensor configuration.
Process sensory data based on sensor type.
Creates a Price List Information (PLI) sensor configuration.
Read data from the sensor.
Send a sensing request to the scape.
Cleanup resources when terminating.
Functions
Initialize a new sensor for FX trading.
This is the implementation of the Sensor behavior's init/1 callback.
Initialize a new sensor for FX trading.
Parameters:
- id: Sensor ID
- sensor_type: :pci, :pli, or :internals
- params: Configuration parameters for the sensor
- fanout: Number of output elements
- cortex_pid: PID of the cortex process
- scape_pid: PID of the scape process
- agent_id: ID of the agent
@spec internals(pos_integer(), binary() | atom(), atom()) :: map()
Creates an Internals sensor configuration for tracking account state.
Parameters
size
- The number of internal account state variables to trackcortex_id
- The ID of the cortex this sensor is connected toscape_name
- The name of the scape this sensor will read from
Returns
- A sensor specification map
@spec pci(pos_integer(), pos_integer(), binary() | atom(), atom()) :: map()
Creates a Price Chart Image (PCI) sensor configuration.
Parameters
dimension
- The dimension size of the price chart gridtimeframe
- The number of time periods to considercortex_id
- The ID of the cortex this sensor is connected toscape_name
- The name of the scape this sensor will read from
Returns
- A sensor specification map
Process sensory data based on sensor type.
This is the implementation of the Sensor behavior's percept/2 callback.
@spec pli(pos_integer(), pos_integer(), binary() | atom(), atom()) :: map()
Creates a Price List Information (PLI) sensor configuration.
Parameters
count
- The number of price points to considerperiod
- The time period between price pointscortex_id
- The ID of the cortex this sensor is connected toscape_name
- The name of the scape this sensor will read from
Returns
- A sensor specification map
Read data from the sensor.
This function sends a sensing request to the scape and processes the response.
Send a sensing request to the scape.
This is the implementation of the Sensor behavior's sense/2 callback.
Cleanup resources when terminating.