EA Breaks on VPS

 
Hi Guys,

This is my first post. But have been browsing this forum for a long time. I believe till date I must have searched this forum for more than 100 queries, and I found an answer to almost all of them. But I think this is one hell of a problem I am facing and no one seems to have a solution for this.

I have attached an EA below, it is a very simple script which scans 30 pairs and lets me know the output via Alerts. It looks at the DeMarker Indicator and if it is below 30 it gives me a buy for that pair and if it is above 70 it gives me a sell for that pair. Now this is where my problem starts;

When I run this script on my local comp it gives me exactly the same output as I want it to but on the VPS it gives a different output or just doesn't work at all. It behaves irrationally;
1. If the first pairs shows a buy then all others will show a buy and vice-versa. The code is absolutely correct, the VPS guys have checked it already.
2. It has been programmed to run on a new candle so when a new candle comes in either it will give me the output as in Point 1 or it wont give me any output saying it has scanned and was unable to find any relevant opportunity.

How you can help.
1. Firstly, your advice as to where do you think the problem is much appreciated.
2. Please download this script and run it on your local comp and post the output. Does the script run perfectly i.e. it outputs exactly what it is supposed to or it tags all pairs with a single B (Buy) or S (Sell).

And no I am not using a small VPS Hosting Company it is myforexvps.com. Even they are going bonkers fixing this one. This problem is there for over a month lets say from the time I got the VPS and I used to blame my coding skills all the time but now when it is evident, I am really sad as to the number of opportunities and the time I have wasted on this one.

P.S. This is not the original scanner I use but a very small subset which lets me test the problem on the VPS.

Best,
OneFineDay
Files:
 

Just off the top of my head, I suspect that it is not recognising the symbols on your VPS. Are you sure that it is configured exactly the same as your home computer. So the broker is the same, with the same symbol suffix? Have you selected "Show All" symbols on the market watch panel?

From the code, it would appear that if it does not recognise the symbol, instead of returning an error, it returns a value....and that value is carried through the entire loop, over and over which would explain why you are getting repeats of the same instruction irrespective of what the result should be.

 
Kenny thanks for this. Yeah the broker is the same even the account :) And Show All is selected. There has to be something else though not sure and no one can figure that out. Will ask these guys to change my VPS account im really fed up now.

This is just a small one which is not working, I wonder how will it be able to run the massive EA scanner I had designed :(

anymore thoughts guys ?
 
Maybe because u have a different amount of history data for each symbol in your computer and on the VPS?
 
gordon:
Maybe because u have a different amount of history data for each symbol in your computer and on the VPS?


Gordon how will that affecting basic things like an Alert pop-up ? Please explain, it would be helpful.
 
onefineday:
Gordon how will that affecting basic things like an Alert pop-up ? Please explain, it would be helpful.

The alert is triggered by the value returned from iDeMarker() which is evaluated from history data... It's just a wild guess though; I don't know if that's the cause.

 
Nops that ain't the issue either ?? Guys anyone please ?? I really need this to work for me.
 

Ok try this script.

I have taken care of the bars in chart and the suffix issue, just to be sure. The basic code of checking the Demarker value and showing the result is solid. The reason that it would give you erratic results is that the DeMarker value is not correct, so lets try and isolate it to that particular issue. Once we have proven to ourselves that this is the problem, we can start to get to the bottom of why it is returning the incorrect value. It appears that when there is an error, it returns a zero value which your code interprets as a Buy command.

I have included some Print statements in the code to make debugging a bit easier. Please check the experts tab after running and perhaps give us an idea of the feedback the code is giving you there. This will anable us to narrow the problem down.

I am also interested in why you reckon the problem lies with the VPS as I would never have thought that this could be a problem?

 
kennyhubbard:

Ok try this script.

I have taken care of the bars in chart and the suffix issue, just to be sure. The basic code of checking the Demarker value and showing the result is solid. The reason that it would give you erratic results is that the DeMarker value is not correct, so lets try and isolate it to that particular issue. Once we have proven to ourselves that this is the problem, we can start to get to the bottom of why it is returning the incorrect value. It appears that when there is an error, it returns a zero value which your code interprets as a Buy command.

I have included some Print statements in the code to make debugging a bit easier. Please check the experts tab after running and perhaps give us an idea of the feedback the code is giving you there. This will anable us to narrow the problem down.

I am also interested in why you reckon the problem lies with the VPS as I would never have thought that this could be a problem?

Thanks Kenny, appreciate it. I shifted ur code to init so currently the result matches the one on my localcomp but I wonder if it will be the scene once the market opens on Monday. Will keep you posted.

P.S. Trust me for me now this one is a no brainer, even a simple thing like MA Scans are not working and giving me weird output. I have checked everything at my end but now when I can see different outputs on the VPS and on my local comp, this is clear to me that the problem is in the VPS. Maybe its broken. Guys at myforexvps are also working with me on this but they were also unable to isolate the problem. Lets see, probably next week I should have something to share in terms of the problem.

Best,
OFD
 
Finally, thought might update you guys. Incase anyone faces a similar problem going forward. Looks like on some accounts the EA was not working and it was a broker issue, not sure why. I had written to them but no response. Seems like in my MICRO account EA was disabled and in some demo accounts as well.

Got it running on a demo account it seems to be working fine now. My broker is FxOpen.
Reason: