Files
conversation-history/Trading/MT5/OrdersEA Smart Grid v3.4 Cheatsheet.md

1.4 KiB

OrdersEA Smart Grid v3.4 — Quick Reference

The Bug (v3.3)

GetOut, OpenNewTrades, and Master were declared as inputs but never used in the trading logic. The EA placed grids regardless of settings.

What's Fixed in v3.4

GetOut — Close & Block

Value Action
"N" Normal trading
"A" / "X" Close ALL positions + cancel orders + block new grids
"L" Close longs only, block new buy grids
"S" Close shorts only, block new sell grids

OpenNewTrades — Direction Control

Value Action
"Y" Allow both directions
"L" Buy limits only
"S" Sell limits only
"N" Block all new grids

Master — Emergency Kill Switch

Value Scope
false Per-symbol only (safe to share MagicNum 333 across charts)
true Global — closes ALL OrdersEA positions/orders across ALL symbols. Does NOT touch other algorithms (e.g., MultiSignal 777777).

When to Use What

  • Normal trading → Master=false, GetOut="N", OpenNewTrades="Y"
  • Stop one symbol → GetOut="A" on that chart
  • Emergency stop everything → Master=true on any OrdersEA chart
  • No new trades → OpenNewTrades="N"
  • Only shorts → OpenNewTrades="S"

Key Code Changes

Added HandleGetOut(), GlobalShutdown(), validation in OnInit(), and guards in OnTick() before grid placement.