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)
Definitely not - better do not yet trade that system...
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.
Hmm I can't find a problem with peeking in my script
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 ?_?
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.
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.
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.