Close position with define lot - script

Black Art

Trader
Mar 2, 2021
12
1
6
45
Hello !

This is my first post here, so first of all I would like to say a big HELLO to all of you !
I wish profitable trades to everyone !!!

So what brings me here today ?
I'm looking for a script where you can choose X lot of the position size to close out. For example: If I have a 0.10 lot size open and I want to close 0.04 of the position the script would close that part and the remaining position would only be 0.06 lots.
I kind of found similar scripts to what I'm looking for (attached) but I have no idea how to modify them to work my way.

The One Click Partial Close Script do almost the trick, but it closes 1/3 of the open position every time.
I tried to modify code by myself but I totally don't know nothing about coding and at the end of the day It still doesn't do what I want.

So basically I want to create a 6 or 7 separate scripts with define lots size and then hotkey them for a quick position closure.
For example ctrl+1 = 0.01 lot closed, ctrl+2 = 0.02 lot closed etc.

Could anyone help me with this please?
If someone could write one script or modify existing one as a sample - I'll be more than happy. Based on that I will "code" rest of them.
 

Attachments

  • One Click Partial Close Script.ex4
    6.5 KB · Views: 21
  • One Click Partial Close Script.mq4
    3.8 KB · Views: 28
  • close_half_position.mq4
    1.5 KB · Views: 30
  • close_positions_with_defined_lots_symbol.mq4
    1.5 KB · Views: 30
  • 👍
Reactions: paypal2608

Enivid

Administrator
Staff member
Nov 30, 2008
18,532
1,355
144
Odesa
www.earnforex.com
  • 👍
Reactions: paypal2608 and Black Art