Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, wandaluciaia, 1 invisible), 798 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Issue zorro ? #475762
01/07/19 10:54
01/07/19 10:54
Joined: Apr 2018
Posts: 37
S
sdelatorre Offline OP
Newbie
sdelatorre  Offline OP
Newbie
S

Joined: Apr 2018
Posts: 37
Hello
I have a code that works only with function tick(open/close trades) but when i change the barperiod the results are different.
I don.t understand the reason if i only use the tick function.

I have the flag TICKS


The code:
int timezone = WET;



int profit(){
if(TradeIsOpen and (TradeProfit/TradeUnits/PIP < -50)){exitTrade();}
if(TradeIsOpen and (TradeProfit/TradeUnits/PIP >4)){exitTrade();}
return 0;
}

function tick(){
if(lhour(timezone) == 7 && minute(timezone)==0) { enterShort(profit);}
if(lhour(timezone) == 13 && minute(timezone)==0){ exitShort(); }
// printf("ntick %f",priceClose());
}

function run() {
set(PLOTNOW+PARAMETERS+TICKS);
StartDate = 20180101;
EndDate = 20180301;
BarPeriod = 60;




Any idea?

Thank in advance

Last edited by sdelatorre; 01/07/19 14:29.
Re: Issue zorro ? [Re: sdelatorre] #475763
01/07/19 11:34
01/07/19 11:34
Joined: Feb 2017
Posts: 369
D
Dalla Offline
Senior Member
Dalla  Offline
Senior Member
D

Joined: Feb 2017
Posts: 369
Post code

Re: Issue zorro ? [Re: Dalla] #475765
01/07/19 14:29
01/07/19 14:29
Joined: Apr 2018
Posts: 37
S
sdelatorre Offline OP
Newbie
sdelatorre  Offline OP
Newbie
S

Joined: Apr 2018
Posts: 37


The code, if you change f.i barperiod=30, same entries different values:

int timezone = WET;
int profit(){
if(TradeIsOpen and (TradeProfit/TradeUnits/PIP < -50)){exitTrade();}
if(TradeIsOpen and (TradeProfit/TradeUnits/PIP >4)){exitTrade();}
return 0;
}

function tick(){
if(lhour(timezone) == 7 && minute(timezone)==0) { enterShort(profit);}
if(lhour(timezone) == 13 && minute(timezone)==0){ exitShort(); }
// printf("ntick %f",priceClose());
}

function run() {
set(PLOTNOW+PARAMETERS+TICKS);
StartDate = 20180101;
EndDate = 20180301;
BarPeriod = 60;

Re: Issue zorro ? [Re: sdelatorre] #475771
01/07/19 17:03
01/07/19 17:03
Joined: Feb 2017
Posts: 369
D
Dalla Offline
Senior Member
Dalla  Offline
Senior Member
D

Joined: Feb 2017
Posts: 369
Why did you put your entry/exit inside tick() instead of just run?

Re: Issue zorro ? [Re: Dalla] #475804
01/08/19 15:09
01/08/19 15:09
Joined: Apr 2018
Posts: 37
S
sdelatorre Offline OP
Newbie
sdelatorre  Offline OP
Newbie
S

Joined: Apr 2018
Posts: 37

Hello Dalla,

because i want to check every tick....i did test inside run, but the result is different if I change the barperiod too.....


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