Please help me solve this mystery!! - page 4

 
ernest02:

I will get rid of the Print as suggested.

Any other advice to solve my problem?

I am attaching a document that shows how different the same EA performs under different MT4 demo terminals from the same broker.

You said  "On another MT4 terminal I get 7 instead of only one transaction!!"  what is important from the point of view of the way you have coded your EA is how many orders you have open at any one time . . . .  it looks like you have no more than 4 and this is consistent with the way you have written your code,  so there is no issue here,  your code is doing what you coded it to do . . .  why ?  because you wrote this . . .

TotalBuyOrders <= MaxTrans

 MaxTrans is 3,  so if you have 3 open Buy orders that is equal to MaxTrans so it's OK to open another one,  when you have 4 that is greater than MaxTrans so another Buy order is not opened.  

 
RaptorUK:
Maybe it is something to do with your CCIReal variable,  it is a CCI value for bar 0 so it is likely to be different for each tick during the formation of bar 0, using PRICE_CLOSE just means that you are using Close[0] value for Bar 0 which is the same as Bid.


Do you think it will solve the problem if I rather use shift=1 in my CCIReal variable?

 
RaptorUK:

You said  "On another MT4 terminal I get 7 instead of only one transaction!!"  what is important from the point of view of the way you have coded your EA is how many orders you have open at any one time . . . .  it looks like you have no more than 4 and this is consistent with the way you have written your code,  so there is no issue here,  your code is doing what you coded it to do . . .  why ?  because you wrote this . . .

 MaxTrans is 3,  so if you have 3 open Buy orders that is equal to MaxTrans so it's OK to open another one,  when you have 4 that is greater than MaxTrans so another Buy order is not opened.  


I understand why up to four transactions can be opened at the same time, because that is the way I wrote the code.

But what I CANNOT understand is why I get such totally different results from two MT4 demo terminals from the same broker, same time period and same EA??

Would LOVE to know what results you will get when you run this EA for the same period on your terminal. (period 1 Nov 2012 - 9 Nov 2012)

 
ernest02:

I understand why up to four transactions can be opened at the same time, because that is the way I wrote the code.

But what I CANNOT understand is why I get such totally different results from two MT4 demo terminals from the same broker, same time period and same EA??

Would LOVE to know what results you will get when you run this EA for the same period on your terminal. (period 1 Nov 2012 - 9 Nov 2012)


On the test runs I did I got significantly different results until I disconnected from my Broker.  When I disconnected from my Broker I got slightly different results,  this should not happen . . .  I don't know why it is happening,  it needs a detailed investigation.

I don't know if I have M1 and above data for 1st - 9th Nov 2012,  which symbol ?
 
ernest02:

Do you think it will solve the problem if I rather use shift=1 in my CCIReal variable?

I don't use Technical Indicators,  I had to look up what a CCI was and how it is calculated,  then I put it on a chart to see what it did before I wrote my post,  so I'm not the best person to ask about the merits of using any Indicators in certain ways from the point of view of trading,  I can see what is going on from a coding point of view  . . .  if you use Bar 1 it will not re-paint,  when you look at a static chart you only see bars that are closed.
 
RaptorUK:
On the test runs I did I got significantly different results until I disconnected from my Broker.  When I disconnected from my Broker I got slightly different results,  this should not happen . . .  I don't know why it is happening,  it needs a detailed investigation.

I don't know if I have M1 and above data for 1st - 9th Nov 2012,  which symbol ?


The symbol is EURUSD 1 Hour data.
 
ernest02:

The symbol is EURUSD 1 Hour data.

I don't have M1 data for that date range,  I don't use my Brokers data for Strategy Tester work as it's likely to have holes in it.  I do have M5 data though . . .  lets see what happens . . .

 
RaptorUK:

I don't have M1 data for that date range,  I don't use my Brokers data for Strategy Tester work as it's likely to have holes in it.  I do have M5 data though . . .  lets see what happens . . .


Thanks for the trouble! Highly appreciated!

Your results agree with my one MT4 terminal, but differs of course from the other one greatly. I suspect your data is tick data that was downloaded from a reliable source?

So can I assume that backtests made with data from a broker and that from reliable tick data could TOTALLY differ from each other? Even if the EA is not a scalper and uses an Hour timeframe and StopLoss of 80 and Profit Take of 230?

By the way, I get far more reliable results after I changed CCI  from shift=0 to shift=1. THANKS for that hint!!!!

(Phi.nuts has been VERY quiet! I was hoping he could put more light on the possible problems than just a Print statement in a less acceptable place!)

 
ernest02:

Thanks for the trouble! Highly appreciated!

Your results agree with my one MT4 terminal, but differs of course from the other one greatly. I suspect your data is tick data that was downloaded from a reliable source?

So can I assume that backtests made with data from a broker and that from reliable tick data could TOTALLY differ from each other? Even if the EA is not a scalper and uses an Hour timeframe and StopLoss of 80 and Profit Take of 230?

The data I used was my Broker's data,  that's why I didn't have M1 data.  The tick data I have is from 2 different Brokers,  I have some from Dukascopy and some from Pepperstone.   The data I tested your EA with is just the data that comes down from  Broker in the normal course of using MT4 and it is from Go Markets.  You will see differences in data from Broker to Broker,  that is quite normal.
 
ernest02:

By the way, I get far more reliable results after I changed CCI  from shift=0 to shift=1. THANKS for that hint!!!!

Yep,  that doesn't surprise me at all.  :-)

 

By the way, have you had a play with the Debugging stuff I added to your code ?  

Reason: