- Domov
- Komunita
- Programovanie
- backtest/live issues with 5 digit broker
Edit Your Comment
backtest/live issues with 5 digit broker
Členom od Jul 26, 2011
4 príspevkov
Aug 15, 2011 at 18:34
Členom od Jul 26, 2011
4 príspevkov
I am a mildly experienced trader backtesting and demo testing a number of eas. There are a few that I have downloaded off of MT4's website. I am able to backtest them but then when I try to run them in real time on a demo account, no trades are executed.
I think the issue has to do with my broker (FXCM) and the OrderSend command. Does anyone have experience modifying EA's to change the OrderSend command to accomodate a 5 digit broker?
Does anyone have any experience with this issue? I appreciate any help or comments thank you!
Členom od Jun 09, 2011
186 príspevkov
Aug 15, 2011 at 21:28
Členom od Jun 09, 2011
186 príspevkov
FXCM uses ecn, you need to change the OrderSend Functions' TakeProfit and Stoploss to 0 then use a OrderModify function to key in those values. An example for a sell command would be:
int t;
t = OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,0,0,Comment_Message,Magic,0,Red);
if (t > 1){
if (OrderSelect(t, SELECT_BY_TICKET))OrderModify(OrderTicket(),OrderOpenPrice(),Bid + Stoploss*Point,Bid - Takeprofit*Point,0,Red );
else Print('OrderModify() ticket=',t,' failed with error code ',GetLastError());
}
else Print('OrderSend ticket=',t,' failed with error code ',GetLastError());
If you still need further help on this, just drop me a message.
int t;
t = OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,0,0,Comment_Message,Magic,0,Red);
if (t > 1){
if (OrderSelect(t, SELECT_BY_TICKET))OrderModify(OrderTicket(),OrderOpenPrice(),Bid + Stoploss*Point,Bid - Takeprofit*Point,0,Red );
else Print('OrderModify() ticket=',t,' failed with error code ',GetLastError());
}
else Print('OrderSend ticket=',t,' failed with error code ',GetLastError());
If you still need further help on this, just drop me a message.
http://www.freeforexrebates .info
Členom od Jul 26, 2011
4 príspevkov
Aug 17, 2011 at 06:25
Členom od Jul 26, 2011
4 príspevkov
Thank you tigpips!
I've modified the code to take care of the Ordersend and the EA is now performing live trades on FXCM.
I really appreciate the help, I'll be sure to pass on the knowledge.
Thanks again.
~TJS
I've modified the code to take care of the Ordersend and the EA is now performing live trades on FXCM.
I really appreciate the help, I'll be sure to pass on the knowledge.
Thanks again.
~TJS
*Komerčné použitie a spam nebudú tolerované a môžu viesť k zrušeniu účtu.
Tip: Uverejnením adresy URL obrázku /služby YouTube sa automaticky vloží do vášho príspevku!
Tip: Zadajte znak @, aby ste automaticky vyplnili meno používateľa, ktorý sa zúčastňuje tejto diskusie.