Great EA in backtest! - page 116

 
Beno:
I have read this thread from front to back trying to find a solution I have the

Cyberia Trader1.85g jpy.mq4 version I have loaded it and have the face but I have not had any orders at all. I am using the USD/CHF pair on 30mins. not having any orders makes it really hard to do any forward testing. the system has been running for 4 days and still no orders.

some help would be great thanks.

cheers

Beno

I would help you if I knew how to make better than 70% but I don't. I run on the 1hr chart, try that.

 
Aaragorn:
Thankyou for that bit of code. I looked at it and can see it both creating and reading files. I don't see it appending anything on the end of a file it's already created. Maybe it is and I'm just not seeing and maybe it's not doing it and there's nothing to see. I wish I knew a piece of code that we knew WAS appending data to the end so I could see how it does it.

Give this thread a look:

https://www.mql5.com/en/forum/175496

 

I've really been hacking at this code and I've left it rather a mess..but...

my efforts to get this to print to file are proving unsuccessful at present.

I guess that I will ask those who want to assist in data gathering to make the attempt to do this manually.

I have this attached EA set up to print to the journal the minimum logics of the CT. This isn't grabbing any indicators but perhaps just looking at the logics of CT will give us something to go with.

To gather this data, what you need to do is run the ea in the backtester set up just as it is. however while it runs you need to monitor the journal tab. Since the journal will not hold more than the data from a few orders without starting to truncate and drop data off the bottom end. you will need to stop the test very quickly when you reach about every successive 5 - 7 orders. Then copy and paste the data into a notepad and restart the tester watching to see when it gets to where you made the previous copy/paste. You have to be careful to capture all the data when you paste which looks like this for one order...

2006.11.10 10:22:52 2004.03.05 03:02 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: close #56 buy 0.42 EURUSDm at 1.2188 sl: 1.2171 tp: 1.2285 at price 1.2210

2006.11.10 10:22:52 2004.03.05 03:02 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: Recorded Winning Long 56 Opened: 1.2188 Closed: 1.221

2006.11.10 10:22:52 2004.03.04 18:40 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: Ticket: 56 DV: -0.0051 CCI: 57.9346 Long order is opened @: 1.2188 StopLoss= 1.2171 TakeProfit= 1.2285

2006.11.10 10:22:52 2004.03.04 18:40 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: Buy @ Minute 40

2006.11.10 10:22:52 2004.03.04 18:40 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: open #56 buy 0.42 EURUSDm at 1.2188 sl: 1.2171 tp: 1.2285 ok

2006.11.10 10:22:52 2004.03.04 18:40 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: BuyPossibilityMid:0.0004

2006.11.10 10:22:52 2004.03.04 18:40 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: SellPossibilityMid:0.0004

2006.11.10 10:22:52 2004.03.04 18:40 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: UndefinedPossibilityMid:0.0009

2006.11.10 10:22:52 2004.03.04 18:40 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: BuySucPossibilityMid:0.002

2006.11.10 10:22:52 2004.03.04 18:40 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: SellSucPossibilityMid:0.0021

2006.11.10 10:22:52 2004.03.04 18:40 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: UndefinedSucPossibilityMid:0.0021

2006.11.10 10:22:52 2004.03.04 18:40 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: BuyPossibilityQuality:8

2006.11.10 10:22:52 2004.03.04 18:40 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: SellPossibilityQuality:8

2006.11.10 10:22:52 2004.03.04 18:40 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: UndefinedPossibilityQuality:19

2006.11.10 10:22:52 2004.03.04 18:40 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: BuySucPossibilityQuality:7

2006.11.10 10:22:52 2004.03.04 18:40 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: SellSucPossibilityQuality:7

2006.11.10 10:22:52 2004.03.04 18:40 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: UndefinedSucPossibilityQuality:14

2006.11.10 10:22:52 2004.03.04 18:40 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: UndefinedPossibilityMid*UndefinedPossibilityQuality:0.0164

2006.11.10 10:22:52 2004.03.04 18:40 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: BuyPossibilityMid*BuyPossibilityQuality:0.0032

2006.11.10 10:22:52 2004.03.04 18:40 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: SellPossibilityMid*SellPossibilityQuality:0.0034

2006.11.10 10:22:52 2004.03.04 18:40 Cyberia Trader1.9 R2.2 AlertEuro EURUSDm,H1: Hour: 18 Minute: 40

run this on a one hour chart and capture the data. then send me the .txt notepad file by email perhaps if islandhome started at the first order and did the first 500 traeds of 2005 and AZBOfin start with trade 500 of 2005 and do the next 500?

