WoW What's happening?

Posted By: MatPed

WoW What's happening? - 07/02/15 15:03

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?
Posted By: royal

Re: WoW What's happening? - 07/03/15 10:06

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)
Posted By: MatPed

Re: WoW What's happening? - 07/03/15 15:23

Not a good sign... at all
Posted By: jcl

Re: WoW What's happening? - 07/03/15 15:48

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.
Posted By: royal

Re: WoW What's happening? - 07/06/15 10:05

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 picture logfile.jpg
Posted By: jcl

Re: WoW What's happening? - 07/06/15 11:21

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.
Posted By: royal

Re: WoW What's happening? - 07/06/15 11:48

Thanks already for your help laugh
Posted By: jcl

Re: WoW What's happening? - 07/06/15 16:00

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.
Posted By: royal

Re: WoW What's happening? - 07/07/15 08:50

Looks better with the FAST flag set. Thanks for investigating laugh
Posted By: jcl

Re: WoW What's happening? - 07/07/15 09:14

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.
Posted By: MatPed

Re: WoW What's happening? - 07/08/15 17:35

I have little time to test but I guess the issue is wider.
my strategy does not use ticks flags at all. Neither use a custom TMF function. set pending order and close a deal only oat the end of the bar if specific contions apply.
I guess some issue with bollinger bands and pending order are also in the process.. I will post log asap.

thx
Posted By: royal

Re: WoW What's happening? - 09/09/15 12:25

So now that I have updated to version 1.34 I'm getting wrong results both with "set(TICKS)" and with "set(TICKS+FAST)" frown
Are you sure the bug has been fixed correctly?
Posted By: jcl

Re: WoW What's happening? - 09/09/15 12:55

Yes, at least the bug mentioned here has been fixed. How do you know that the results are wrong?
Posted By: royal

Re: WoW What's happening? - 09/09/15 13:28

I have changed nothing except the zorro version and the result is -200000 instead of +40000 profit. This looks like the behavior I got when updating from 1.30 to 1.32 :\
Posted By: jcl

Re: WoW What's happening? - 09/10/15 09:57

I think the result is probably correct. But you can contact Support with your script to make sure. However when you were doing exit reversal with a TMF and had the TICKS flag set, then you were probably victim to the discussed bug in 1.32 and are now getting the correct result.
Posted By: royal

Re: WoW What's happening? - 09/11/15 10:38

I have made further investigation and something is going completely wrong frown
With the script I posted before the expected behavior should be that after a loss it should reverse the trade. As I can see in the logfile, it opens the reversed trade 1 minute before the original trade was closed and also the entry is at a different level then the stop before. confused

Attached picture logfile.jpg
Posted By: jcl

Re: WoW What's happening? - 09/11/15 11:31

The entry being at a different level than the stop can be normal, at it is from a different tick and with M1 data at least one minute later. But the time looks indeed strange. I would expect that it is the other way around. Can you contact Support and send them that script? We'll have to look into it.
Posted By: royal

Re: WoW What's happening? - 09/11/15 11:42

It is the script I posted on the first site of this thread. Different level can be, but about 60 GER30 points in one minute and this at every reversing trade seems quite unrealistic.
© 2024 lite-C Forums