HomeSample Page

Sample Page Title


Product URL : https://www.mql5.com/en/market/product/165363

 Overview

The EX5 Sign Copier Library converts MT5 commerce occasions into structured alerts.
Your EA reads these alerts 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

  1. Copy library:

/MQL5/Libraries/EX5_Copier.ex5

  1. Embrace in your EA:

#import “..LibrariesEX5_Copier.ex5”

  1. Connect EA to chart

Initialization

Name in OnInit() :

   SCL_Init(
   sourceMagic,
   sourceSymbol,
   enableCopy,
   copyMagic,
   lotMultiplier,
   slippage,
   logToFile,
   printToExperts,
   verboseMode
);

Parameters

ParameterDescription
sourceMagicFilter trades by magic (0 = all)
sourceSymbolFilter image (“” = all)
enableCopyAllow built-in copier
copyMagicMagic quantity for copied trades
lotMultiplierLot scaling
slippageAllowed slippage
verboseModeDebug logs

Occasion Dealing with

It’s essential to ahead commerce occasions:

 void OnTradeTransaction(...) { SCL_OnTradeTransaction(trans, request, consequence); } 

Polling (Backup)

 void OnTimer() { SCL_Poll(); } 

Studying Indicators

 whereas(SCL_GetSignalCount() > 0) { SCL_ReadSignal(...); } 

Sign Fields

SubjectWhich means
motionBUY / SELL / CLOSE
event_typeOPEN / MODIFY
imageInstrument
quantityLot dimension
worthEntry worth
sl / tpCease loss / Take revenue
ticketPlace ID

Actions

MotionWhich means
SCL_ACTION_BUYPurchase place
SCL_ACTION_SELLPromote place
SCL_ACTION_CLOSE_POSITIONShut
SCL_ACTION_MODIFY_POSITIONSL/TP change
SCL_ACTION_PARTIAL_CLOSEPartial shut

 EXAMPLES


Instance 1 — Easy Copier


Instance 2 — Reverse Buying and selling


Instance 3 — Threat Administration

 if(quantity > 1.0) quantity = 1.0; SCL_CopyBuy(image, quantity, sl, tp, "RiskManaged"); 

Instance 4 — Filter by SL/TP


Instance 5 — Ship to Exterior API (Binance)


        if(motion == SCL_ACTION_BUY)
{
   orderMarket("BUY", image, quantity, worth);
}


Instance 6 — Restrict Orders


Instance 7 — Shut Sync

 if(motion == SCL_ACTION_CLOSE_POSITION) { CloseExternalTrade(ticket); } 

Utility Capabilities


 Cleanup


 Finest Practices


 Debugging

Allow:


 Superior Use Instances

Demo Script with examples hooked up

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles