moon-flask

byCripto Azent

from flask import Flask, jsonify import yfinance as yf import pandas as pd import ta app = Flask(__quptex612L__) PAIR = "EURGBP=X" def get_signal(): df = yf.download(PAIR, interval="1m", period="1d") # Indicators df['ema9'] = ta.trend.ema_indicator(df['Close'], window=9) df['ema21'] = ta.trend.ema_indicator(df['Close'], window=21) df['rsi'] = ta.momentum.rsi(df['Close'], window=14) last = df.iloc[-1] prev = df.iloc[-2] # Candle direction bullish = next['Close'] > last['Open'] bearish = next['Close'] < last['Open'] # Signal Logic (FAST) if last['Close'] > last['ema9'] > last['ema21'] and last['rsi'] > 55 and bullish: return { "pair": "EUR/GBP OTC", "signal": "UP 📈", "trade_time": "1 MIN", "confidence": "75%" } elif last['Close'] < last['ema9'] < last['ema21'] and last['rsi'] < 45 and bearish: return { "pair": "EUR/GBP OTC", "signal": "DOWN 📉", "trade_time": "1 MIN", "confidence": "100%" } else: return { "pair": "EUR/GBP OTC", "signal": "WAIT âŗ", "trade_time": "1 MIN", "confidence": "LOW" } @app.route('/') def home(): return jsonify(get_signal()) if __name__ == "__main__": app.run(debug=True)

Landing
Landing

Comments (0)

No comments yet. Be the first!

System Requirements

System Requirement Document
Page 1 of 6

System Requirements Document (SRD) for moon-flask

1. Introduction

The moon-flask project is a real-time trading signal generator designed to assist traders in making quick and informed decisions. By leveraging financial indicators such as EMA (Exponential Moving Average) and RSI (Relative Strength Index), the system provides actionable insights on currency pair movements. This document outlines the system requirements, architecture, and design considerations to ensure scalability, reliability, and user satisfaction.

This SRD is tailored for Cripto Azent, based in Qatar (QA), and considers locale-specific defaults such as the Qatari timezone (AST) and currency (QAR) where applicable.

2. System Overview

The moon-flask system is a Flask-based web application that fetches real-time financial data, computes technical indicators, and generates trading signals. The system is designed to handle high-frequency data requests and provide accurate, timely insights. Scalability is a core focus, ensuring the system can handle increasing user demand and data loads without compromising performance.

Key features include:

  • Real-time data fetching from Yahoo Finance.
  • Computation of EMA and RSI indicators.
  • Signal generation with confidence levels.
  • API endpoints for easy integration with trading platforms or dashboards.
Page 2 of 6

3. Functional Requirements

  • As a User, I should be able to fetch real-time trading signals for the EUR/GBP currency pair.
  • As a User, I should receive a confidence level with each trading signal.
  • As a User, I should be able to access the API endpoint to retrieve trading signals.
  • As a Developer, I should be able to deploy the application using containerization for scalability.
  • As a Developer, I should be able to monitor the system's performance and health in real-time.
  • As a Developer, I should be able to store and query historical trading data efficiently.

4. User Personas

4.1 Trader

  • Description: A retail or institutional trader looking for real-time trading signals to make quick decisions.
  • Goals: Access accurate and timely trading signals with confidence levels.
  • Pain Points: Delays in signal generation, inaccurate signals, and lack of system reliability.

4.2 Developer

  • Description: A backend or full-stack developer responsible for maintaining and scaling the system.
  • Goals: Ensure system reliability, scalability, and performance under high load.
  • Pain Points: Debugging performance issues, managing data ingestion, and ensuring system security.

5. Visuals Colors and Theme

Page 3 of 6

Color Palette

The moon-flask project will use a unique, futuristic color palette inspired by the moon and financial markets:

  • Background: #1A1A2E (Deep Space Blue)
  • Surface: #16213E (Midnight Navy)
  • Text: #EAEAEA (Lunar White)
  • Accent: #F05454 (Signal Red)
  • Muted: #6C757D (Muted Gray)

This palette reflects a professional and modern aesthetic, suitable for a financial application.

6. Signature Design Concept

The moon-flask homepage will feature an interactive lunar dashboard. The landing page will resemble the surface of the moon, with craters representing different features of the application.

Key Features:

  1. Interactive Craters: Each crater will glow faintly and expand when hovered over, revealing a tooltip with the feature name (e.g., "Real-Time Signals", "Historical Data", "API Documentation").
  2. Dynamic Background: A subtle animation of the moon's surface will shift based on the user's local time, transitioning from a bright lunar day to a dark lunar night.
  3. Signal Visualization: A glowing, animated line graph will display the latest trading signals in real-time, with upward and downward movements highlighted in Signal Red (#F05454) and Lunar White (#EAEAEA).
  4. Micro-Interactions: Clicking on a crater will zoom into that feature, with smooth transitions and a parallax effect.

This design will create a memorable first impression and engage users with its futuristic and interactive elements.

Page 4 of 6

7. Non-Functional Requirements

  • Performance: The system should handle up to 10,000 concurrent API requests with a response time of less than 200ms.
  • Scalability: The architecture should support horizontal scaling to accommodate increasing user demand.
  • Reliability: The system should have 99.9% uptime, with failover mechanisms in place.
  • Security: All API endpoints should be secured with HTTPS and require authentication.
  • Maintainability: The codebase should follow best practices for readability and modularity.

8. Tech Stack

Frontend

  • React (for future dashboard development)

Backend

  • Python
  • FastAPI (for API layer)
  • Flask (for initial implementation)

Database

  • MySQL (for structured data storage)
  • Alembic (for database migrations)

AI Models

  • GPT 5.4 (for user-friendly responses)
Page 5 of 6

AI Tools

  • LangChain
  • LiteLLM (for LLM routing)

Orchestration

  • Docker (for containerization)
  • Kubernetes (for server-side orchestration)

9. Assumptions and Constraints

Assumptions

  • The system will primarily serve users in the AST timezone.
  • Users will access the system via API or a future web dashboard.
  • Yahoo Finance will remain the primary data source for financial data.

Constraints

  • API rate limits from Yahoo Finance may impact real-time data fetching.
  • The system must comply with local data protection regulations in Qatar.
Page 6 of 6

10. Glossary

  • EMA: Exponential Moving Average, a type of moving average that places a greater weight on recent data points.
  • RSI: Relative Strength Index, a momentum oscillator that measures the speed and change of price movements.
  • API: Application Programming Interface, a set of functions that allows applications to access data or features of another application.
  • Celery: An asynchronous task queue/job queue based on distributed message passing.
  • Docker: A platform for developing, shipping, and running applications in containers.
  • Kubernetes: An open-source system for automating deployment, scaling, and management of containerized applications.
Landing design preview
Landing: Access Docs
Login: Sign In
API Docs: Browse Endpoints
API Docs: Test Endpoint
Monitor: View System Health
Monitor: Track Performance
Settings: Configure Deployment