ah! bollay that. let me try what coder's guru just posted.

 
codersguru:
Give this thread a look: https://www.mql5.com/en/forum/175496

wow you may have just saved me alot of trouble here...

could you look at the EA I posted and see were I am trying to print to file in 4 places in the code. Twice where it opens orders and then in separate functions when it closes orders. You see what I'm trying to extract from this? Could you help me code this so it records the information of each order, the logic of the program when it opens and the result when the order closes?

if I do this fileflush after each time will it erase anything? I still don't understand how the flush thing works.

 

Eureka! Oh man, well thankyou coder's guru, nice rescue!

now I'm still puzzled a little bit here...notice the .txt file it's not printing an outcome line for every order. why is it skipping that for some orders I wonder?

Can I assume that if it doesn't print the outcome line that it's a losing position?

 

Your never going to be able to decipher that data in that format, you need it to be in rows, try incorporating these.

I'm still having an issue with it saying too many files are open...but heres the basic way your dumpp needs to be formated so that you can view it in excel

//LOGIC FOR HEADER OF FILE - creates the header labels for the rows in the CSV file

string fileName = Symbol() + "-" + TimeToStr(LocalTime(), TIME_DATE) + " " + TimeHour(LocalTime()) + "-" + TimeMinute(LocalTime()) + ".csv";

File = FileOpen(fileName, FILE_CSV|FILE_WRITE, ',');

if (FileWrite(File, Symbol(),"DATETIME","Lots","Bid","SlipPage","StopLoss","TakeProfit","MagicNumber",

"SellPossibilityMid*SellPossibilityQuality",

"BuyPossibilityMid*BuyPossibilityQuality",

"UndefinedPossibilityMid*UndefinedPossibilityQuality",

"UndefinedSucPossibilityQuality",

"SellSucPossibilityQuality",

"BuySucPossibilityQuality",

"UndefinedPossibilityQuality",

"SellPossibilityQuality",

"BuyPossibilityQuality",

"UndefinedSucPossibilityMid",

"SellSucPossibilityMid",

"BuySucPossibilityMid",

"UndefinedPossibilityMid",

"SellPossibilityMid",

"BuyPossibilityMid",

"Decision" ) < 0)

{

PrintError();

return (Error);

}

//LOGIC FOR APPEND OF FILEWRITE - Writes the rows of data

//Record statistics at time of Order - Added by DudeWorks

void RecordTickets ()

{

if (Error > 0)

return (Error); //stop on error

FileSeek(File,0,SEEK_END);

if (FileWrite(File, Symbol(),TimeToStr(CurTime(),TIME_DATE|TIME_SECONDS),Lots,Bid,SlipPage,StopLoss,TakeProfit,MagicNumber,

SellPossibilityMid*SellPossibilityQuality,

BuyPossibilityMid*BuyPossibilityQuality,

UndefinedPossibilityMid*UndefinedPossibilityQuality,

UndefinedSucPossibilityQuality,

SellSucPossibilityQuality,

BuySucPossibilityQuality,

UndefinedPossibilityQuality,

SellPossibilityQuality,

BuyPossibilityQuality,

UndefinedSucPossibilityMid,

SellSucPossibilityMid,

BuySucPossibilityMid,

UndefinedPossibilityMid,

SellPossibilityMid,

BuyPossibilityMid,

Decision) < 0)

{

PrintError();

return (Error);

}

FileFlush(File);

return(0);

}

 
DudeWorks:
Your never going to be able to decipher that data in that format, you need it to be in rows, try incorporating these.

I'm still having an issue with it saying too many files are open...but heres the basic way your dumpp needs to be formated so that you can view it in excel

//LOGIC FOR HEADER OF FILE - creates the header labels for the rows in the CSV file

string fileName = Symbol() + "-" + TimeToStr(LocalTime(), TIME_DATE) + " " + TimeHour(LocalTime()) + "-" + TimeMinute(LocalTime()) + ".csv";

File = FileOpen(fileName, FILE_CSV|FILE_WRITE, ',');

if (FileWrite(File, Symbol(),"DATETIME","Lots","Bid","SlipPage","StopLoss","TakeProfit","MagicNumber",

"SellPossibilityMid*SellPossibilityQuality",

"BuyPossibilityMid*BuyPossibilityQuality",

"UndefinedPossibilityMid*UndefinedPossibilityQuality",

"UndefinedSucPossibilityQuality",

"SellSucPossibilityQuality",

"BuySucPossibilityQuality",

"UndefinedPossibilityQuality",

"SellPossibilityQuality",

"BuyPossibilityQuality",

"UndefinedSucPossibilityMid",

"SellSucPossibilityMid",

"BuySucPossibilityMid",

"UndefinedPossibilityMid",

"SellPossibilityMid",

"BuyPossibilityMid",

"Decision" ) < 0)

