Product URL : https://www.mql5.com/en/market/product/165363
Overview
The EX5 Sign Copier Library converts MT5 commerce occasions into structured indicators.
Your EA reads these indicators and decides what to do.
Structure
Commerce happens ↓ OnTradeTransaction() ↓ Library processes occasion ↓ Sign added to queue ↓ Your EA reads sign ↓ You execute logic
Set up
-
Copy library:
/MQL5/Libraries/EX5_Copy.ex5
-
Embrace in your EA:
#import “..LibrariesEX5_Copier.ex5”
-
Connect EA to chart
Initialization
Name in OnInit() :
SCL_Init( sourceMagic, sourceSymbol, enableCopy, copyMagic, lotMultiplier, slippage, logToFile, printToExperts, verboseMode );
Parameters
| Parameter | Description |
|---|---|
| sourceMagic | Filter trades by magic (0 = all) |
| sourceSymbol | Filter image (“” = all) |
| enableCopy | Allow built-in copier |
| copyMagic | Magic quantity for copied trades |
| lotMultiplier | Lot scaling |
| slippage | Allowed slippage |
| verboseMode | Debug logs |
Occasion Dealing with
You could ahead commerce occasions:
void OnTradeTransaction(...) { SCL_OnTradeTransaction(trans, request, consequence); }
Polling (Backup)
void OnTimer() { SCL_Poll(); }
Studying Alerts
whereas(SCL_GetSignalCount() > 0) { SCL_ReadSignal(...); }
Sign Fields
| Subject | That means |
|---|---|
| motion | BUY / SELL / CLOSE |
| event_type | OPEN / MODIFY |
| image | Instrument |
| quantity | Lot dimension |
| value | Entry value |
| sl / tp | Cease loss / Take revenue |
| ticket | Place ID |
Actions
| Motion | That means |
|---|---|
| SCL_ACTION_BUY | Purchase place |
| SCL_ACTION_SELL | Promote place |
| SCL_ACTION_CLOSE_POSITION | Shut |
| SCL_ACTION_MODIFY_POSITION | SL/TP change |
| SCL_ACTION_PARTIAL_CLOSE | Partial shut |
Instance 1 — Easy Copier
if(motion == SCL_ACTION_BUY) { SCL_CopyBuy(image, quantity, sl, tp, "Copy"); } if(motion == SCL_ACTION_SELL) { SCL_CopySell(image, quantity, sl, tp, "Copy"); }
Instance 2 — Reverse Buying and selling
if(motion == SCL_ACTION_BUY) { SCL_CopySell(image, quantity, tp, sl, "Reverse"); }
Instance 3 — Danger Administration
if(quantity > 1.0) quantity = 1.0; SCL_CopyBuy(image, quantity, sl, tp, "RiskManaged");
Instance 4 — Filter by SL/TP
if(sl == 0 || tp == 0) return;
Instance 5 — Ship to Exterior API (Binance)
if(motion == SCL_ACTION_BUY)
{
orderMarket("BUY", image, quantity, value);
}
Instance 6 — Restrict Orders
if(motion == SCL_ACTION_BUY_LIMIT) { PlaceLimit(image, quantity, value); }
Instance 7 — Shut Sync
if(motion == SCL_ACTION_CLOSE_POSITION) { CloseExternalTrade(ticket); }
Utility Capabilities
SCL_GetActiveOrderCount(); SCL_GetActivePositionCount(); SCL_GetMappingCount();
Cleanup
void OnDeinit() { SCL_Deinit(); }
Finest Practices
-
All the time name SCL_OnTradeTransaction
-
Use polling as backup
-
Course of indicators in loop
-
Keep away from heavy logic inside loop
-
Allow verbose mode for debugging
Debugging
Allow:
Inp_VerboseMode = true; Inp_PrintToExperts = true;
Superior Use Instances
-
Multi-account copier
-
Hedging methods
-
Grid replication
-
Commerce journaling
-
Prop agency trackers
-
MT5 → Crypto bridge
Demo Script with examples connected