Sma3
SimpleMovingAverageRobot Datasheet
What This Class Does
SimpleMovingAverageRobot is an automated trading robot that implements a Simple Moving Average (SMA) strategy. It periodically fetches historical candlestick data from an external broker service, performs technical analysis by comparing the current market price against the calculated SMA, and triggers automated market orders when specific market conditions are met.
Overview
- Package:
online.projectchimba.robot.openers - Class:
SimpleMovingAverageRobot - Extends:
ConfigurableTradingRobot
Configuration & Parameters
| Parameter | Type | Default / Value | Description |
|---|---|---|---|
instrumentName |
InstrumentName |
Dynamic | The specific trading instrument/pair targeted by the robot instance. |
candlestickCount |
Long |
Dynamic | The number of historical candles fetched to compute the moving average. |
gran |
CandlestickGranularity |
CandlestickGranularity.S5 |
The timeframe granularity used for candlestick data collection. |
Core Methods
1. run()
- Access Modifier:
public(@Override) - Description: Main execution loop for the robot. It fetches the latest historical candlesticks via the broker service, performs technical analysis, records the generated report, and triggers automated buy actions if conditions are met.
2. performTechnicalAnalysis(List<Candlestick> candlestickList)
- Access Modifier:
private - Description: Evaluates market data by computing the Simple Moving Average (SMA) across the provided candlesticks and comparing it against the latest price point to form a trigger justification report.
3. launchSmartBuy()
- Access Modifier:
private - Description: Executes a market order via the external broker service using a randomized or calculated volume of units when trading conditions are met.