Topic: static input Entry_Amount & Max_Open_Positions

I hope this message finds you well.

I am currently utilizing an Expert Advisor (EA) that you have developed, and I have encountered a challenge that I believe you could assist me with. The issue pertains to the optimization of the Entry_Amount variable within the MetaTrader 5 Strategy Tester.

The EA operates effectively, and I am impressed with its performance. However, I have noticed that the Entry_Amount parameter is not selectable for optimization in the Strategy Tester. This limitation hinders my ability to fully optimize the EA's performance for different trading conditions.

Here is the specific line of code where Entry_Amount is utilized:

mql5
ManageOrderSend(command, Entry_Amount, stopLoss, takeProfit, 0, signal.MagicNumber);
I have attempted to resolve this by ensuring that the optimization settings are correctly configured and that the Entry_Amount is listed as an optimizable variable. Despite these efforts, the issue persists.

Could you kindly provide guidance on how to modify the EA's code to allow for the optimization of the Entry_Amount variable? If there are any specific instructions or code adjustments needed, I would greatly appreciate your expertise.

Thank you for your time and assistance. I look forward to your valuable input.

Best regards,

Re: static input Entry_Amount & Max_Open_Positions

You can easily enable the Entry Amount for optimization.

Please open the expert cod in the editor.  The Entry_Amount variable is at the top of the code.

https://image-holder.forexsb.com/store/make-entry-amount-optimisable-thumb.png

It is marketed as "static". Please remove the "static" descriptor, and you will be able to optimize the Entry amount.

The code should look like this:

static input string _Properties_ = "------"; // --- Expert Properties ---
static input int    Magic_Number = 365481517; // Magic number
       input double Entry_Amount =     0.19; // Entry lots
       input int    Stop_Loss    =     5000; // Stop Loss   (pips)
       input int    Take_Profit  =     7000; // Take Profit (pips)