Order open error 0, works fine with Brokers ICM and Alpari, but not ODL

 

Hi,

Can anyone assist me with this issue, i have code that has been working fine on ICM, two weeks ago i put the same EA on Alpari and it works fine on there. But yesterday i put it on ODL and it will not open the instant order. it does open the BUYSTOP, The error returned on the instant order is 0. I have shown below the code, and below that is the output from the print statements.

int FreeMagic = FreeMagicNumber();
int HedgeTicketID = 0;
int BaseTicketID = 0;
RefreshRates();
double MyAsk=NormalizeDouble(MarketInfo(Symbol(),MODE_ASK),Digits);
double MyBid=NormalizeDouble(MarketInfo(Symbol(),MODE_BID),Digits);
double HedgeTakeProfit=0;
double BaseStop=0;
double BuyStopOpenPrice = MyAsk + (HedgeStart * Point);
double BuyStopStop = BuyStopOpenPrice - (HedgeStop * Point);
double SellStopOpenPrice = MyBid - (HedgeStart * Point);
double SellStopStop = SellStopOpenPrice + (HedgeStop * Point);

double ThisLotSize=0;


BaseStop = MyBid + (OverallStop * Point);
HedgeTakeProfit = BaseStop;
ThisLotSize=lotManagement();
Print("Base Order = OP_SELL," + ThisLotSize + ", " + MyBid + ", " + Slipage + ", " + (MyBid + OverallStop * Point) + ", " + (MyBid - Profit * Point) + " follow =" + UseChart + " TradeNo=" + FreeMagic + " Base");
BaseTicketID = OrderSend(Symbol(), OP_SELL, ThisLotSize, MyBid,Slipage, MyBid + OverallStop * Point, MyBid - Profit * Point, "follow =" + UseChart + " TradeNo=" + FreeMagic + " Base", UseChart + MAGICMABase + FreeMagic, 0, Red);
HedgeTicketID = OrderSend(Symbol(), OP_BUYSTOP, ThisLotSize, BuyStopOpenPrice,Slipage, BuyStopStop, HedgeTakeProfit, "follow =" + UseChart + " TradeNo=" + FreeMagic + " Hedge", UseChart + MAGICMABase + FreeMagic, 0, Blue);

if (BaseTicketID <=0)
{Alert("Base Not Opened error = " + GetLastError());

PRINT STATEMENTS:

2010.01.13 08:51:18 Follow_Enigma_Build_5 GBPJPY,M15: Base Order = OP_SELL,1.00000000, 148.06900000, 100.00000000, 158.06900000, 145.56900000 follow =15 TradeNo=0 Base
2010.01.13 08:51:18 Follow_Enigma_Build_5 GBPJPY,M15: Alert: Base Not Opened error = 0

Thanks in advance

i know most order open errors are silly ones, but this has me completley confused.

 

B

IIRC, ODL is an ECN broker so you cannot put SL or TP on with the initial order, you put the order on without these and do an OrderModify on next tick

I think Alpari is straight through but not ECN so does take SL & TP with an initial order

Good Luck

-BB-

 

Thank you for your help

Bremsford

 

Can you detect an ECN broker then in code?

 

B

> Can you detect an ECN broker then in code?

Only by trying to place, e.g. a pending order with SL & TP and trapping the error!

I would not recommend that!

Its usual to have a bool extern that allows the EA to be used on ECN

So if the ECNbroker == true, dont put the SL & TP on with order, etc..

-BB-

Reason: