2.4 KiB
2.4 KiB
Custom Logic For Trading Mini
Source-first execution framework for MetaTrader 4 and MetaTrader 5.
This package connects a custom indicator buffer to a small, readable order-execution layer. It is intentionally a framework, not a trading strategy and not a profitability claim.
Included
Custom Logic For Trading Mini.mq4— MT4 Expert Advisor sourceCustom Logic For Trading MT5 Mini.mq5— MT5 Expert Advisor source
What it does
- Reads a selected buffer from a custom indicator.
- Interprets that value as a price cross, level cross, or non-empty symbol signal.
- Enters on a false-to-true signal transition.
- Supports long-only, short-only, or both sides.
- Applies fixed lot size, optional stop loss/take profit, an order cap, opposite-signal closing, and optional break-even.
Quick start
- Copy the matching
.mq4or.mq5file to the terminal'sMQL4/ExpertsorMQL5/Expertsdirectory. - Compile it in MetaEditor.
- Set
indicator_nameto the indicator path relative to the matchingIndicatorsfolder. Include a subfolder when needed, for exampleMyFolder\\MyIndicator. - Choose the correct buffer index and signal type.
- Start with a demo account and verify the indicator's buffer meaning before enabling live execution.
Important behavior
- The original rolling-array signal flow is preserved: the first observed state after attachment is ignored, and a trade requires a later false-to-true transition.
- A persistent old buffer value remains true-to-true and cannot repeatedly re-arm an entry.
- An unavailable indicator value is not appended to signal history and never becomes a signal, including when
ReversalLogicis selected. maximum_order = 0means no framework-level cap. Positions are counted only when symbol and magic number match.take_profit,stop_loss,break_even_trigger, andbreak_even_targetare distances in points, not pips.- Indicator input parameters are not guessed or hard-coded. If the indicator requires non-default inputs, expose them in the EA and pass them to
iCustomas part of your own integration.
Scope and safety
This source is supplied for learning and customization. It does not promise a win rate, return, or suitability for any account. Test the indicator integration and broker constraints on a demo account before live use. The author is not responsible for trading losses.
License
Released under the MIT License. See LICENSE.txt.