Gamestudio Links
Zorro Links
Newest Posts
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
Data from CSV not parsed correctly
by jcl. 04/20/24 08:32
Zorro FIX plugin - Experimental
by jcl. 04/20/24 08:30
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (7th_zorro, Aku_Aku, 1 invisible), 579 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
WoW What's happening? #452973
07/02/15 15:03
07/02/15 15:03
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline OP
User
MatPed  Offline OP
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
Same strategy, tested on 1.30.1 and 1.32. Totally DIfferent test results does not seems a good thing...

1.30.1 Results
BBS28 compiling.................
Walk-Forward Test: BBS28 EUR/USD 2009..2015
Read BBS28.fac BBS28_1.par BBS28_2.par BBS28_3.par BBS28_4.par BBS28_5.par BBS28_6.par BBS28_7.par
Monte Carlo Analysis... Median AR 338%
Profit 1494$ MI 36$ DD 54$ Capital 149$
Trades 218 Win 56% Avg +15.0p Bars 4
AR 290% PF 4.25 SR 3.51 UI 1% R2 0.86

1.32 Results
BBS28 compiling.................
Walk-Forward Test: BBS28 EUR/USD 2009..2015
Read BBS28.fac BBS28_1.par BBS28_2.par BBS28_3.par BBS28_4.par BBS28_5.par BBS28_6.par BBS28_7.par
Monte Carlo Analysis... Median AR -16%
Profit -459$ MI -11$ DD 656$ Capital 979$
Trades 189 Win 32% Avg -5.6p Bars 2
AR -13% PF 0.65 SR -1.18 UI 0% R2 0.57
Time 00:00:01

The strategy is based on one pair, one cross and one indicator Bollinger Bands. Any Idea?

Last edited by MatPed; 07/02/15 15:04.
Re: WoW What's happening? [Re: MatPed] #452988
07/03/15 10:06
07/03/15 10:06
Joined: Jul 2013
Posts: 75
R
royal Offline
Junior Member
royal  Offline
Junior Member
R

Joined: Jul 2013
Posts: 75
Thanks for this thread, I am experiencing the same things and I thougt I am doing something wrong.
In the logfile I can see, that Zorro is closing some trades right after one minute, even so no stop or takeprofit was hit.
(strategy with a TMF)

Re: WoW What's happening? [Re: royal] #452994
07/03/15 15:23
07/03/15 15:23
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline OP
User
MatPed  Offline OP
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
Not a good sign... at all

Re: WoW What's happening? [Re: MatPed] #452995
07/03/15 15:48
07/03/15 15:48
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Definitely not - better do not yet trade that system... wink

The main difference between 1.30 and 1.32 performance-wise is that you can not peek into the future anymore with a TMF. If your system had unrealistic profit prior to that, there's a good chance that this was peeking bias, often unintentionally caused by bad code in your TMF.

Of course that's just what I would immediately suspect, there can be many other reasons why a script has inconsistent performance. But all those reasons mean that the script is not fit for trading.

Don't feel helpless when encountering such a problem: The first thing to check is the log of the old and the new version. Look into a single trade, from open to close. There you can normally see the reason of different results.

Re: WoW What's happening? [Re: jcl] #453053
07/06/15 10:05
07/06/15 10:05
Joined: Jul 2013
Posts: 75
R
royal Offline
Junior Member
royal  Offline
Junior Member
R

Joined: Jul 2013
Posts: 75
Hmm I can't find a problem with peeking in my script frown

It is a TMF which opens a new trade in the opposite direction when stopped out (like the one in the manual)

Code:
// TMF that opens an opposite trade when stopped out


int ReverseAtStop11()
{
  if(TradeIsStop) { // stop loss hit?

	Lots = 97;

    if(TradeIsShort)
      enterLong(); // enter opposite trade
    else 
      enterShort();
  }

// call the TMF at stop loss / profit target only  
  return 16;
}

int ReverseAtStop10()
{
  if(TradeIsStop) { // stop loss hit?

	Lots = 72;

    if(TradeIsShort)
      enterLong(ReverseAtStop11); // enter opposite trade
    else 
      enterShort(ReverseAtStop11);
  }

// call the TMF at stop loss / profit target only  
  return 16;
}

int ReverseAtStop9()
{
  if(TradeIsStop) { // stop loss hit?

	Lots = 54;

    if(TradeIsShort)
      enterLong(ReverseAtStop10); // enter opposite trade
    else 
      enterShort(ReverseAtStop10);
  }

// call the TMF at stop loss / profit target only  
  return 16;
}

int ReverseAtStop8()
{
  if(TradeIsStop) { // stop loss hit?

	Lots = 41;

    if(TradeIsShort)
      enterLong(ReverseAtStop9); // enter opposite trade
    else 
      enterShort(ReverseAtStop9);
  }

// call the TMF at stop loss / profit target only  
  return 16;
}

int ReverseAtStop7()
{
  if(TradeIsStop) { // stop loss hit?

	Lots = 31;

    if(TradeIsShort)
      enterLong(ReverseAtStop8); // enter opposite trade
    else 
      enterShort(ReverseAtStop8);
  }

// call the TMF at stop loss / profit target only  
  return 16;
}

int ReverseAtStop6()
{
  if(TradeIsStop) { // stop loss hit?

	Lots = 23;

    if(TradeIsShort)
      enterLong(ReverseAtStop7); // enter opposite trade
    else 
      enterShort(ReverseAtStop7);
  }

// call the TMF at stop loss / profit target only  
  return 16;
}

int ReverseAtStop5()
{
  if(TradeIsStop) { // stop loss hit?

	Lots = 17;

    if(TradeIsShort)
      enterLong(ReverseAtStop6); // enter opposite trade
    else 
      enterShort(ReverseAtStop6);
  }

// call the TMF at stop loss / profit target only  
  return 16;
}

int ReverseAtStop4()
{
  if(TradeIsStop) { // stop loss hit?

	Lots = 13;

    if(TradeIsShort)
      enterLong(ReverseAtStop5); // enter opposite trade
    else 
      enterShort(ReverseAtStop5);
  }

// call the TMF at stop loss / profit target only  
  return 16;
}

int ReverseAtStop3()
{
  if(TradeIsStop) { // stop loss hit?

	Lots = 10;

    if(TradeIsShort)
      enterLong(ReverseAtStop4); // enter opposite trade
    else 
      enterShort(ReverseAtStop4);
  }

// call the TMF at stop loss / profit target only  
  return 16;
}

int ReverseAtStop2()
{
  if(TradeIsStop) { // stop loss hit?

	Lots = 7;

    if(TradeIsShort)
      enterLong(ReverseAtStop3); // enter opposite trade
    else 
      enterShort(ReverseAtStop3);
  }

// call the TMF at stop loss / profit target only  
  return 16;
}



int ReverseAtStop1()
{
  if(TradeIsStop) { // stop loss hit?
	
	Lots = 5;

    if(TradeIsShort)
      enterLong(ReverseAtStop2); // enter opposite trade
    else 
      enterShort(ReverseAtStop2);
  }
// call the TMF at stop loss / profit target only  
  return 16;
}

int ReverseAtStop()
{
  if(TradeIsStop) { // stop loss hit?
	
	Lots = 4;

    if(TradeIsShort)
      enterLong(ReverseAtStop1); // enter opposite trade
    else 
      enterShort(ReverseAtStop1);
  }
// call the TMF at stop loss / profit target only  
  return 16;
}




function run()
{
  set(TICKS+LOGFILE);  // normally needed for TMF
  StartDate = 20150101;
  EndDate = 20151231;
  Weekend = 3; // don't run TMF at weekend
  BarPeriod = 1440;



while(asset(loop("GER30"))){


  		Stop = 60*PIP;
 		TakeProfit = 180*PIP;
  		Lots = 10;	
	

		var openMonth = priceOpen(20);
		vars ATR20 = series(ATR(20));


		if((NumOpenLong + NumOpenShort  == 0) and ATR20[0] >= 100*PIP){
	

	
			if(price(0) >= openMonth){
	
				enterLong(ReverseAtStop);
	
			}
	
			else if(price(0) < openMonth){
		
				enterShort(ReverseAtStop);
	
			}

		}
	}
}



Here is a screenshot of the logfile, in the green lines everything is correct, but in the red lines the trade is closed after one minute, even so no TP or SL was hit (in 1.30 this was not the case)

Also in the last line with the TP, the price should have moved 180 pips in 1 minute, when I check this in the FXCM trading station, this was not the case ?_?

Attached Files logfile.jpg
Last edited by royal; 07/06/15 10:20.
Re: WoW What's happening? [Re: royal] #453055
07/06/15 11:21
07/06/15 11:21
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
This could indeed be future peeking, although I'm not 100% sure. In the old version the new trade would run in a new TMF loop, from the first to the last price of the bar. Because the first price lies in the past when the trade was entered, it is normally entered at a better price due to the later stopping out of the old, opposite trade. This won't happen anymore with the new version.

I'm not sure because I remember that the old version had a workaround for this case, otherwise entering trades in a TMF would be forbidden. But I'll look into this in more detail and test your script with both versions. I'll also check the reason for the exit after a minute.

Re: WoW What's happening? [Re: jcl] #453056
07/06/15 11:48
07/06/15 11:48
Joined: Jul 2013
Posts: 75
R
royal Offline
Junior Member
royal  Offline
Junior Member
R

Joined: Jul 2013
Posts: 75
Thanks already for your help laugh

Re: WoW What's happening? [Re: royal] #453060
07/06/15 16:00
07/06/15 16:00
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
I got confirmation that your script had no peeking bias. So the result from the previous version was in fact correct, but the test result from the current version was wrong, due to a bug. The bug affects systems when TICKS mode is set and trades are entered in a TMF due to exit reversal.

Sorry for that. This will be fixed in the next update, but inbetween set the FAST flag additionally to TICKS. This will emulate the TICKS mode of the previous version and should produce a correct result.

Re: WoW What's happening? [Re: jcl] #453075
07/07/15 08:50
07/07/15 08:50
Joined: Jul 2013
Posts: 75
R
royal Offline
Junior Member
royal  Offline
Junior Member
R

Joined: Jul 2013
Posts: 75
Looks better with the FAST flag set. Thanks for investigating laugh

Re: WoW What's happening? [Re: royal] #453076
07/07/15 09:14
07/07/15 09:14
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
If anyone else has huge differences between the last version and this one, and doubts that this was caused by TMF peeking bias, you can send the script to Support. We'll look into it.

Page 1 of 2 1 2

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1