Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (dr_panther, Quad), 903 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Partially close trades in TMF #487902
11/06/23 15:16
11/06/23 15:16
Joined: Jan 2022
Posts: 58
N
NorbertSz Offline OP
Junior Member
NorbertSz  Offline OP
Junior Member
N

Joined: Jan 2022
Posts: 58
Hello,

I want to close half of the trade at a certain price. I tried to accomplish that with a trade management function; when the conditions are met, I tried modifying the TradeLots, and also tried
Code
exitTrade(ThisTrade, 0, TradeLots/2);

but neither worked for me. I am aware of the following documentation comment...
Quote
TMFs can open new trades with enterLong/Short. However be careful when assigning them the same TMF: mistakes in entry conditions can lead to an endless loop of entering new trades. Exit a trade by returning 1, rather than calling exitTrade.

... but if I return 1, the whole trade closes. Do you have any idea?

Re: Partially close trades in TMF [Re: NorbertSz] #487903
11/06/23 16:39
11/06/23 16:39
Joined: Jan 2022
Posts: 58
N
NorbertSz Offline OP
Junior Member
NorbertSz  Offline OP
Junior Member
N

Joined: Jan 2022
Posts: 58
Ouch.

Quote
Trade size given by an integer number of lots (default = 1; max = LotLimit). [...] Since it's the minimum, the trade size can never be less than 1 lot (see remarks). [...].


I am coming from the MT4 world, where Lots can be "microlot". The reason I could not close partially by modifying TradeLots is because I tried to change to 0.5. For further readers: also check the Hedge mode.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1