FX Tiger trading Expert Advisor
(All Rights Reserved)
Background:
Meta Trader is a globally popular trading platform enables users to trade Forex, Stocks & Futures, Indices, Commodities, and Cryptocurrencies. Meta Trader 4 and 5 are both available on Windows, Android, and iOs systems.
MetaTrader is a powerhouse in the world of trading platforms, designed to provide traders with a comprehensive suite of tools for analyzing financial markets and executing trades. With its intuitive interface, robust charting capabilities, and support for automated trading through Expert Advisors (EAs), MetaTrader caters to both novice and seasoned traders.
Meta Trader 4 and 5 platform offers the option to install custom forex Expert Advisors (Autonomous Robots), Scripts, and Indicators. This allows retail forex traders to deploy custom developed software to identify and execute trading opportunities. However, currently there is no reliable SW that will trade (scalping method) with 5 to 10 PIPs margin. Traders should have the opportunity to automate orders using a preset Long or Short order.
The shortage of a simple effective scalping robots for MetaTrader 4 (MT4) and MetaTrader 5 (MT5) has created a significant demand among traders. Scalping, a strategy that involves making numerous trades for small profits within a short timeframe, requires precise and fast-executing tools. However, finding a reliable scalping robot that can consistently perform well in varying market conditions has become increasingly challenging. This scarcity has led traders to seek out high-quality scalping robots that can enhance their trading efficiency and profitability
High level process flow:
Prototype/Demo:
High Level Business Requirements:
Platform:
1) The EA will be deployed on Production MS Win 10/11 MT4 and/or MT5 trading platform (chart) in conjunction with any major forex broker, mainly Oanda.
2) The EA shall also be operational on cloud-based Production Virtual Private Server or Virtual Machines.
Initiating\activating the EA: How the EA is in activated
· The EA .exe file will be uploaded to
o MT4> File > Open Data folder MQL4> Experts (Folder)
· DLL files to be uploaded to
o MT4> MQL4> Libraries (Folder)
· EA user will be authenticated by entering url in,
o MT4> Tools> Options> Experts > Allow WebRequest for
· The user will be authenticated by the user name in the resource located in the url.
Autonomous Capability:
3) The EA will be autonomous in trade engagement.
4) The EA will determine trade Entry and Exit point on long and short positions using industry standard technologies.
5) The EA shall trigger an alert by pop up prompt or SMS message about a trading opportunity.
6) The EA will trigger an alert after three consecutive Stop/Loss activation.
Data Processing:
7) The EA shall have the capability to extract chart data from past 30 to 60 various time frame periods.
8) The EA will employ statistical tools such as Exponential Moving Average (EMA), MACD, and/or Stochastic RSI indicators.
9) to process the chart data
Trading Time:
10) The EA will trade from Sunday 5 PM EST to Friday 5 PM EST
11) Any trading long or short position not closed by Friday 5 PM EST ( weekly forex trading Closing time) shall be carried to Sunday 5 PM EST ( weekly forex opening session)
Transaction Records or Journal: ( Nice to have))
12) Each trade shall record data processed for that trade including
a. Order #,
b. Time of execution
c. Chart data considered.
d. Any other pertaining data.
13) This data shall be exported as a CSV file.
Non-functional requirements:
14)
System Functional Requirements
Features:
Authentication:
· Authenticate user with FX Tiger Auth.
· Handle authentication requests and responses.
Chart Attachment:
· Attach the EA to the desired trading chart.
Data Retrieval:
· Retrieve chart data, including market price and historical data.
Indicator Calculation:
· Calculate technical indicators based on the retrieved data
§ Exponential Moving Averages ( Indicator 1)
§ Indicator 2
§ Expert Advisor
Order Generation:
· Determine whether a new order is needed based on the,
§ Calculated indicators
§ Predefined trading rules.
Create buy or sell orders with specified parameters
§ Entry price,
§ Stop-loss,
§ Take-profit
Order Management:
§ Monitor open orders for,
§ Stop-loss
§ Take-profit
§ Close orders manually if necessary.
Additional Features
Risk Management:
§ Implement risk management strategies,
§ Position sizing
§ Stop-loss limits, and
§ Maximum loss per trade.
Backtesting:
Allow for backtesting the EA's performance on historical data to evaluate its effectiveness.
Optimization:
Provide options for optimizing the EA's parameters to find the best settings for a given trading strategy.
Alert Notifications:
Send alerts or notifications when specific events occur, such as order placement, execution, or stop-loss/take-profit triggers.
Customizable Trading Rules:
Allow users to customize trading rules and strategies to suit their individual preferences.
Integration with Other Platforms:
Integrate with other trading platforms or tools for additional functionalities (e.g., portfolio management, data analysis).
User Stories:
User Story 1: Authenticate User
As a forex trader, I want to authenticate my account using FX Tiger Auth in MT4 via a web/API request to the FX Tiger site, So that I can securely access my trading account and manage my trades.
Acceptance Criteria:
The user initiates the authentication process in MT4.
The system sends a web/API request to the FX Tiger site for authentication.
The system receives a response from the FX Tiger site confirming successful authentication.
The user gains access to their EA for trading account in MT4.
User Story 2: Handle Authentication Requests
As a system administrator, I want to handle authentication requests from MT4 to the FX Tiger site, So that I can ensure users are securely authenticated before accessing their trading accounts.
Acceptance Criteria:
The system receives authentication requests from MT4.
The system validates the authentication credentials via the FX Tiger site.
The system sends a response back to MT4 with the authentication status.
The system logs all authentication attempts for audit purposes.
User Story 3: Handle Authentication Responses
As a forex trader, I want to receive clear and immediate feedback on my authentication status, So that I know whether I can proceed to access my trading account or need to reattempt authentication.
Acceptance Criteria:
The system sends authentication responses to the user's MT4 platform.
The user receives a confirmation message for successful authentication.
The user receives an error message for failed authentication attempts, with details on the failure reason.
The system provides guidance on how to reattempt authentication if needed.
User Story 4: Attach Expert Advisor to Trading Chart
As a forex trader, I want to attach the Expert Advisor (EA) to my desired trading chart, So that I can automate my trading strategy and improve my trading efficiency.
Acceptance Criteria:
The user selects the desired trading chart in MT4.
The user attaches the EA to the selected chart.
The EA is successfully attached and ready for configuration.
User Story 5: EA Trade setting configuration
As a forex trader, I want to configure the EA to set the trade setting values of long/short positions, equity size, lot size, profit taking, stop-loss, magic number, simultaneous trading So that I can tailor the EA to my trading strategy and market conditions.
Acceptance Criteria:
The user opens the EA settings window.
The user selects whether to allow long, short, or both types of positions.
3. The user enters the desired lot size.
4. The user enters the desired equity size.
The user enters the desired profit-taking level.
The user enters the desired stop-loss level.
The magic number is pre-populated
The EA saves and applies the simultaneous trading settings
The EA saves and applies the position settings.
User Story 6: EA Filter Configuration: Variable EMA 1
As a forex trader, I want to configure the period for the first Exponential Moving Average (EMA 1) in the EA Filter settings, So that I can tailor the EA to my specific trading strategy.
Acceptance Criteria:
The user opens the EA settings window.
The user locates the configuration option for EMA 1.
The user enters the desired period for EMA 1.
The EA saves and applies the entered period for EMA 1.
User Story 7: : EA Filter Configuration: Variable EMA 2
As a forex trader, I want to configure the period for the second Exponential Moving Average (EMA 2) in the EA Filter settings, So that I can further customize the EA to fit my trading strategy.
Acceptance Criteria:
The user opens the EA settings window.
The user locates the configuration option for EMA 2.
The user enters the desired period for EMA 2.
The EA saves and applies the entered period for EMA 2.
User Story 8: Configure Predefined Trading Rules
As a forex trader, I want to configure the predefined trading rules in the system, So that I can customize the trading strategy according to my preferences and risk management plan.
Acceptance Criteria:
The user accesses the trading rules configuration settings.
The user sets parameters such as maximum risk per trade, allowed trading hours, and entry/exit criteria.
The system saves and applies the configured trading rules.
User Story 9: Validate Trade Orders Against Predefined Rules
As a trader, I want the system to validate trade orders against predefined trading rules, So that only valid and compliant orders are executed.
Acceptance Criteria:
The system checks each generated trade order against predefined trading rules (e.g., maximum risk per trade, trade timing restrictions).
Invalid orders are flagged and not executed.
User Story 10: Generate Buy Order Based on Calculated Indicators
As a forex trader, I want the system to generate a buy order based on calculated indicators, So that I can capitalize on potential upward market movements.
Acceptance Criteria:
The system calculates indicators (e.g., moving averages, RSI, MACD) based on current market data.
Exponential Moving Average (EMA) parameter.
Relative Strength Index (RSI) parameter
Moving Average Convergence and Divergence (MACD) parameter
When the indicators meet predefined buy conditions
Short EMA crosses over Long EMA
RSI crosses over the Simple Moving Average the system generates a buy order.
The buy order includes details such as currency pair, lot size, entry price, stop loss, and take profit levels.
The buy order is executed automatically in the trading platform.
User Story 11: The Buy (Long Position) Order is displayed on MT4 Terminal "Trade Tab"
As a trader, I want to see a buy order displayed on my MT4 terminal "Trade Tab" , So that I can confirm that the order has been executed successfully.
Acceptance Criteria:
A new buy order with the correct parameters (symbol, volume, price, stop-loss, take-profit) is visible in the "Trade" tab of the MT4 terminal.
The order status is displayed as "Pending" or "Filled" as appropriate.
The order's ticket number is unique and can be used to identify the order.
The order's parameters (symbol, volume, price, stop-loss, take-profit) match the values specified in the trading system.
The buy order can be closed or completed from the "Trade" tab.
User Story 12: Generate Sell Order Based on Calculated Indicators
As a forex trader, I want the system to generate a sell order based on calculated indicators, So that I can take advantage of potential downward market movements.
Acceptance Criteria:
The system calculates indicators based on current market data.
Exponential Moving Average (EMA) parameter.
Relative Strength Index (RSI) parameter
Moving Average Convergence and Divergence (MACD) parameter
When the indicators meet predefined buy conditions
Short EMA crosses under Long EMA
RSI crosses under the Simple Moving Average the system generates a buy order.
The sell order is executed automatically in the trading platform.
User Story 13: The Sell Order is displayed on MT4 Terminal "Trade Tab"
As a trader, I want to see a buy order displayed on my MT4 terminal "Trade Tab" , So that I can confirm that the order has been executed successfully.
Acceptance Criteria:
A new sell order with the correct parameters
symbol, volume, price, stop-loss, take-profit) is visible in the "Trade" tab of the MT4 terminal.
The order status is displayed as "Pending" or "Filled" as appropriate.
The order's ticket number is unique and can be used to identify the order.
The order's parameters (symbol, volume, price, stop-loss, take-profit) match the values specified in the trading system.
The sell order can be closed or completed from the "Trade" tab.
User Story 14: Monitor and Adjust Trade Orders
As a forex trader, I want to monitor and adjust generated trade orders, So that I can ensure they align with my trading strategy and market conditions.
Acceptance Criteria:
The user accesses a dashboard displaying all active and pending trade orders.
The user can modify parameters such as entry price, stop loss, and take profit levels.
The system updates and executes the modified orders accordingly.
The system logs all modifications for audit purposes.
User Story 15: FIFO Rule Compliance
As a trader I want to open a trade and close or complete that trade only So that I am compliant with the broker FIFO rules.
Acceptance Criteria:
· The EA did not generate any new order when one order is open state either by the EA or manually by user.
· The EA logs all order open and close data for audit purpose.
· If the user opens a new order when an order is already opened by the EA, then the EA must close its order first for FIFO compliance.
User Story 16: Manually Close Trade Orders
As a trader, I want to be able to manually close trade orders opened by the trading EA (robot), So that I can intervene in the trading process and manage risk.
Acceptance Criteria:
The user can select an open trade order from the "Trade" tab in the MT4 terminal.
The user can choose to close the position.
The system should allow the user to close the trade at the current market price.
The system should provide confirmation before closing the trade.
The system should update the “Account History” and trading journal to reflect the closed trade, including the closing price, profit/loss, and other relevant details.
The system should notify the user of the successful closure of the trade.
Any comment on order generation and management ?
This is work in progress !!