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.