Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, SBGuy, TipmyPip, ozgur), 923 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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