Issue zorro ?

Posted By: sdelatorre

Issue zorro ? - 01/07/19 10:54

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
Posted By: Dalla

Re: Issue zorro ? - 01/07/19 11:34

Post code
Posted By: sdelatorre

Re: Issue zorro ? - 01/07/19 14:29



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;
Posted By: Dalla

Re: Issue zorro ? - 01/07/19 17:03

Why did you put your entry/exit inside tick() instead of just run?
Posted By: sdelatorre

Re: Issue zorro ? - 01/08/19 15:09


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.....
© 2024 lite-C Forums