Aligators
- エキスパート
- Dzintars Ansons
- バージョン: 1.0
- アクティベーション: 5
Aligator: Strategy and Operation Description
Overview
The trading robot "Aligators" is designed to automate trading operations based on technical analysis, using the Alligator and ATR indicators. This Expert Advisor ensures disciplined trading within predefined time sessions, managing risks through calculated lot sizes and automated position management including trailing stops. The advisor "Aligators" has successfully passed testing and verification in the prop company FTMO.COM ,this is evidenced by the OR code in the screenshot. (hint: mid-term Swing trading on TF H4)
FTMO is a project that seeks experienced clients with trading experience to determine whether the client has all the necessary qualities. FTMO has developed a two-stage assessment process, which consists of the FTMO Challenge and Verification stages. After successfully passing the assessment process, the client can be granted access to an FTMO account from which he or she can receive a reward of up to 90% of their profits.
Input Parameters
-
RiskPercent: Percentage of account balance risked per trade.
-
FixedLots: Fixed lot size, used if not employing RiskPercent.
-
ATRPeriod: Period for the ATR indicator.
-
StopLoss: Stop Loss in ATR units.
-
TakeProfit: Take Profit in ATR units.
-
TrailingStop: Trailing Stop in ATR units.
-
StartHour: Hour to start trading (terminal time).
-
StartMinute: Minute to start trading.
-
EndHour: Hour to stop trading.
-
EndMinute: Minute to stop trading.
-
SessionControl: Enable or disable session control for trading.
-
Slippage: Maximum allowed slippage in points.
-
Magic: Unique identifier for orders to distinguish them from others.
Initialization:
-
Lot Size Calculation:
-
Calculate Lots based on RiskPercent,
-
Ensure Lots is within the minimum and maximum allowed lot sizes for the trading instrument.
-
Main Function:
-
ATR Calculation:
-
Calculate the ATR value to determine volatility.
-
-
Session Control:
-
Check if the current time is within the specified trading session. Trade only within this time frame if SessionControl is enabled.
-
-
Open Position Check:
-
If no open positions, evaluate conditions to open new ones using CheckForOpen .
-
-
Trailing Stop Update:
-
Update trailing stop for open positions based on the ATR value.
-
-
Position Management:
-
Close all positions when the trading session ends if SessionControl is enabled.
-
Conditions for opening positions using the Alligator indicator:
-
Sell Conditions:
-
The opening price of the previous candle is above the first moving average.
-
The closing price of the previous candle is below the first moving average.
-
The moving averages are in descending order (lips < teeth < jaw).
-
-
Buy Conditions:
-
The opening price of the previous candle is below the first moving average.
-
The closing price of the previous candle is above the first moving average.
-
The moving averages are in ascending order (lips > teeth > jaw).
-
Open Order:
-
Calculate the stop loss and take profit levels based on the ATR value.
-
Ensure there is sufficient free margin before placing the order.
-
Place the buy or sell order with the calculated lot size, stop loss, and take profit.
Trailing Stop Update:
-
Adjust the stop loss for open positions to lock in profits as the price moves favorably.
-
Move the stop loss to a new level based on the ATR value.
Close All Positions:
-
Close all open positions outside the trading session time or if specified conditions are met.
This detailed strategy ensures disciplined trading with clear rules for opening and managing trades, leveraging technical indicators to make informed decisions. Risk management is tightly controlled through configurable lot sizes and automatic position adjustments, providing a robust framework for automated trading.