Gamestudio Links
Zorro Links
Newest Posts
Using ":L" & ":S" causes 2 possible bug(s) or is it bad coding?
by AndrewAMD
8 minutes 26 seconds ago
Help with Data import to T1
by OptimusPrime
Today at 19:44
How to ensamble multiple algos with advise calls?
by laz
Today at 18:53
Correlation -1.#IND00
by AndrewAMD
01/21/19 17:37
Basic thread safety question
by Superku
01/20/19 18:15
Blog Post: Get Historical Data from Darwinex REST API w/ Zorro
by AndrewAMD
01/19/19 22:19
Reseting a static variable - the next day
by OptimusPrime
01/19/19 19:48
AUM Magazine
Latest Screens
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Who's Online
12 registered (OptimusPrime, AndrewAMD, jacek, Dalla, kvm, Quad, Iglarion, ibne, misiek, 3 invisible), 489 Guests and 7 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
jthbln, laz, ramonne, SibJac, Evael
18157 Registered Users
Page 1 of 2 1 2 >
Topic Options
Rate This Topic
#474829 - 11/08/18 13:37 Efficiency on exit position
tradingest Offline
Member

Registered: 02/27/18
Posts: 224
Loc: 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


Edited by tradingest (11/08/18 13:37)

Top
#474830 - 11/08/18 15:36 Re: Efficiency on exit position [Re: tradingest]
Dalla Online
Senior Member

Registered: 02/24/17
Posts: 337
Use a TMF. It will be executed on every tick.
http://zorro-project.com/manual/en/trade.htm

Top
#474831 - 11/08/18 15:36 Re: Efficiency on exit position [Re: tradingest]
AndrewAMD Online
User

Registered: 02/21/17
Posts: 544
Loc: 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

Top
#474832 - 11/08/18 17:17 Re: Efficiency on exit position [Re: AndrewAMD]
tradingest Offline
Member

Registered: 02/27/18
Posts: 224
Loc: Italy
thanks so much AndrewAMD

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

Top
#474833 - 11/08/18 17:21 Re: Efficiency on exit position [Re: tradingest]
Dalla Online
Senior Member

Registered: 02/24/17
Posts: 337
As long as you get tick data from your broker, yes

Top
#474835 - 11/08/18 20:13 Re: Efficiency on exit position [Re: Dalla]
tradingest Offline
Member

Registered: 02/27/18
Posts: 224
Loc: 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?

Top
#474836 - 11/08/18 20:33 Re: Efficiency on exit position [Re: tradingest]
AndrewAMD Online
User

Registered: 02/21/17
Posts: 544
Loc: Chicago
Use the TICKS flag.

Top
#474837 - 11/08/18 20:36 Re: Efficiency on exit position [Re: AndrewAMD]
tradingest Offline
Member

Registered: 02/27/18
Posts: 224
Loc: 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


Edited by tradingest (11/08/18 23:15)

Top
#474838 - 11/08/18 23:10 Re: Efficiency on exit position [Re: tradingest]
Dalla Online
Senior Member

Registered: 02/24/17
Posts: 337
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.

Top
#474862 - 11/09/18 19:44 Re: Efficiency on exit position [Re: Dalla]
tradingest Offline
Member

Registered: 02/27/18
Posts: 224
Loc: 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?

Top
Page 1 of 2 1 2 >



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

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