{

PrintError();

return (Error);

}

//LOGIC FOR APPEND OF FILEWRITE - Writes the rows of data

//Record statistics at time of Order - Added by DudeWorks

void RecordTickets ()

{

if (Error > 0)

return (Error); //stop on error

FileSeek(File,0,SEEK_END);

if (FileWrite(File, Symbol(),TimeToStr(CurTime(),TIME_DATE|TIME_SECONDS),Lots,Bid,SlipPage,StopLoss,TakeProfit,MagicNumber,

SellPossibilityMid*SellPossibilityQuality,

BuyPossibilityMid*BuyPossibilityQuality,

UndefinedPossibilityMid*UndefinedPossibilityQuality,

UndefinedSucPossibilityQuality,

SellSucPossibilityQuality,

BuySucPossibilityQuality,

UndefinedPossibilityQuality,

SellPossibilityQuality,

BuyPossibilityQuality,

UndefinedSucPossibilityMid,

SellSucPossibilityMid,

BuySucPossibilityMid,

UndefinedPossibilityMid,

SellPossibilityMid,

BuyPossibilityMid,

Decision) < 0)

{

PrintError();

return (Error);

}

FileFlush(File);

return(0);

}

that's not an issue for me.

the import external data feature on excel puts it in rows quite nicely. just tell it that it's delimited by ";" The challenge I would like to get with formatting is that it's not printing an outcome line for losing positions. This means that the data in the rows is not the same for each order which makes it difficult to design an identifier that recognizes the losing entries. right now i can pull the winning data apart from the rest fine, perhaps that's enough, I think I can work around what I've got, but I don't have any indicator data in this yet.

 

Look at this...I've given this thing it's very own function now to save the losing trade's outcome line and STILL it won't print the line???? oy, come on one line is that too much to ask?

void RecordLongLOutcomes()

{

//OrderSelect(OrderTicket(),SELECT_BY_POS,MODE_TRADES);

if(OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber)

{

if(OrderType()==OP_BUY)

{

if(OrderOpenPrice() + Spread >= OrderClosePrice())

{

datetime blorderOpen=OrderOpenTime();

handle = FileOpen("Cyberia.txt",FILE_READ|FILE_WRITE);

if(handle!=-1)

{

FileSeek(handle,0,SEEK_END);

FileWrite(handle,"Losing Long OrderTicket: ",OrderTicket()," Opened @: ",OrderOpenPrice()," Closed @: ",OrderClosePrice()," Order Open Time: ",blorderOpen);

FileWrite(handle," ");

Print("Recorded Losing Long ",OrderTicket()," Opened: ",OrderOpenPrice()," Closed: ", Bid);

FileFlush(handle);

FileClose(handle);

}

else

{

int err1;

err1=GetLastError();

Print("error(",err1,"): ",ErrorDescription(err1));

return(0);

}

}//if win or lose

}//if buy

}//if symbol and magic number

return (0);

}//record long outcomes[/PHP]

what gives???

see this? this works fine...

[PHP]void RecordLongOutcomes()

{

//OrderSelect(OrderTicket(),SELECT_BY_POS,MODE_TRADES);

if(OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber)

{

if(OrderType()==OP_BUY)

{

if(OrderOpenPrice() + Spread < OrderClosePrice())

{

datetime borderOpen=OrderOpenTime();

handle = FileOpen("Cyberia.txt",FILE_READ|FILE_WRITE);

if(handle!=-1)

{

FileSeek(handle,0,SEEK_END);

FileWrite(handle,"Winning Long OrderTicket: ",OrderTicket()," Opened @: ",OrderOpenPrice()," Closed @: ",OrderClosePrice()," Order Open Time: ",borderOpen);

FileWrite(handle," ");

Print("Recorded Winning Long ",OrderTicket()," Opened: ",OrderOpenPrice()," Closed: ", Bid);

FileFlush(handle);

FileClose(handle);

}

else

{

int err;

err=GetLastError();

Print("error(",err,"): ",ErrorDescription(err));

//return(0);

}

}//if win or lose

}//if buy

}//if symbol and magic number

RecordLongLOutcomes();

return (0);

}//record long outcomes

It's the same code! (practically) This mql language is amazingly tempermental!

 

hi Aaragorn

pls upload the best set file

for cyber

tnx

bye

 
nanoc:
hi Aaragorn

pls upload the best set file

for cyber

tnx

bye

it's in this...

https://www.mql5.com/en/forum/174700/page71

Reason: