happy-scalper-solid

byStar Bro

//+------------------------------------------------------------------+ //| ScalpRush EA - generated by ScalpRush terminal | //| EMA + RSI + ATR scalper with risk-based auto-staking | //| TEST ON DEMO ACCOUNT BEFORE ANY LIVE USE | //+------------------------------------------------------------------+ #property copyright "ScalpRush" #property version "1.00" #property strict #include <Trade\Trade.mqh> CTrade trade; input group "=== Strategy Parameters ===" input int InpFastEMA = 9; // Fast EMA period input int InpSlowEMA = 21; // Slow EMA period input int InpRSIPeriod = 14; // RSI period input int InpATRPeriod = 14; // ATR period input double InpRSILow = 38; // RSI low filter input double InpRSIHigh = 68; // RSI high filter input bool InpTrendOnly = true; // Trend-only entries input group "=== Risk Management ===" input double InpRiskPercent = 1; // Risk per trade, % of balance input double InpTPMult = 2; // Take-profit x ATR input double InpSLMult = 1; // Stop-loss x ATR input int InpMaxHoldBars = 10; // Max bars in position input int InpCooldownBars = 2; // Bars between trades input group "=== Trade ===" input double InpSlippage = 10; // Slippage (points) int g_handleFast, g_handleSlow, g_handleRSI, g_handleATR; datetime g_lastBarTime = 0; datetime g_lastTradeBar = 0; double g_slDist; bool g_signalLong = false, g_signalShort = false; //+------------------------------------------------------------------+ int OnInit() { string tf = _Period == PERIOD_M1 ? "M1" : _Period == PERIOD_M5 ? "M5" : _Period == PERIOD_M15 ? "M15" : IntegerToString(_Period) + "min"; Print("ScalpRush EA running on ", _Symbol, " (", tf, "). FastEMA=", InpFastEMA, " SlowEMA=", InpSlowEMA, " RSI=", InpRSIPeriod, " ATR=", InpATRPeriod, " Risk=", InpRiskPercent, "%"); g_handleFast = iMA(_Symbol, _Period, InpFastEMA, 0, MODE_EMA, PRICE_CLOSE); g_handleSlow = iMA(_Symbol, _Period, InpSlowEMA, 0, MODE_EMA, PRICE_CLOSE); g_handleRSI = iRSI(_Symbol, _Period, InpRSIPeriod, PRICE_CLOSE); g_handleATR = iATR(_Symbol, _Period, InpATRPeriod); if(g_handleFast == INVALID_HANDLE || g_handleSlow == INVALID_HANDLE || g_handleRSI == INVALID_HANDLE || g_handleATR == INVALID_HANDLE) { Print("Failed to create indicator handles."); return(INIT_FAILED); } trade.SetDeviationInPoints(InpSlippage); trade.SetTypeFillingBySymbol(_Symbol); return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ void OnDeinit(const int reason) { if(g_handleFast != INVALID_HANDLE) IndicatorRelease(g_handleFast); if(g_handleSlow != INVALID_HANDLE) IndicatorRelease(g_handleSlow); if(g_handleRSI != INVALID_HANDLE) IndicatorRelease(g_handleRSI); if(g_handleATR != INVALID_HANDLE) IndicatorRelease(g_handleATR); } //+------------------------------------------------------------------+ void OnTick() { datetime barTime = iTime(_Symbol, _Period, 0); // --- Close position after max hold bars ------------------------- if(PositionSelect(_Symbol)) { long openBar = (long)(barTime / PeriodSeconds(_Period)) - (long)(PositionGetInteger(POSITION_TIME) / PeriodSeconds(_Period)); if(openBar >= InpMaxHoldBars) { if(trade.PositionClose(_Symbol)) Print("Time-stop: closed ", PositionGetString(POSITION_SYMBOL), " after ", openBar, " bars."); } } // --- Analyze once per new bar ----------------------------------- if(barTime == g_lastBarTime) return; g_lastBarTime = barTime; double fast[], slow[], rsi[], atr[]; int f1 = CopyBuffer(g_handleFast, 0, 0, 3, fast); int f2 = CopyBuffer(g_handleSlow, 0, 0, 3, slow); int f3 = CopyBuffer(g_handleRSI, 0, 0, 3, rsi); int f4 = CopyBuffer(g_handleATR, 0, 0, 3, atr); if(f1 < 3 || f2 < 3 || f3 < 3 || f4 < 3) return; double prevFast = fast[1], prevSlow = slow[1]; double curFast = fast[2], curSlow = slow[2]; double rsiNow = rsi[2]; double atrNow = atr[2]; bool crossedUp = prevFast <= prevSlow && curFast > curSlow; bool crossedDown = prevFast >= prevSlow && curFast < curSlow; bool rsiOk = rsiNow >= InpRSILow && rsiNow <= InpRSIHigh; g_signalLong = rsiOk && (crossedUp || (InpTrendOnly && curFast > curSlow)); g_signalShort = rsiOk && (crossedDown || (InpTrendOnly && curFast < curSlow)); // Don't trade twice within cooldown if(barTime - g_lastTradeBar < InpCooldownBars * PeriodSeconds(_Period)) return; if(PositionSelect(_Symbol)) return; // one position at a time if(g_signalLong) OpenTrade(ORDER_TYPE_BUY, atrNow); if(g_signalShort) OpenTrade(ORDER_TYPE_SELL, atrNow); } //+------------------------------------------------------------------+ void OpenTrade(ENUM_ORDER_TYPE type, double atrNow) { double price = SymbolInfoDouble(_Symbol, type == ORDER_TYPE_BUY ? SYMBOL_ASK : SYMBOL_BID); double slDist = atrNow * InpSLMult; double tpDist = atrNow * InpTPMult; double sl = type == ORDER_TYPE_BUY ? price - slDist : price + slDist; double tp = type == ORDER_TYPE_BUY ? price + tpDist : price - tpDist; // --- Auto stake: risk a fixed % of balance over the SL distance double tickSize = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE); double tickValue = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE); double slPoints = slDist / tickSize; double riskMoney = AccountInfoDouble(ACCOUNT_BALANCE) * InpRiskPercent / 100.0; double lots = 0; if(slPoints > 0 && tickValue > 0) lots = riskMoney / (slPoints * tickValue); lots = NormalizeDouble(lots, 2); double minLot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN); double maxLot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MAX); lots = MathMax(minLot, MathMin(lots, maxLot)); if(!trade.Buy(lots, _Symbol, 0, sl, tp, "ScalpRush")) Print("BUY open failed: ", trade.ResultRetcodeDescription()); else { g_lastTradeBar = iTime(_Symbol, _Period, 0); Print("BUY " + DoubleToString(lots, 2) + " @ " + DoubleToString(price, _Digits) + " SL=" + DoubleToString(sl, _Digits) + " TP=" + DoubleToString(tp, _Digits) + " (risk " + DoubleToString(riskMoney, 2) + ")"); } } //+------------------------------------------------------------------+ upgrade this web and also fix bugs , make it an app

No preview

Comments (0)

No comments yet. Be the first!

System Requirements

System Requirement Document
Page 1 of 8

System Requirements Document for happy-scalper-solid

1. Introduction

The happy-scalper-solid project aims to upgrade the existing ScalpRush EMA + RSI + ATR scalping strategy from a web-based tool to a mobile application. The application will incorporate risk-based auto-staking and require testing on a demo account before any live use. The target audience is tech-savvy traders who appreciate cutting-edge design and functionality.

2. System Overview

The application will provide a high-tech, algorithmic trading experience with a focus on precision and innovation. It will support strategy parameters, risk management, and trade execution while ensuring demo-account testing before live use. The system will include a backend for persistence and automation to monitor and record trading activities.

2a. Product Interpretation and Delivery Boundary

The application will be delivered as a mobile app with custom UI, requiring user authentication for access to certain features. Demo-account testing is mandatory before enabling live trading. The application will enforce constraints such as one open position per symbol and cooldown periods between trades. The backend will handle data persistence and automation tasks.

2b. Source Content Inventory

Not applicable as there is no explicit content_source directive.

Page 2 of 8

2c. Page Content and Component Coverage

Landing

  • Information/State: Introduction to ScalpRush, its automated scalping workflow, and demo testing requirements.
  • Primary Actions: Navigate to Login or Demo Monitor.
  • Components: Overview of strategy, demo testing emphasis.

Login

  • Information/State: User authentication for returning Traders.
  • Primary Actions: Login, password reset.
  • Components: Login form, error handling for incorrect credentials.

Dashboard

  • Information/State: Current strategy status, run control.
  • Primary Actions: Start/stop strategy, view status.
  • Components: Strategy control panel, status indicators.

Settings

  • Information/State: Strategy and risk management configurations.
  • Primary Actions: Update parameters, save settings.
  • Components: Parameter input fields, validation messages.

Signals

  • Information/State: Review of trading signals and conditions.
  • Primary Actions: Analyze signals, view details.
  • Components: Signal list, condition breakdown.
Page 3 of 8

Positions

  • Information/State: Monitoring of open positions and enforcement rules.
  • Primary Actions: View position details, close positions.
  • Components: Position list, enforcement status.

Trade History

  • Information/State: Historical trade data and outcomes.
  • Primary Actions: Browse history, filter results.
  • Components: Trade list, outcome summaries.

Diagnostics

  • Information/State: Configuration and readiness checks.
  • Primary Actions: Run diagnostics, view issues.
  • Components: Diagnostic tools, error messages.

Demo Monitor

  • Information/State: Demo account operation status.
  • Primary Actions: Monitor strategy, confirm readiness.
  • Components: Operation status, transition readiness indicators.
Page 4 of 8

3. Functional Requirements

  • As a Trader, I should be able to configure strategy parameters including EMA periods, RSI period and bounds, ATR period, trend-only entries, risk percentage, ATR-based take-profit and stop-loss multipliers, maximum hold bars, cooldown bars, and slippage. (explicit)
  • As a Trader, I should be able to manage risk-based position sizing from account balance and stop-loss distance, with symbol minimum and maximum lot limits. (explicit)
  • As a Trader, I should be able to monitor one open position per symbol, enforce cooldown between trades, and manage ATR-based stop loss and take profit, and maximum-hold-bar position closure. (explicit)
  • As a Trader, I should be able to display or manage the strategy's signals, indicator configuration, risk settings, positions, and trade results in the app. (explicit)
  • As a Trader, I should be required to test on a demo account before any live use. (explicit)
  • As a Trader, I should be able to self-enroll and subsequently return through Login. (required_inference)
  • As a Trader, I should be able to verify demo-account readiness before live-use controls are enabled. (required_inference)
  • As a Trader, I should be able to find and correct invalid configuration, broker, account, indicator, sizing, and execution-readiness conditions before trading. (required_inference)

4. User Personas

Trader

  • Product Context: Configures and monitors the ScalpRush trading strategy using the mobile app.
  • Primary Goal: To effectively manage and execute automated trading strategies with risk controls.
  • Distinct Responsibilities: Configures strategy parameters, reviews signals, monitors trade activity, and ensures demo testing before live trading.
  • Interactions: Engages with the app to adjust settings, monitor trades, and analyze signals.
  • Observable Success: Successful configuration and execution of trading strategies with adherence to risk management protocols.
Page 5 of 8

5. Core User Flows

  1. Trader Configures Strategy Parameters

    • Start: Trader accesses the Settings page.
    • Action: Trader inputs desired strategy parameters.
    • Result: Parameters are saved and validated.
    • Next Step: Trader can proceed to monitor signals or trades.
  2. Trader Monitors Signals

    • Start: Trader navigates to the Signals page.
    • Action: Trader reviews generated signals and conditions.
    • Result: Signals are displayed with detailed conditions.
    • Next Step: Trader decides on potential trade actions.
  3. Trader Monitors Positions

    • Start: Trader accesses the Positions page.
    • Action: Trader reviews open positions and enforcement rules.
    • Result: Position details are displayed with status.
    • Next Step: Trader can close positions or adjust strategy.
  4. Trader Reviews Trade History

    • Start: Trader navigates to the Trade History page.
    • Action: Trader browses historical trade data.
    • Result: Trade outcomes and broker messages are displayed.
    • Next Step: Trader analyzes past performance for insights.
  5. Trader Runs Diagnostics

    • Start: Trader accesses the Diagnostics page.
    • Action: Trader runs diagnostic checks.
    • Result: Configuration and readiness issues are identified.
    • Next Step: Trader corrects issues before trading.
  6. Trader Monitors Demo Account

    • Start: Trader accesses the Demo Monitor page.
    • Action: Trader confirms demo account operation.
    • Result: Demo account status is displayed.
    • Next Step: Trader ensures readiness for live trading.
Page 6 of 8

6. Visuals Colors and Theme

  • Muse: Gleb Kuznetsov
  • Palette:
    • Background: #000022
    • Surface: #0A0A1A
    • Text: #FFFFFF
    • Primary: #1A76D2
    • Accent: #FF4081
    • Muted: #555566
  • Typography:
    • Headings: Orbitron (Wide, uppercase, techno, high contrast)
    • Body: Space Grotesk
    • Scale: 1.5 modular (64/42/28/18/14)
  • Shape Language: Floating glass panels, thin luminous strokes, radial layouts
  • Layout: Full-bleed 3D scene, HUD-style data overlays, clear visual hierarchy
  • Motion: Continuous slow orbit/parallax, light sweeps, data streams

7. Signature Design Concept

The public entry will feature a full-bleed 3D holographic scene with floating data panels. Electric cyan and violet glows will accentuate key elements against a deep navy background, creating an immersive high-tech command center look. The design will emphasize the advanced, precise, and innovative aspects of the trading app.

Page 7 of 8

8. Interaction Model & Motion Direction

  • Interaction Model: Animated
  • Motion Tempo: Cinematic
  • Hero Dimensionality: WebGL
  • Landing Hero Motion Brief:
    • Focal Subject: A 3D holographic representation of trading data.
    • Input→Transformation→Outcome: User inputs strategy parameters, which transform into dynamic data visualizations, resulting in an immersive trading dashboard.
    • Motion Vocabulary: Continuous slow orbit/parallax, light sweeps.
    • Composed First Frame: A striking 3D scene with floating panels.
    • Reduced-Motion State: Simplified static view with essential data.

9. Non-Functional Requirements

  • Performance: The app must handle real-time data updates and maintain responsiveness.
  • Security: User authentication and data protection are mandatory.
  • Usability: The interface should be intuitive for tech-savvy traders.
  • Reliability: The app must ensure accurate execution of trades and persistence of data.

10. Tech Stack

  • Frontend: React Native
  • Backend: Python/FastAPI
  • Storage: Appropriate database solution for persistence
  • Deployment: Docker/docker-compose, Kubernetes (if required)
Page 8 of 8

11. Assumptions and Constraints

  • Assumption: Traders are familiar with algorithmic trading concepts.
  • Constraint: Demo-account testing is required before live use.
  • Constraint: The strategy permits no more than one open position per symbol.
  • Constraint: Trades must observe the configured cooldown between trades.

12. Glossary

  • EMA: Exponential Moving Average
  • RSI: Relative Strength Index
  • ATR: Average True Range
  • Demo Account: A practice account used to test trading strategies without financial risk.

No completed page designs yet.

Completed design pages will appear here when they are ready to preview.

Landing: View strategy intro
Login: Self-enroll account
Login: Sign in
Dashboard: View strategy status
Settings: 1. Configure strategy parameters
Settings: 2. Save settings
Diagnostics: 3. Run diagnostics
Diagnostics: 4. View readiness issues
Demo Monitor: Confirm demo readiness
Dashboard: Start strategy
Signals: Review trading signals
Positions: View open positions
Positions: Close position
Trade History: Browse trade history
Trade History: Filter results
Dashboard: Stop strategy

No completed page designs yet.

Completed design pages will appear here when they are ready to preview.

Landing: View strategy intro
Login: Self-enroll account
Login: Sign in
Dashboard: View strategy status
Settings: 1. Configure strategy parameters
Settings: 2. Save settings
Diagnostics: 3. Run diagnostics
Diagnostics: 4. View readiness issues
Demo Monitor: Confirm demo readiness
Dashboard: Start strategy
Signals: Review trading signals
Positions: View open positions
Positions: Close position
Trade History: Browse trade history
Trade History: Filter results
Dashboard: Stop strategy