| / | Forum |
|
Ilovepippin
2009.10.16 21:51
I have programmed an EA and at certain pairs at certain timeframes it is profitable. I basically took the MT4 standard ea and changed the algorithm a bit, took out the lot sizing due to "130" errors. I can set a SL but I want the stoploss to go to breakeven as soon as I am X pips in the plus. Right now the EA is losing 6 trades to 1 win. However r/r is very large so it is still winning some, but need to control the losses. I can run a separate trade manager EA, but rather have it included in this EA. Also on the wish list is a max drawdown and %risk based on account balance. However, see the file for more info on the code. EDIT: Ideally the EA would open multiple lots all with a different target (e.g., 3 lots with 100, 200 and 300 pips take profit). |
|
Changing the External Parameters of MQL4 Programs without Restarting The article describes a method of changing the external parameters of MQL4 programs on-the-fly, without restarting. |
|
Bauer_Boy
2009.10.16 23:58
When you send your orders, use: uselots = lots/2; ticket = OrderSend(Symbol(), OP_BUY, uselots, NormalizeDouble(Ask,4), slippage, realSL, realTP, nameEA, 16384,0,Red); Then, when you're checking your orders: if(totalOrders ==1) { OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(), OrderTakeProfit(),0,Blue); } Have a TP on the first order of X pips, and when it is hit, you'll only have one order on and modify that order so that the SL = the Order Open Price |
|
Ilovepippin
2009.10.17 16:17
Bauer_Boy:
When you send your orders, use: uselots = lots/2; ticket = OrderSend(Symbol(), OP_BUY, uselots, NormalizeDouble(Ask,4), slippage, realSL, realTP, nameEA, 16384,0,Red); Then, when you're checking your orders: if(totalOrders ==1) { OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(), OrderTakeProfit(),0,Blue); } Have a TP on the first order of X pips, and when it is hit, you'll only have one order on and modify that order so that the SL = the Order Open Price Thank you for your help. I'll make this ea available on www.mywavez.net for download if you want a copy. Thanks! |