Entry price not within the bar in test mode

Posted By: kkfx

Entry price not within the bar in test mode - 09/07/20 13:49

Hi,

called function:
enterLong(10,1.332);

EUR_USD,2012-02-09 12:00:00,1.327880,1.328230,1.325010,1.325210,0
EUR_USD,2012-02-09 13:00:00,1.325210,1.325810,1.323480,1.325120,0
EUR_USD,2012-02-09 14:00:00,1.325120,1.330880,1.324090,1.327770,0 <--- The OHLC when the enterLong
EUR_USD,2012-02-09 15:00:00,1.327770,1.332180,1.327020,1.331130,0
EUR_USD,2012-02-09 16:00:00,1.331130,1.331570,1.326890,1.330360,0

From the log :
[8543: Thu 12-02-09 14:00] 130035 0 130/153 (1.32777)
(EUR/USD::L) Long 10@1.33200 Entry stop
(EUR/USD::L) Entry stop 1.33200 hit at 14:00:00
[EUR/USD::L4401] Long 10@1.33165 Risk 37489 at 14:00:00

My question is where is this 1.33165 comes from ? I could have wrong or missed some config but have been trying to search and still no idea what happened.

Any advise is much appreciated.

Thanks
Posted By: kkfx

Re: Entry price not within the bar in test mode - 09/08/20 05:15

Hi,

Can someone give some clue please ?
Posted By: Zheka

Re: Entry price not within the bar in test mode - 09/08/20 09:51

Post the script in full; which Zorro version is this with?
Posted By: kkfx

Re: Entry price not within the bar in test mode - 09/08/20 15:40

HI,

Zorro version :S 2.12.2

Where does this 1.29355 comes from in Zorro log while entry is 1.29345.Code is attached.

[1: Mon 12-01-02 05:00] 100000 0 0/0 (1.29253)
(EUR/USD::L) Entry stop 1.29345 hit at 05:00:00
[EUR/USD::L0201] Long 10@1.29355 Risk 487 p at 05:00:00

Below is my log:
Place order at 20120102 05:00 entry:1.293450,Stop:1.290950

OHLC data:
open high low close
EUR_USD,2012-01-02 04:00:00,1.296780,1.296780,1.292420,1.292950,0
EUR_USD,2012-01-02 05:00:00,1.292950,1.293400,1.292310,1.292530,0 <--- EnterLong
EUR_USD,2012-01-02 06:00:00,1.292530,1.293780,1.292420,1.293130,0
EUR_USD,2012-01-02 07:00:00,1.293130,1.294310,1.292750,1.293780,0
EUR_USD,2012-01-02 08:00:00,1.293780,1.294690,1.292980,1.293980,0

Code:
#include <default.c>
#include "HY_PrintLog.c"

bool Ordered=false;
string Symbols="EUR/USD";
void Init()
{

if(is(INITRUN))
{
BarPeriod=60;
Capital = 100000;
PIP=0.0001;
if(!is(TRADEMODE))
{
LookBack=0;
StartDate = 20120101;
EndDate = 20141231;
}
Lots=10;
set(LOGFILE);
CLEARLOG();
asset(Symbols);
}

}

function run()
{
Init();

if(NumOpenLong==0)
{
enterLong(10,priceOpen()+5*PIP,priceOpen()-20*PIP,priceOpen()+40*PIP);
char chInfo[1024];
sprintf(chInfo,"\nPlace order at %04d%02d%02d %02d:00 entry:%f,Stop:%f",year(),month(),day(),hour(0),priceOpen()+5*PIP,priceOpen()-20*PIP) ;
LOG(chInfo);
}

}
© 2024 lite-C Forums