Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (VoroneTZ, monk12, Quad), 829 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Efficiency on exit position #474829
11/08/18 12:37
11/08/18 12:37
Joined: Feb 2018
Posts: 236
Italy
tradingest Offline OP
Member
tradingest  Offline OP
Member

Joined: Feb 2018
Posts: 236
Italy
Hi guys,

my function run() is execute on BarPeriod = 1.
Each minute the function check my gain or loss and when reach a value exit on position.
I want ot guarantee that the value.

For istance: target value = 120

1 run --> value 100
2 run --> 119
3 run --> 80

but between 2 and 4 run has reached 140.How can I exit before without change the BarPeriod = 1. Is it possible?

Thanks

Last edited by tradingest; 11/08/18 12:37.
Re: Efficiency on exit position [Re: tradingest] #474830
11/08/18 14:36
11/08/18 14:36
Joined: Feb 2017
Posts: 369
D
Dalla Offline
Senior Member
Dalla  Offline
Senior Member
D

Joined: Feb 2017
Posts: 369
Use a TMF. It will be executed on every tick.
http://zorro-project.com/manual/en/trade.htm

Re: Efficiency on exit position [Re: tradingest] #474831
11/08/18 14:36
11/08/18 14:36
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
A TMF runs on every tick. You can simulate it using the TICKS flag.

Or you can put your exit logic in tick().

Read these:
http://zorro-project.com/manual/en/trade.htm
http://zorro-project.com/manual/en/mode.htm#ticks
http://zorro-project.com/manual/en/tick.htm

Re: Efficiency on exit position [Re: AndrewAMD] #474832
11/08/18 16:17
11/08/18 16:17
Joined: Feb 2018
Posts: 236
Italy
tradingest Offline OP
Member
tradingest  Offline OP
Member

Joined: Feb 2018
Posts: 236
Italy
thanks so much AndrewAMD

so, this means that also my strategy run each 1 min I can exit each tick with TMF function?

Re: Efficiency on exit position [Re: tradingest] #474833
11/08/18 16:21
11/08/18 16:21
Joined: Feb 2017
Posts: 369
D
Dalla Offline
Senior Member
Dalla  Offline
Senior Member
D

Joined: Feb 2017
Posts: 369
As long as you get tick data from your broker, yes

Re: Efficiency on exit position [Re: Dalla] #474835
11/08/18 19:13
11/08/18 19:13
Joined: Feb 2018
Posts: 236
Italy
tradingest Offline OP
Member
tradingest  Offline OP
Member

Joined: Feb 2018
Posts: 236
Italy
thanks so much for the support.

TMF working with tick I guess that this functions works in live trading and is not possible to test. Is it correct?

Re: Efficiency on exit position [Re: tradingest] #474836
11/08/18 19:33
11/08/18 19:33
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Use the TICKS flag.

Re: Efficiency on exit position [Re: AndrewAMD] #474837
11/08/18 19:36
11/08/18 19:36
Joined: Feb 2018
Posts: 236
Italy
tradingest Offline OP
Member
tradingest  Offline OP
Member

Joined: Feb 2018
Posts: 236
Italy
Originally Posted By: AndrewAMD
Use the TICKS flag.


So, with flag works also within backtest?

I insert the flag in the function run(), is it correct?
Code:
set(TICKS);



fantastic!!

thanks again

Last edited by tradingest; 11/08/18 22:15.
Re: Efficiency on exit position [Re: tradingest] #474838
11/08/18 22:10
11/08/18 22:10
Joined: Feb 2017
Posts: 369
D
Dalla Offline
Senior Member
Dalla  Offline
Senior Member
D

Joined: Feb 2017
Posts: 369
For backtesting the same applies as above. If you have tick data (T1 files) and set TICKS flag), then the tmf will run on every tick.

Re: Efficiency on exit position [Re: Dalla] #474862
11/09/18 18:44
11/09/18 18:44
Joined: Feb 2018
Posts: 236
Italy
tradingest Offline OP
Member
tradingest  Offline OP
Member

Joined: Feb 2018
Posts: 236
Italy
Hi Dalla,

thank for your support. I try to set set(TICKS) but in real when the position reach the amount that I want the position doesn't close.

Why? What I miss?

I setting the TICKS in function run() with BarPeriod = 1.

Can you help me with an example or with the code that I must write in my script?

Page 1 of 2 1 2

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1