It is necessary to create a simplified version of the "Risk Calculator" advisor. Here is a link to YouTube showing how it works: https://www.youtube.com/watch?v=LJ940Boxj1A
The idea is to calculate the lot size at a fixed risk.
There is its executable file if needed, but of course, no source code is available.
The main issue: it works very well for currency pairs, but does not correctly calculate the lot when trading other instruments like CFDs on stocks. The broker does not allow trading fractional lots, for example, 2.1 lots, so the advisor should round the lot size. Of course, this will slightly shift the risk (either higher or lower), but that is acceptable. As mentioned above, there are no such problems with currency pairs. The owners do not want to solve this problem themselves, so a similar version needs to be ordered.
Technical task:
1) Create a graphical toolbar with fields:
- Risk (default "2%" of the deposit);
- Risk/Reward (default "4" - one to four);
- Lot (calculated automatically);
- Stop Loss - SL (default 10 cents/pip);
- Take Profit - TP (default 1, but can be 2 or 3. When choosing 2 or 3, the trade is divided into halves or thirds accordingly). The TP calculation is based on the Risk/Reward ratio, so default 1 to 4 - with 10 cents risk, the first take profit will be 40 cents, the second - 80, the third - 120 cents.
*!All values can be changed manually! - see the video
- The "Profit in $ equivalent" field is not needed.
Leave the 4 buttons as they are (buy from market price, sell from market price, pending order, which when dragged above/below the level will change the order type, e.g., buy stop or buy limit, and vice versa (explained in the video), and the order execution button).
I would also like to add a button for automatically moving the stop loss to break-even (by default, when reaching twice the risk - in our example 20 cents, the Stop Loss is moved to BE, say +5 points from the opening price). An option to enable and disable this feature is needed.
When pressing the buttons, the advisor draws lines: buy price, sell price, and stop, which can be moved manually, and the lot size should be recalculated according to the risk (as shown in the video).
Also, I need an explanation of where I can systematically change the default values if needed, so I don't have to manually input new values each time.
That's all. The rest of the functionality shown in the video is secondary for me and not needed at this stage. If anything is unclear, we can arrange a call and explain in more detail.
I look forward to your proposals and work estimate.