Same EA, dosn't work for all forex demo's ?!

 
Hi Guys,

Currently I am evaluating two forex companies.
One is Alpari and the other is FXCM

I wrote my script while using Alpari demo, the script used all it's functions but when I installed FXCM demo,
some parts of the script did not perform the same (or at all) as it was with Alpari demo.

The FXCM support says something about a 'bridge' they use to make MT4 work for them.
As far as I understood, they needs some sort of intermediate between my MT4 and their trading system.

Does anyone else has experienced such effect on their EA script with FXCM?

For Example: I included my 'boolinger hunter', that work with Alpari demo but doesn't work at all with FXCM demo

Thank you,

James

// ----------------| The next code hunts for turning points on the edge of the boolingers and shoots an immediate order  |-----------------------
double U_bool=iBands(NULL,PERIOD_M15,20,2,0,PRICE_CLOSE,MODE_UPPER,1),
       L_bool=iBands(NULL,PERIOD_M15,20,2,0,PRICE_CLOSE,MODE_LOWER,1);

if (iBands(NULL,PERIOD_M15,20,2,0,PRICE_CLOSE,MODE_UPPER,0)-iBands(NULL,PERIOD_M15,20,2,0,PRICE_CLOSE,MODE_LOWER,0)>=20*POINT)
   {
   int pierce=0;
   double lots=MathFloor(AccountBalance()/100)/100;

   if (high[1]>=U_bool&&MathAbs(Bid-U_bool)<MathAbs(Bid-L_bool)) pierce=-1;  // pierced the upper boolinger
   if (low[1]<=L_bool&&MathAbs(Bid-U_bool)>MathAbs(Bid-L_bool)) pierce=1; // pierced the lower boolinger
   comment=StringConcatenate ("#1 Bool_pierce = ",pierce);

   if (block==0&&pierce==1&&iLow(NULL,PERIOD_M5,0)>iBands(NULL,PERIOD_M15,20,2,0,PRICE_CLOSE,MODE_LOWER,0))
      {
      if(iLow(NULL,PERIOD_M5,0)>iLow(NULL,PERIOD_M5,1)&&iHigh(NULL,PERIOD_M5,0)>iHigh(NULL,PERIOD_M5,1)&&block==0)
         {
         block=1;
         OrderSend(NULL,OP_BUY,lots,Ask,3,0,0,comment,16384,0,Orange);   //BUY
         Print (Symbol(),": Buy Boolinger on ",Ask);
//         Sleep (5000);
         }
      }

   if (block==0&&pierce==-1&&iHigh(NULL,PERIOD_M5,0)<iBands(NULL,PERIOD_M15,20,2,0,PRICE_CLOSE,MODE_UPPER,0))
      {
      if(iHigh(NULL,PERIOD_M5,0)<iHigh(NULL,PERIOD_M5,1)&&iLow(NULL,PERIOD_M5,0)<iLow(NULL,PERIOD_M5,1)&&block==0)
         {
         block=1;
         OrderSend(NULL,OP_SELL,lots,Bid,3,0,0,comment,16384,0,Orange);   //SELL
         Print (Symbol(),": Sell Boolinger on ",Bid);
//         Sleep (5000);
         }
      }
   }

 
See here for how to make the Ordersend work with an ECN broker, or more to the point, how to make EA market ordering compatible with all brokers. WHRoeder has lots of posts on this too, and his code helped me heaps. Search for OrderSend and ECN broker.
 
midworld08:
See here for how to make the Ordersend work with an ECN broker, or more to the point, how to make EA market ordering compatible with all brokers. WHRoeder has lots of posts on this too, and his code helped me heaps. Search for OrderSend and ECN broker.

Hi, midworld08

Two comments to your reply.

1. Isn't Alpari an ECN broker? (just like FXCM)

2. on the article you refered me to, it says that on ECN systems,
one have to place the order without SL nor TP and later add them through an ordermodify() function.

Well, this is exactly what I am doing with my EA.
Still, the Order doesn't shoot.

James
 

I think Alpari is a special case, they let you set SL and TP when you place an order . . they are not a typical ECN broker.

You need to add some debugging to your code to determine what exactly is not working . . . do the orders fail or does the code simply not try to place them ? you need to trap all errors and react accordingly . . do you gate any errors in the Experts tab ?

 

Sorry hadn't noticed the format of the ordersend, sorry. You'll have to ask someone else about Alpari. I know people use it to stress test there EA's as the Demo is very unreliable. I do use FXCM, and my order goes through with the code you have seen on that post. As RaptorUK has said, add in some error checking, or check out the EA journal and post what the error actually is that is being returned. If there is not an error in the journal tab, then check the log file in mt4->experts->logs. I've had a situation that if the journal sees too many entries too quickly it misses some of them in the journal tab, but all of them are written to the log file.

 

guys,, all of you talking about coding...

would you give me advice... where i can learn (at least) basic coding for mt4???

i have my own strategy but i am blind about coding.. is there any website that help use to make EA with visual?? so, i no need to learn about coding??

(sorry.. a little bit run from the topic) but.... i want to learn... i am so late.. i just know this great EA information from here... so.. i need to learn fast.. :)

thank you :)

 
achun:

guys,, all of you talking about coding...

would you give me advice... where i can learn (at least) basic coding for mt4???


Here: https://book.mql4.com//

Here: https://docs.mql4.com//

 
If you want something visual, try something like Molanis. Its not my cup of tea, but a few friends use it and they like it. There is quite a few of these around, nothing free though to my knowledge.
Reason: