Pipsgrowth EX16093 Trend
MT5 Expert Advisor (Open Source) · XAUUSD · M5, H1
Pipsgrowth.com EX16093 ChartInChart — chart-in-chart utility, full 12-layer stack.
Overview
Pipsgrowth EX16093 is not a strategy Expert Advisor. The .mq5 ships without a single OnTick handler, without a single indicator handle, and without any code path that ever submits a market order, places a pending stop, or modifies an open position. What it does is build a fully interactive picture-in-picture sub-chart on top of whichever symbol you load it against — eight named chart objects, five toggle buttons, two editable text fields, and a working OBJ_CHART widget that mirrors a second symbol/timeframe of your choice onto the same window. The tool belongs on the analyst's chart, not on the execution account.
The control surface is anchored by two OBJ_EDIT fields, PIPSymbol and PIPPeriod, drawn in the top-left corner of the host chart. By default they inherit whatever symbol the EA was attached to and whatever period that chart is running on — PIPSetParams() snapshots Symbol() and Period() into curr_symbol and curr_period on OnInit, then PeriodToStr() converts the period enum to its short code ("M5", "H1", "D1", "W1", "MN1") so it can be displayed back to the user. Click the symbol box, type any ticker your broker offers — "EURUSD", "XAUUSD", "US100", "BTCUSD" — and on the OBJECT_ENDEDIT event OnChartEvent reads the new string with ObjectGetString, writes it onto the chart object's OBJPROP_SYMBOL, then re-reads the chart object to confirm the broker accepted the symbol. Whatever you typed gets echoed back into the text field, so a typo is immediately visible. The period field works the same way: type "M15" or "H4" or "240" and OnChartEvent pipes the string through StrToPeriod(), a 30-branch dispatch that maps every textual or numeric code MQL5 understands to its ENUM_TIMEFRAMES constant. If the string does not parse, the function returns false and the previous period is left untouched — there is no error message, the chart simply does not change.
Five OBJ_BUTTON objects sit to the right of the period field, each 18 pixels tall in Arial 10pt on a steel-blue background that matches the text fields. The first two are toggles: PIPDatesButton flips the sub-chart's date axis on and off (the boolean state is read with ObjectGetInteger(OBJPROP_STATE) and written through to OBJPROP_DATE_SCALE), and PIPPricesButton does the same for the price scale. The next two are a zoom pair: PIPPlusButton increments the local scale variable (capped at 5) and pushes it into OBJPROP_CHART_SCALE; PIPMinusButton decrements it (floor 0). Each click also forces the button's own state back to 0 because the state field is only being used as a click counter, not a held state. The fifth button, PIPHideButton, collapses the embedded chart — PIPHideChart() sets the chart's x/y to -1 and both dimensions to 0, effectively moving it off-canvas. A second click restores it: show = 1 - show flips the local flag, and PIPSetParams() runs again with the saved xdist/ydist/xsize/ysize so the sub-chart pops back exactly where it was. The label of the hide button is just an underscore "_" — minimum visual footprint.
All eight objects are created in PIPCreate() during OnInit, parameterised in PIPSetParams(), and removed wholesale by PIPDelete() inside OnDeinit. Sizes are clamped to a minimum of 250x100 in case the user inputs nonsense, and the position is taken straight from the XPosition/YPosition inputs (default 10,10). The control strip is 20 pixels tall; the chart itself is laid out 20 pixels below it, occupying the full XSize x YSize rectangle (default 450x300). The only visual constants you can recolor are TextColor (default clrWhite) and BGColor (default clrSteelBlue) — both feed the OBJPROP_COLOR and OBJPROP_BGCOLOR of every label, button, and edit field so the toolbar reads as a single consistent strip.
Because nothing in the runtime fires on tick, there is no risk model, no order wrapper, no position tracking, and no magic-number discipline to speak of. The InpMagicNumber = 22216093 and InpTradeComment = "Psgrowth.com Expert_16093" inputs are declared in the standard === Identity === group so the file conforms to the EA header schema used across the PipsGrowth catalogue, but they are never read by any function in the .mq5. The three retry helpers TryClose_EX16093, TryClosePartial_EX16093, and TryModify_EX16093 are scaffolded against requote/timeout/price-change conditions the same way as the rest of the catalogue, but they are also never invoked from the runtime — the EA does not place orders, so it has nothing to close, nothing to partially close, and nothing to modify. The #include <Trade\Trade.mqh> import is there only because the retry helpers reference the CTrade class.
Practically, the EA is a multi-timeframe context gadget. Attach it to your trading chart, change the symbol field to the correlated instrument you want to watch (DXY under your EURUSD chart, US10Y under NAS100, gold under silver), and resize the window corner so the sub-chart fills the dead space above your indicators. The period field lets you put a higher-timeframe view inside a lower-timeframe trading chart without alt-tabbing — common workflow: trading on M5 with an H1 context chart embedded, or running a daily bias view inside a 30-minute execution chart. The dates/prices scale toggles and the +/- zoom buttons give you quick visual tuning without leaving the keyboard. The hide button clears the screen instantly when you want to see the underlying chart unobstructed, and restores it with the same dimensions when you click again. Because the EA never opens positions, it can sit on a demo or live account, on a cent account or a prop-firm challenge account, with no risk of accidental execution — and because OnTick is empty, CPU and broker-tick load are effectively zero.
Strategy Deep Dive
PIPCreate() builds eight named chart objects on OnInit — two OBJ_EDIT fields for the symbol and period string, five OBJ_BUTTON toggles for dates/prices/zoom/hide, and one OBJ_CHART sub-widget. PIPSetParams() then stamps positions, sizes, colors, and the OBJPROP_SYMBOL/PERIOD/CHART_SCALE properties onto every object using the values typed into the XPosition/YPosition/XSize/YSize inputs and the colors TextColor/BGColor. OnChartEvent listens for OBJECT_ENDEDIT on the two text fields and reads the new string with ObjectGetString, then writes it into the chart object's OBJPROP_SYMBOL (or parses it through StrToPeriod and pushes the ENUM_TIMEFRAMES into OBJPROP_PERIOD), before calling ChartRedraw(). The five buttons each fire on CHARTEVENT_OBJECT_CLICK: the dates and prices toggles flip the OBJPROP_DATE_SCALE and OBJPROP_PRICE_SCALE booleans, the +/- buttons increment or decrement a local scale integer (clamped 0..5) and push it into OBJPROP_CHART_SCALE, and the hide button either calls PIPHideChart() (which moves the sub-chart off-canvas at -1,-1 with zero size) or runs PIPSetParams() again to restore it. OnDeinit calls PIPDelete() to remove every named object so nothing is left orphaned on the chart when the EA is removed.
This EA is a visual chart-in-picture utility and does not contain any entry logic. There is no OnTick handler, no indicator stack, and no code path that ever submits a market order, places a pending stop, or activates a limit. It should be classified as an analysis tool, not a strategy.
No exit logic exists because no entry logic exists. The EA has no OnTick handler, no position iteration, and no trade wrapper calls, so there is nothing to close under any condition — manually or automatically.
Not applicable. The EA never opens positions, so no per-trade stop-loss is ever installed. There is also no global drawdown cap, no equity floor, and no kill-switch — the runtime is a passive chart widget with no execution authority.
Not applicable. The EA never opens positions, so no take-profit target is ever attached. There are no partial-close ladders, no basket targets, and no time-based exit timers — the OBJ_CHART sub-widget simply reflects the symbol and timeframe you typed into the PIPSymbol and PIPPeriod edit fields.
Best suited for traders who run a single execution chart but need a second instrument or higher timeframe visible at a glance — for example, watching DXY inside an EURUSD chart, US10Y inside a NAS100 chart, or silver inside a gold chart. Recommended minimum balance is $100 simply as a courtesy threshold; since no orders are ever placed, the EA can be attached to a demo, a cent, or a prop-firm challenge account equally well. Any MT5 broker that offers the Symbol() and the sub-symbol you want to display will work — there is no spread filter, no execution path, and no session timing to align, so broker type is irrelevant beyond symbol availability. The default 450x300 panel at the top-left (10,10) is calibrated for a 1920x1080 chart with indicators below; resize via XSize and YSize for ultrawide or 4K displays, and recolor TextColor and BGColor to match a dark template.
Strategy Logic
Pipsgrowth EX16093 Trend — Strategy Logic Analysis (from .mq5 source)
Family: Trend
Magic: 22216093
Version: 2.00
BRIEF:
Chart-in-chart utility EA that embeds a sub-chart with editable symbol/period, scale controls and show/hide toggle. No trading logic — visual/analysis tool only. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester
INDICATOR STACK:
- Standard
MT5indicators
KEY FUNCTIONS:
OnChartEvent()PIPCreate()PIPDelete()PIPSetParams()PIPHideChart()StrToPeriod()PeriodToStr()TryClose_EX16093()TryClosePartial_EX16093()TryModify_EX16093()
INTERNAL CONSTANTS (0 total):
INPUT PARAMETERS (2 total across 1 groups):
- [=== Identity ===]
InpMagicNumber=22216093// Magic Number - [=== Identity ===]
InpTradeComment= "Psgrowth.com Expert_16093" // TradeComment
// Pipsgrowth EX16093 Trend — Execution Flow (from source analysis)
// Family: Trend
// Chart-in-chart utility EA that embeds a sub-chart with editable symbol/period, scale controls and show/hide toggle. No trading logic — visual/analysis tool only. 12 layers: REGIME, SIGNAL, ENTRY, CONFIRM, NO-TRADE, CAPITAL CAP, RISK, SIZING, MANAGE, EXIT, SCALING, OnTester
ON_INIT:
Create indicator handles: standard set
Initialize state variables
Detect broker GMT offset
ON_TICK:
1. Refresh indicator buffers (closed-bar shift=1)
2. Manage existing positions:
- Break-even check
- ATR trailing stop
- Profit lock ratchet
- Time-based exit
- Opposite-signal exit
3. If new bar:
a. ClassifyRegime() — ADX/ATR/BB regime detection
b. NoTradeGate() checks:
- Market open + session filter
- Spread limit
- Cooldown after loss
- Consecutive loss limit
- Kill switch
- Max drawdown
- Max concurrent positions
- Daily/weekly loss limits
c. GenerateSignal() — strategy-specific entry logic
d. CheckConfirm() — HTF alignment + R:R + ADX minimum
e. Calculate position size from risk %
f. Execute with retry logic
g. Mark bar to prevent duplicates
ON_TESTER:
Custom fitness = weighted(RecoveryFactor, ROI, ProfitFactor, TradeCount, Sharpe, Drawdown)Optimization Profile
How to Install This EA on MT5
- 1Download the .mq5 file using the button above
- 2Open MetaTrader 5 on your computer
- 3Click File → Open Data Folder in the top menu
- 4Navigate to MQL5 → Experts and paste the .mq5 file there
- 5In MT5, right-click Expert Advisors in the Navigator panel → Refresh
- 6Drag the EA onto an H4 or Daily chart for best results
- 7Configure EMA periods, ADX threshold, and lot size in the dialog
- 8Enable Allow Algo Trading and click OK
EA Parameters
| Parameter | Default | Description |
|---|---|---|
| InpMagicNumber | 22216093 | Magic Number |
| InpTradeComment | "Psgrowth.com Expert_16093" | Trade Comment |
#property copyright "Pipsgrowth.com"
#property link "https://pipsgrowth.com"
#property version "2.00"
#property strict
#property description "Pipsgrowth.com EX16093 ChartInChart — chart-in-chart utility, full 12-layer stack."
#include <Trade\Trade.mqh>
//--- inputs
input group "=== Display Parameters ==="
input color TextColor=clrWhite;
input color BGColor=clrSteelBlue;
input int XPosition=10;
input int YPosition=10;
input int XSize=450;
input int YSize=300;
input group "=== Identity ==="
input long InpMagicNumber=22216093; // Magic Number
input string InpTradeComment="Psgrowth.com Expert_16093"; // Trade Comment
//--- variables
int xsize=450;
int ysize=300;
int xdist=10;
int ydist=10;
int scale=1;
int show=1;
int showdates =0;
int showprices=0;
//---
string curr_symbol;
string curr_period_str;
ENUM_TIMEFRAMES curr_period;
ENUM_TIMEFRAMES enper;
//+------------------------------------------------------------------+
//| Initialize expert |
//+------------------------------------------------------------------+
void OnInit()
{
//--- default value for symbol and period
curr_symbol=Symbol();
curr_period=Period();
PeriodToStr(curr_period,curr_period_str);
//--- copy sizes
xsize=XSize;
ysize=YSize;
xdist=XPosition;
ydist=YPosition;
//--- create objects
PIPCreate();
PIPSetParams();
//---
ChartRedraw();
}
//+------------------------------------------------------------------+
//| Process chart events |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,const long& lparam,const double& dparam,const string& sparam)
{
if(id==CHARTEVENT_OBJECT_ENDEDIT && sparam=="PIPSymbol")
{
curr_symbol=ObjectGetString(0,"PIPSymbol",OBJPROP_TEXT);
ObjectSetString(0,"PIPChart",OBJPROP_SYMBOL,curr_symbol);
Full source code available on download
Educational purposes only. Do NOT use with real money. Test on demo accounts only.
Clear Warning: Educational Purposes Only
Clear Warning: This Expert Advisor is for educational and testing purposes only. Do NOT use it with real money. Test only on demo accounts. Trading with real money involves substantial risk of capital loss. This does not constitute investment advice.
Recommended Brokers for This EA
These EAs run on MT5 — use a regulated broker with fast execution and tight spreads
Markets.com
Exness
IC Markets
Similar Expert Advisors
View All Expert AdvisorsMore Trend Following strategy EAs from our library
Pipsgrowth EX16080 Trend
Pipsgrowth.com EX16080 EURUSDTrendFollower — triple-EMA H4 trend follower, full 12-layer stack.
Pipsgrowth EX16081 Trend
Pipsgrowth.com EX16081 GoldTrendEA — XAUUSD H4 EMA cross with Fib targets, full 12-layer stack.
Pipsgrowth EX16033 Trend
Pipsgrowth.com EX16033 EA_Price_Action — price-action grid scalper, full 12-layer stack.
Community
Educational purposes only. Do NOT use with real money. Test on demo accounts only.