Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
6 registered members (EternallyCurious, AndrewAMD, ricky_k, 7th_zorro, 2 invisible), 478 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Taking partial profit in Zorro #482168
01/04/21 23:53
01/04/21 23:53
Joined: Jan 2021
Posts: 5
D
Diabolus Offline OP
Newbie
Diabolus  Offline OP
Newbie
D

Joined: Jan 2021
Posts: 5
Hey folks,

I'm trying to redo strategies I already have in MT5 in Zorro to learn. Also, this way I'd be able to run them side by side to see if the outcome is "the same" (or close enough).

I'm looking for ways to enter with multiple lots and take partial profits with Zorro on price levels that are defined at entry time, but couldn't find a way to do that. I already looked at TrailLock (not exactly what I want), and exitLong (couldnt find a way to make it work).

I only found 2 ways of taking profits this:
  • if a condition is met, exitLong - This isn't perfect as the level is not always correct, it is only based on conditions that may give me variable levels (I'm trying to set exactly as R% for my partial profits)
  • exit the full position by setting the profittarget in enterLong.


I'm trying to implement something like this:
EntryLong - Stop Entry on High of last bar with 2 lots. (done)
Once in a position set Stop as Low of signal bar (done)
As soon as I enter in a position I set a partial profit of 1 lot at 1R with a limit order (the same distance from entry to initial stop) - (Missing)
When this partial profit is reached, set stop for the remaining position (1 lot) at breakeven (entry price) - (Missing)

TrailStop through a Lower of the last 3 bars - (done)


I searched the forum and manual, but there doesn't seem to be a function like in MT5 (PositionClosePartial). I'd appreciate any assistance.

Re: Taking partial profit in Zorro [Re: Diabolus] #482171
01/05/21 09:56
01/05/21 09:56
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline
User
MatPed  Offline
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
Hi, I do not know if I correctly understood, but yo can do it in many ways:
Open 2 trades with half of the size and set the take profit accordingly
Set trailing accordingly with your calculation
Code a TMF that make all the calculation you want and close half of the position

Ciao

Re: Taking partial profit in Zorro [Re: MatPed] #482187
01/08/21 00:36
01/08/21 00:36
Joined: Jan 2021
Posts: 5
D
Diabolus Offline OP
Newbie
Diabolus  Offline OP
Newbie
D

Joined: Jan 2021
Posts: 5
For some reason, I tried doing it this way (initiating 2 trades) but it gets crazy, maybe I'm missing some logic there.

I've done it with TMF but unfortunately the way I've done it, I check if a candle closed above the supposed take profit position and then close that position. But this is not exactly what I need, as sometimes the price will touch that point but close the candle below it.

In any case, I appreciate the response.

Re: Taking partial profit in Zorro [Re: Diabolus] #482190
01/09/21 09:51
01/09/21 09:51
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline
User
MatPed  Offline
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
TMF executes every ticks, if you set the TICKS flag. If correctly coded it will close at the exact level required, slippage excluded obviosly


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1