Download Babi Ngepet for MetaTrader 5

Babi Ngepet

Babi Ngepet

This tool for MetaTrader 5 is specifically engineered to streamline your trading operations. This Expert Advisor serves as automated trading software. It is utilized to monitor financial markets and execute trades based on predefined algorithmic rules, enabling precise position management without the need for constant manual oversight.

MT5 expert Pack 📂

How to Setup and Use Babi Ngepet

1. Installation: Open the "File" menu, select "Open Data Folder," navigate to MQL/Experts, paste your file, and restart the terminal.

2. Activation: Drag the EA from the Navigator onto a chart, ensure "Allow live trading" is checked in the Common tab, and verify the AutoTrading button is green.

3. Optimization: Right-click your chart, choose "Expert List," click "Properties" to adjust inputs, and save your preferred setup as a set file for future use.

4. Maintenance: Regularly check the "Experts" tab in the terminal window to monitor trade logs and potential execution errors.

Frequently Asked Questions

Q: Why is my EA not opening trades? A: Check the "AutoTrading" button, ensure "Allow live trading" is enabled, and verify your broker allows automated trading on your account type.

Q: Can I run multiple EAs on one chart? A: No, each chart can only host one active EA; however, you can open multiple charts for different currency pairs to run several EAs.

Q: What does the "smiley face" icon mean? A: A smiley face in the top-right corner of the chart indicates the EA is successfully running; a frowny face means it is disabled.

Description & Settings

Expert Advisor Parameters (Inputs)
The EA provides several external parameters that the user can modify to control its behavior:
General Parameters Martingale Strategy Time Strategy Core Functions Overview OnInit() (Initialization)
Sets the EA's MagicNumber , margin mode, and deviation. It
resets the Martingale status
variables ( s_currentLot , s_totalTradesInSeries , etc.) to their initial values, preparing for a fresh start.
OnDeinit() (Deinitialization)
A simple function for cleanup, printing a message when the EA is stopped or removed.
IsTradingDateAllowed() and IsTradingDayAllowed() (Trading Filters)
These functions check the current day and date against the user-defined inputs ( AllowMonday to AllowFriday and ForbiddenDates ) to determine if trading is permitted.
OpenTradeLogic(ENUM_ORDER_TYPE type, string tradeComment) (Market Execution)
This function handles opening new market positions (Buy or Sell).

It validates and normalizes the lot size against the broker's minimum, maximum, and step size.

It checks for
sufficient free margin
using CheckMargin() .

It executes the trade
without a fixed Take Profit or Stop Loss
( tp_calculated is 0).

It updates the global Martingale status variables: s_currentLot , s_lastOpenPrice , s_seriesType , and s_totalTradesInSeries .

CloseAllPositions()
Iterates through all currently open positions and closes any that were opened by
this EA
(matching the MagicNumber ).
PendingOrders(ENUM_ORDER_TYPE type, double price, double lotSize, string comment) (Pending Order Placement)
This function places
Buy Limit
or
Sell Limit
orders:

It validates the lot size and checks for sufficient margin.

It validates the entry price against the broker's minimum distance ( SYMBOL_TRADE_STOPS_LEVEL ).

It calculates a fixed Take Profit ( tp ) based on the TakeProfit input.

It sends the trade request.
Note:
The UpdateHighLowAndOrders function calls this to place initial Buy Limit and Sell Limit orders.

UpdateHighLowAndOrders() (Initial Entry Logic)
This is the
initial entry mechanism
when no positions are open:

It looks back FindHighLowBackBars to find the
Highest High
and
Lowest Low
.

It calculates priceSellLimit (Highest High + 1 tick) and priceBuyLimit (Lowest Low - 1 tick).

It checks if Buy Limit and Sell Limit orders with the EA's MagicNumber already exist.

It places an initial
Sell Limit
order just above the recent highest high and a
Buy Limit
order just below the recent lowest low, each using the InitialLot .

OnTick() (Main Logic)
The core of the EA's execution logic:

Time Check:
Prevents redundant calculations on the same tick.

Filter Check:
If trading is not allowed by day/date, it deletes all pending orders.

Profit Target Check (Series Exit):
If eaHasOpenPositions is true AND totalFloatingProfit is ≥ SecureProfitMartingaleTarget , it calls CloseAllPositions() and
resets all Martingale status variables
to start a new series.

Initial Order Placement:
If !eaHasOpenPositions AND trading is allowed, it
resets the Martingale status
and checks if a new bar has formed.

If a new bar is formed, it checks if barsCount is ≥ ResetAfterBars . If so, it deletes pending orders and calls UpdateHighLowAndOrders() to place new initial orders. If not, it just calls UpdateHighLowAndOrders() .

Martingale Step Logic:
If eaHasOpenPositions is true AND s_totalTradesInSeries is $< MaxTradesInSeries`:

It checks if totalFloatingProfit is
negative
AND the price has moved against the last open trade by at least DistanceMartingalePips .

If both conditions are met, it calculates the nextLot by multiplying s_currentLot by LotMultiplier .

It determines the orderToOpen direction (either the same direction as the series or the reverse, based on ReverseMartingale ).

It calls OpenTradeLogic() to open the new, multiplied position, continuing the Martingale series.

Summary of Strategy
The "Babi Ngepet" EA implements a risky but potentially high-reward Martingale strategy combined with a breakout/range-reversal initial entry:

Initial Entry:
The EA places an initial
Buy Limit
(below recent low) and a
Sell Limit
(above recent high). This suggests an initial assumption of
range-bound behavior
—it enters a buy when the price drops to a low, and a sell when the price rises to a high.

Trade Management:
If one of the initial trades is triggered and the position moves into an aggregate loss (negative floating profit), and the price continues to move against the open positions by a defined distance, the EA opens a
new position
in the same direction with a
larger lot size
(Martingale).

Exit Strategy:
The series of trades continues to increase lot size until the aggregate floating profit of all trades in the series reaches the SecureProfitMartingaleTarget , at which point all positions are closed, and the EA resets for a new series.

Warning:
The Martingale strategy is known for high drawdowns and high risk of capital loss because the lot size increases after every losing step.

You May Also Like

RobotFX does not own any of the code provided on this platform. All tools are freely available on the internet; we simply index and re-offer them for download. We are not responsible for any financial losses that may occur. Trading responsibilities rely solely on the traders downloading and using the displayed Expert Advisors, indicators, and scripts. These tools are provided for educational purposes only and may require modification or optimization to align with a trader's specific strategy or needs.
© ROBOTFX - Best MetaTrader Expert Advisors & Indicators