Polar Star EA
- Experts
-
Wei Tu
With a deep understanding of the foreign market, extensive experience in trading and developing quantitative trading systems, and a thorough understanding of financial markets, I am able to develop effective automated trading solutions by analyzing market data and continuously optimizing and - Version: 1.54
- Activations: 10
Polar Star is a multi-symbol nighttime trading EA for MT5. It seeks mean-reversion opportunities following short-term price deviations during a defined trading session, enters through pending orders, and automatically manages stop loss, take profit, and additional entries.
Run multiple currency pairs from a single chart. The default pairs are GBPUSD, USDCAD, AUDUSD, EURCHF, and EURUSD. You can also customize the symbol list in the settings.
How the Strategy Works
The EA uses moving averages and standard deviation to calculate pending order prices. A volatility filter identifies potential entry opportunities, and pending orders are placed when the trading conditions are met.
If the market moves against an open position, the EA can add grid positions at predefined intervals. It then adjusts the take-profit target based on the volume-weighted average entry price of positions in the same symbol and direction. Both grid spacing and the maximum number of additional entries are configurable. Set the maximum grid additions to 0 to disable grid entries.
Key Features
- Trade multiple currency pairs from a single chart with a customizable symbol list.
- Automated position management, including dynamic take profit and conditional exits.
- Automatic GMT detection and trading-session adjustment.
- Comprehensive risk-management settings.
Account Requirements
- Account type: Hedging
- Minimum account balance: USD 50
Trading Session and Position Management
The default entry window is 2 hours. You can adjust the session duration and the broker server GMT offset. The EA determines its trading session using server time and the GMT settings.
After the entry window closes, the EA cancels its remaining pending orders and continues managing open positions. It may also add grid positions if the relevant conditions are met. Keep the EA running while positions remain open.
Settings include dynamic take profit, closing a profitable basket outside the entry session, and a holding-time exit threshold. Positions are closed when the holding-time threshold is reached and the additional strategy conditions are satisfied.
Position Sizing and Risk Settings
- Choose fixed lots or automatic lot sizing based on account balance.
- Limit the number of symbols with simultaneous open positions. The default maximum is 4.
- Adjust stop loss, maximum take-profit distance, grid spacing, and the maximum number of grid additions.
- Set a floating-loss threshold. The default is 1.0, or 100%. This condition is based on account-wide equity relative to balance, so other trades in the same account also affect it.
Before You Start
- Enter the exact symbol names used by your broker, including any prefixes or suffixes, and confirm that the symbols are available for trading.
- Check your broker’s server time zone. For backtesting, enter the GMT offset manually.
- Choose lot sizes, the maximum number of concurrent symbols, and the grid limit according to your account size. Trading several symbols at once and adding grid positions both increase margin requirements.
- Backtest and test on a demo account with your own broker before live use. Keep the terminal connected and algorithmic trading enabled while the EA is running. The chart panel displays account information, positions, and trading status.
Parameter Guide
The names below match the English labels in the current input settings. true means enabled, and false means disabled. Points are units of the symbol’s quoted price precision; for standard 3- or 5-digit forex quotes, 1 pip = 10 points.
Symbols and Lot Sizing
- Symbols (comma-separated; empty = chart symbol): Enter the full symbol names, separated by commas. Leave this blank to use the current chart symbol.
- Maximum concurrent symbols: Set the maximum number of symbols that may have open positions at the same time.
- Lot sizing mode: Select FixedLot to use a fixed lot size, or AutoLot to calculate lot size from the account balance.
- Fixed lot size: Set the volume of each order when using FixedLot mode.
- Balance per lot: Set the amount of account balance allocated per 0.01 lot in AutoLot mode. Use a positive value. Increasing this value reduces the calculated lot size.
- Pending orders per entry: Set how many pending orders the EA attempts to place in each direction when entry conditions are met.
Entries, Take Profit, and Grid Positions
- Filter level (1 = extreme): Set the volatility-filter multiplier. Smaller positive values apply stricter filtering; larger values make the filter less restrictive.
- Maximum take profit (points): Set the upper-limit parameter used in the initial take-profit calculation. This also determines the take-profit distance from the volume-weighted average entry price after grid positions are added.
- Enable dynamic take profit: Enable strategy-based adjustments to position take-profit levels and pending order prices.
- Stop loss (points): Set the stop-loss distance from the entry price when an order is placed.
- Maximum slippage (points): Set the permitted price deviation for trade requests. Increasing this value allows greater price deviation.
- Grid spacing (pips): Set the adverse price movement required before adding a position, measured from the most recent position in the same direction. Increasing this value places grid entries farther apart.
- Maximum grid additions: Limit additional entries based on the current number of open positions in the same symbol and direction. The position limit is this value plus one. Set it to 0 to disable grid additions.
- Floating loss threshold (1.0 = 100%): Set the floating-loss trigger as a proportion of account balance, using account-wide equity and balance. For example, 0.2 means 20%. A lower value triggers the EA’s position closures and pending-order cancellations sooner.
- Close profitable basket after session: When enabled, the EA closes its positions outside the entry window if account-wide equity is equal to or greater than the account balance.
Time Settings
- Broker server GMT offset: Enter your broker server’s offset from GMT in hours. For example, enter 2 for GMT+2. This value is used for manual time-zone calculations and backtesting.
- Detect server GMT automatically: In the current implementation, automatic detection is used in the live-trading daylight-saving-time branch. When disabled, or during backtesting, the manual GMT setting is used.
- Entry session duration (hours): Set the length of the entry window in hours. Increasing this value extends the window. The code reserves the final 5 minutes of the window and applies a weekend extension on Fridays.
- Holding-time exit threshold (hours; conditional): Set the holding-time threshold in hours. A lower value brings forward the conditional exit check. Positions are closed only when the price conditions are also met. Friday positions receive separate weekend handling.
- Allow Friday entries: Enable initial entries on Fridays. When disabled, the EA skips new initial entries on Fridays but continues managing existing positions.
- Pause entries during year-end holidays: When enabled, the EA pauses initial entries from December 15 through January 15. Disable it to remove this date filter.
Identification and Panel
- Magic number: Set the identifier the EA uses to recognize and manage its orders. Use different values when separate strategy instances need to be distinguished.
- Order comment: Set the order comment. Grid entries append “grid” to this text.
- Show information panel: Show or hide the information panel on regular charts. The panel remains hidden in the Strategy Tester.
- Panel opacity (0-255): Set the panel background opacity. 0 is fully transparent, and 255 is fully opaque. Higher values make the background more solid.
Risk Disclosure
Nighttime spreads, slippage, commissions, swap charges, and actual execution conditions all affect trading results.
PolarStar uses grid entries that add positions as the market moves against existing trades. Prolonged one-directional moves may cause substantial losses.
