Re: now 10K USD account at Dukascopy
do you know that you can copy the order to JForex API?
you could use agent-api dll:
1. put dds2agent.dll into system32 folder for example c:/winnt/system32
2. put dds2agent.mqh into include folder of mt4
3. add the following to your ea: #include <DDS2Agent.mqh>
4. you could then use the functions listed in the DDS2Agent.mqh
ps jforex client must be running
you can check out the Jforex API support forum there. jforexboard.com
exemple code to get the MT4 order to JForex.
#include <DDS2Agent.mqh>
int init(){Print("init..."); return(0);}
int deinit(){Print("deinit..."); return(0);}
double ask_price=0, bid_price=0;
int i, d, counter;
int Lots=1;
int start(){
if (??¦ > 0){
Print("OrderSend...OP_BUY");
i = OrderSend(Symbol(),OP_BUY,Lots,ask_price,0,0,0,"",1999,0,Red);
d = SubmitOrder ("1999", Symbol(), OP_BUY, Lots, ask_price, 0, 0);
}
if (??¦ < 0){
Print("OrderSend...OP_SELL");
i = OrderSend(Symbol(),OP_SELL,Lots,bid_price,0,0,0,"",1999,0,Blue);
d = SubmitOrder("1999",Symbol(),OP_SELL,Lots,bid_price,0,0);
}
for (counter = 0; counter < OrdersTotal(); counter++) {
OrderSelect(counter,SELECT_BY_POS,MODE_TRADES);
if ((OrderMagicNumber() == 1999) && (OrderSymbol() == Symbol())) {
if (OrderType() == OP_BUY) {
i = OrderClose(OrderTicket(),OrderLots(),Bid,10,Red);
d = ClosePosition("1999");
}
if (OrderType() == OP_SELL) {
i = OrderClose(OrderTicket(),OrderLots(),Ask,10,Blue);
d = ClosePosition ("1999");
}
}
}
return(0);
}