Please help me solve this mystery!! - page 2

 
WHRoeder:
Unless you are using visual mode in the tester, there will never be anything in the journal.
That isn't correct.  Nothing is output to the journal during optimization but output to the journal works just fine if Visual mode is NOT ticked. (just tested on Build 445)
 

I AM using Visual Mode in any case!

There is something else that is very strange. When I run the SAME EA with the SAME parameters more than once I get different transactions on the Visual Mode displayed!

Most of the time 90% are the same - but at certain places there are different results with multiple runs!

Is there some buffers (e.g. variables) that must be initialized or cleared after every run? I do try to initialize al variables in the declaration section.

Maybe my computer has gone haywire?? I am grabbing at straws at the moment.

 
ernest02:

I AM using Visual Mode in any case!

There is something else that is very strange. When I run the SAME EA with the SAME parameters more than once I get different transactions on the Visual Mode displayed!

Most of the time 90% are the same - but at certain places there are different results with multiple runs!

Is there some buffers (e.g. variables) that must be initialized or cleared after every run? I do try to initialize al variables in the declaration section.

Maybe my computer has gone haywire?? I am grabbing at straws at the moment.

What is the Spread for each run ?
 

Ok Guys! Solve this one!

Look at the larger piece of code I posted.

The first line is an "if" statement and if true will process the lines thereafter.

One of the actions that has to take place is the closing of any open Buy orders.

Now when I run the EA in the Tester it actually closes any Buy orders  BUT...

It skips the Print statement in the middle of the code - and that does not get recorded in the Journal!

So I know the code is being processed, but only CERTAIN Print statements get recorded in the Journal - but others NOT!

So please explain that to me!

 
ernest02:

Now when I run the EA in the Tester it actually closes any Buy orders  BUT...

It skips the Print statement in the middle of the code - and that does not get recorded in the Journal!

So I know the code is being processed, but only CERTAIN Print statements get recorded in the Journal - but others NOT!

So please explain that to me!

The following will print to the journal . . .

   Print("SellTicket is ",SellTicket);    // <----- this will print

   if (SellTicket >= 0) 
      {
      PlaySound("news.wav");
      SellTime = OrderOpenTime();
      SellSignal = false;

      }
   Print("SellSignal2 is ", SellSignal);  // <----- this will print

 if they aren't printing then as far as I can see the possibilities are as follows:

  • you are not running the code you have posted
  • the buy orders are being closed by some other code/function 

 

if SellTicket equal zero, seriously ?

if (SellTicket >= 0) // ???

Right click the journal, select open, and open the journal log with notepad.

The journal tab does not always show all the logs. 

 

I have looked at the Log file and there are no Sell or Buy transactions recorded there or any of the other "Print" commands.

I am so demotivated! I have been on this thing for 2 weeks now and have made no progress and have run out of ideas of what the problem could be.

(Just want to say for what it is worth that i also have Metatrader 5 installed on my comouter and run Windows 7 that stores some data and log files in Virtual Store under Users)

 
ernest02:

I have looked at the Log file and there are no Sell or Buy transactions recorded there or any of the other "Print" commands.

I am so demotivated! I have been on this thing for 2 weeks now and have made no progress and have run out of ideas of what the problem could be.

(Just want to say for what it is worth that i also have Metatrader 5 installed on my comouter and run Windows 7 that stores some data and log files in Virtual Store under Users)

Ah, where do you have MT4 installed   is it in Program Files ?  if you do perhaps you have a UAC issue.  You could try a fresh install of MT4 in a directory that is not Program Files for example,  C:\MT4-Installs\  and try your EA.
 

I have created a folder under C:/ where I have installed MT4, but I have two other copies (one live & one demo) which are installed under Program Files (x86).

I do not have any log files with the last two but do have log files under the root MT4. (That is why I can report on what is in the Log file)

Now I have just noticed another anomaly. (I already mentioned the fact that I get different results from two identical runs)

I use iCCI to track the CCI index to make Buy/Sell transaction decisions. I have discovered that transactions happen even when the CCI condition is not true!

This is such a mess! I long back to my XP days where my system seemed to be much more simpler and stabler!

I am about ready to throw in the towel!

 
@ernest02: Just re-write the code. Use Print/Alert/Comment functions to debug your codes. If you're puzzled as-to why OrderSend executed then Print the values of the variables which triggers it [Right Above the OrderSend]. If you're puzzled as-to why CCI == true then Print the values of the variables which triggers the CCI call [Before The CCI call]. Keep moving the Print Statement backward like this until you find the Culprit.  
Reason: