Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, ozgur, AbrahamR, wdlmaster), 849 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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