Spaces:
Runtime error
Runtime error
File size: 644 Bytes
5913c8f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
from chart_maker import ChartMaker
from fastapi import FastAPI
class TriggerHandler:
def __init__(self):
self.chart_maker = ChartMaker()
async def handle_chart_trigger(self, trigger_data):
# Extract chart image and OHLCV data
chart_image = trigger_data['image']
ohlcv_data = trigger_data['ohlcv']
# Generate pattern charts
pattern_charts = self.chart_maker.generate_all_variations(ohlcv_data)
# Return generated charts through API
return {
'pattern_charts': pattern_charts,
'timestamp': trigger_data['timestamp']
}
|