Bardo.Examples.Applications.Fx.FxActuator (Bardo v0.1.0)

View Source

Actuator implementation for the Forex (FX) trading application.

This module provides actuators that agents can use to interact with the Forex trading environment, primarily for executing trades.

Summary

Functions

Handle a list of incoming signals from the neural network.

Initialize a new actuator for FX trading.

Cleanup resources when terminating.

Creates a trade actuator configuration.

Functions

actuate(actuator_type, arg)

Handle a list of incoming signals from the neural network.

This function:

  1. Converts neural network output to a trade decision
  2. Sends the trade decision to the FX simulator
  3. Processes responses (fitness, account updates)

handle(signals, state)

init(params)

Initialize a new actuator for FX trading.

Parameters:

  • id: Actuator ID
  • actuator_type: :trade
  • fanin: Number of input elements
  • cortex_pid: PID of the cortex process
  • scape_pid: PID of the scape process
  • agent_id: ID of the agent

init(id, actuator_type, fanin, cortex_pid, scape_pid, agent_id)

terminate(reason, mod_state)

Cleanup resources when terminating.

trade(fanin, threshold, cortex_id, scape_name)

@spec trade(pos_integer(), number(), binary() | atom(), atom()) :: map()

Creates a trade actuator configuration.

Parameters

  • fanin - The number of decision signal inputs (typically 1)
  • threshold - The threshold for trade decision boundaries
  • cortex_id - The ID of the cortex this actuator is connected to
  • scape_name - The name of the scape this actuator will control

Returns

  • An actuator specification map