Gamestudio Links
Zorro Links
Newest Posts
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
folder management functions
by 7th_zorro. 04/15/24 10:10
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
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
SGT_FW
by Aku_Aku. 04/10/24 16:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, Quad), 373 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 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,724
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,724
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,724
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,724
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