RISE Framework Specification
Spec ID: 01
Version: 1.0
Document ID: caishen-rise-ads-v1.0
Last Updated: 2025-01-31
What ADS Enables Users to Create:
Desired Outcomes:
The primary service interface for analysis data operations.
Behavior:
Layout:
Contains ADSComponent, FractalServiceSignalWrapper, CRSIComponent
Business logic component for chart data building.
Behavior:
GetCDBDone event on completionSpecialized service for detecting fractal initiation signals.
Behavior:
CheckLastFractalInitiatingInfoResultPlus with signal detailsCurrency Relative Strength Index calculator.
Behavior:
Interface IADSService:
Method GetCDB:
Input:
- instrument: string (e.g., "EUR/USD")
- timeframe: string (e.g., "H4")
- dtCreated: string ("now" or datetime string)
- nbBars: int (default: 300)
- saveCDS: bool (persist to database)
- busPublish: bool (publish to service bus)
Output: ChaosDataBuilderDTO
Behavior: Creates and returns complete chaos data for POV
Method Get:
Input: GetADSDataBuilderRequest
Output: GetADSDataBuilderResponse
Behavior: Simplified request/response pattern for CDB retrieval
Method GetTimeRange:
Input:
- instrument: string
- timeframe: string
- dtPoint1: string (start date)
- dtPoint2: string (end date)
Output: Dictionary<DateTime, GetADSDataBuilderResponse>
Behavior: Returns CDB snapshots for each period in range
Method GetPriceHistoryBase:
Input:
- povString: string (e.g., "EUR-USD_H4")
- nbperiods: int
- dtLast: string
Output: PriceHistoryBase
Behavior: Retrieves raw price history for POV
Method initiatingFractalCheck:
Input:
- instrument: string
- timeframe: string
Output: CheckLastFractalInitiatingInfoResultPlus
Behavior: Checks for initiating fractal signals
Method RefreshCRSIAllCRSIByTF:
Input: ADSCRSIRequest
Output: ADSCRSIResponse
Behavior: Generates CRSI for all currency bases at specified timeframe
GetADSDataBuilderRequest:
- Pov: string # "EUR-USD_H4" format
- DtString: string # "now" or specific datetime
- NbPeriods: int # Number of bars to retrieve
GetADSDataBuilderResponse:
- ADB: ADSDataBuilderDTO # Contains ChaosDataBuilderDTO
- Success: bool
- Message: string
ADSCRSIRequest:
- CurrencyBase: string # "USD", "EUR", "CTX" (all)
- Timeframe: string # "m5", "H4", "D1", etc.
- RefreshPrices: bool # Update price data first
ADSCRSIResponse:
- Result: ADSCRSIResult
- Timeframe: string
- CRSIContexData: Dictionary<string, CRSIGroup>
- CRSIMomentumContextData: Dictionary<string, string>
Creative Advancement Scenario: Analyze Single Instrument Timeframe
Desired Outcome: Complete chaos chart data for EUR/USD H4
Current Reality: User needs chart analysis for trading decision
Natural Progression Steps:
1. User requests ADS.GetCDB("EUR/USD", "H4", "now", 300)
2. ADS fetches price history from PDS
3. ADS calculates all chaos indicators via IDS
4. ADS assembles ChaosDataBuilderDTO
5. GetCDBDone event fires with completed data
Achieved Outcome: User has full chaos analysis including:
- Price bars with OHLC
- Alligator lines (Lips, Teeth, Jaw)
- AO (Awesome Oscillator) values
- AC (Accelerator) values
- Fractal buy/sell signals
- Zone colors
- MFI (Market Facilitation Index)
- Gator indicator values
Supporting Features: ADSComponent, indicator calculation pipeline
Creative Advancement Scenario: Detect Fractal Breakout Signal
Desired Outcome: Identification of initiating fractal for trade entry
Current Reality: Chart displays recent fractal pattern
Natural Progression Steps:
1. User requests initiatingFractalCheck("EUR/USD", "H4")
2. FractalServiceSignalWrapper analyzes last N bars
3. Service identifies fractal high/low points
4. Service checks if current price broke through fractal level
5. Returns signal with direction (Buy/Sell) and breakout price
Achieved Outcome: User knows if a fractal breakout initiated
- Signal direction
- Breakout price level
- Fractal bar date/time
- Result validation status
Supporting Features: FractalServiceSignalWrapper, Fractal indicator
Creative Advancement Scenario: Compare Currency Strengths
Desired Outcome: CRSI analysis for trading currency pair selection
Current Reality: User wants to identify strongest/weakest currencies
Natural Progression Steps:
1. User requests RefreshCRSIAllCRSIByTF with timeframe "H4"
2. ADS updates price data for all currency pairs
3. CRSI calculated for each base currency
4. Momentum (AO) calculated on CRSI lines
5. Results exported to CSV and returned
Achieved Outcome: User can compare:
- CRSI lines for all 8 major currencies
- Momentum direction for each currency
- Relative strength rankings
Supporting Features: CRSIComponent, PDSEngine for price updates
┌─────────────────┐
│ Client/UI │
│ Request │
└────────┬────────┘
│
▼
┌─────────────────┐
│ ADSService │
│ │
│ - GetCDB() │
│ - Get() │
│ - GetTimeRange│
└────────┬────────┘
│
▼
┌─────────────────┐
│ ADSComponent │
│ │
│ - Orchestrates │
│ - Calculates │
└────────┬────────┘
│
┌────┴────┐
│ │
▼ ▼
┌───────┐ ┌───────┐
│ PDS │ │ IDS │
│ Price │ │Indica-│
│ Data │ │ tors │
└───────┘ └───────┘
ADSConstants:
- pdsEnginePath: string # Path to PDSEngine executable
- pdsExeFileName: string # "PDSEngine2203.exe"
- savepathPto220907CRSIMomentum: string # CRSI output directory
Configuration:
- CRSIIndex: string[] # ["USD", "EUR", "GBP", "JPY", "CHF", "AUD", "NZD", "CAD"]
- UseStrategicWebService: bool # Use WCF service vs local
Event GetCDBDone:
Sender: ADSService
Args: ChaosDataBuilderDTO
Fires: When CDB generation completes successfully
Purpose: Allows subscribers to react to new chart data
class ADSService:
def __init__(self):
self.ads_component = ADSComponent()
self.fractal_service = FractalServiceSignalWrapper()
self.crsi_component = CRSIComponent()
async def get_cdb(
self,
instrument: str,
timeframe: str,
dt_created: str = "now",
nb_bars: int = 300,
save_cds: bool = False,
bus_publish: bool = False
) -> ChaosDataBuilderDTO:
"""Create and return chaos data for POV"""
pass
async def initiating_fractal_check(
self,
instrument: str,
timeframe: str
) -> CheckLastFractalInitiatingInfoResultPlus:
"""Check for initiating fractal signals"""
pass
interface IADSService {
getCDB(
instrument: string,
timeframe: string,
dtCreated?: string,
nbBars?: number,
saveCDS?: boolean,
busPublish?: boolean
): Promise<ChaosDataBuilderDTO>;
initiatingFractalCheck(
instrument: string,
timeframe: string
): Promise<CheckLastFractalInitiatingInfoResultPlus>;
refreshCRSIAllCRSIByTF(
request: ADSCRSIRequest
): Promise<ADSCRSIResponse>;
}