Search code examples
mql4metatrader4

Is it possible to change a value of a Lot-size field input in a One-Click-Trading window with Expert Advisor code?


As the title states is it possible to change the lot size in one click trading window via expert advisor?

Regards, AK


Solution

  • No, it is not. TLDR


    Why?

    The MetaTrader4 Terminal software is a historically founded programme ( better a platform ) where some architecture decisions were initally setup in a way, that is not easy to be changed in these days.

    This is valid and common situation in any larger software Project and MetaQuotes, Inc., was not and is not excluded from this kind of experience.

    Historically, the platform supported internal code-execution facilities for several concurrently operating user-defined algorithms.

    Each MT4.Graph can accomodate resources for:
    - 1x Expert Advisor process
    - Nx Custom Indicator processes
    - 1x Script process

    One-Click-Trading was introduced by MetaQuotes, Inc., as an example of so called plugin add-ons, that could have been operated with MetaTrader Terminal software, but users do not receive any code-controllable API from MetaQuotes, Inc., engineering for operating these add-ons programmatically.

    One might similarly have met another add-on widget, called Depth of Market, which was actively "marketed" and promoted by brokers, but which has even more weaknesses than the OCT-widget ( which at least can operate click-based trading for those who enjoy such style )

    Well, while it would not be any fatal thing to develop a middleware code for interfacing between Windows O/S objects, just the costs of such reinventing wheels would hardly allow to justify such Dev/Test efforts.

    The more as there started some major re-engineering changes both in the MetaTrader Terminal software ( which might be welcome, if performed professionally ) but also in the MQL4-language syntax ( which started literally an endless headache nightmare for code-maintainers )

    Recent new-MQL4.56789 creeps, yes, creeps - several silent changes in restrictions, syntax default behaviour shifts and headbangs alike that string suddenly stopped being a string-technically, but struct simply added new levels of frustration to live with.

    Not speaking about countless man*years in repairing and re-defining DLL-interfacing nightmares


    How to escape from such moving sands?

    Distributed-computing seems to be a promising way to exclude most of the code from the MQL4 domain and have it been operated externally from MQL4 ( which remains as some form of a Thin Client interface / mediator between:
    FOREX Market Events' Flow ( provisioned via MetaTrader Server system )
    MMI/GUI ( provisioned via MetaTrader Terminal system )
    AlgoTrading Strategy / Services alike Gathering Records Of Evidence + SysLog(s) + ...you name it ( provisioned via Distributed Processing Node(s) / Grid(s) / GPU-Cloud(s) / etc )