In one of our other videos we have created a simple buy trade system and this is the result of a whole year.
It made seventy three trades, fifty four were short trades and nineteen were long trades.
You see under the input tab we have absolutely no values here so we cannot set anything that is not hardcoded in our source code.
Now we want the user to be able to adjust the Lot Size of a trade here, to do that we simply click on Simple Buy Trade and click Modify.
This is how our short E.A. looks like and this is the Lot Size.
To create a dynamic value that can be changed by the user you have to make it an input variable and will be a double variable, and we will call it MyLotSize.
Let’s assign ten Micro Lot here, copy the name and exchange the fixed ten Micro Lot Size here with our new variable.
I will save it as Simple Buy Trade with input. Let’s compile the code and hit F4 to bring up the Meta Trader.
I will select the system here, check the visualization option and start the test. This is our first trade and its ten Micro Lot.
Let’s stop the test, go to inputs and change it to 0.2, now it is 20 Micro Lot.
If you make something adjustable by the user, you can do it by making it an input.
Afterwards the value can be simply changed without recompiling the code.
Download “MQL5 Simple Buy Trade with User Input EA from MQL5 Tutorial”SimpleBuyTradeWithInput.txt – Downloaded 437 times – 381.00 B