Re: Simple Expert Advisors (EA's) for MT4

41
mrtools wrote:This a simple non lag ma EA my main focus on back testing was on the filter and the EA seemed to perform better when using the filter, but that's just preliminary testing. The non lag ma is the indicator used by the EA it needs to be in mt4 indicators folder.


 
These users thanked the author mrtools for the post (total 2):
mucumba, 太虚一毫


Re: Simple Expert Advisors (EA's) for MT4

43
borgesr wrote:Hi Mrtoosl / Mladen,
I would like to use EA Simple non lag ma ea  in the offline graph generated by the HA smoothed offline 3.09 indicator

Is it necessary to make the adjustment so that a EA works in Offline chart?
Do you have any EA specifically made for Renko Chart?


Thank you,
Rogério
Rogerio, far as I'm aware of, it will work on ha offline charts, best to try it on a demo account first though

Re: Simple Expert Advisors (EA's) for MT4

44
Hi borgesr
In response to your post
here is one version ,i have not tried but i think it is what you looking for,some description here and the rest users can read PDF (included)

   
Indicator is just a tool.

Use it only if it can benefit you. Leave it if you don't know how to use it optimally.


Re: Simple Expert Advisors (EA's) for MT4

47
Hi,
I have not found the code for partial closing on more than 1 level.
See the example below for only 1 partial close


Code: Select all

// ----- Partial Closeextern string ptcInputs = "===== Partial Close settings: =====";
extern double PartCloseTgt = 15; // Partial Close Target in pips
extern double PartClosePct = 50; // Partial Close Position Percent
Pct1 = 0.01*PartClosePct;
Tgt1 = PartCloseTgt;void PartClose() 
{
 double Profit, pLots = 0;
 
 lot_step = MarketInfo(Symbol(),MODE_LOTSTEP); 
 
 for(int cnt=0;cnt<OrdersTotal();cnt++)
 { 
 if(!OrderSelect(cnt, SELECT_BY_POS)) continue; 
 if(OrderSymbol() != Symbol() || OrderMagicNumber() != ipiMagic) continue; 
 
 if(OrderType() == OP_BUY)
 {
 Profit = (MarketInfo(Symbol(),MODE_BID) - OrderOpenPrice())/gldPoint;
 
 if(Profit >= Tgt1 && Tgt1 > 0)
 {
 pLots = MathMin(OrderLots(),MathCeil(Pct1 * OrderLots()/lot_step)*lot_step); 
 if(pLots >= lot_min) 
 { 
 CloseAtMarket(OrderTicket(),pLots,Aqua); 
 
 }
 
 } 
 
 } 
 
 if (OrderType() == OP_SELL)
 { 
 Profit = (OrderOpenPrice() - MarketInfo(Symbol(),MODE_ASK))/gldPoint;
 
 if(Profit >= Tgt1 && Tgt1 > 0) 
 {
 
 pLots = MathMin(OrderLots(),MathCeil(Pct1*OrderLots()/lot_step)*lot_step);
 if(pLots >= lot_min) 
 {
 CloseAtMarket(OrderTicket(),pLots,Pink); 
 
 }
 
 } 
 
 
 } 
 }
 
 
} 
bool CloseAtMarket(int ticket,double lot,color clr) 
{
 bool result = false; 
 double price; 
 
 int tries=0;
 while(!result && tries < TriesNum) 
 {
 RefreshRates();
 
 price = NormalizeDouble(OrderClosePrice(),Digits);
 result = OrderClose(ticket,lot,price,dRatio*Slippage,clr);
 
 if (!result) 
 {
 Print("Error closing order : ",ErrorDescription(GetLastError())," ticket=",ticket," lot=",lot," Price=",price);
 Sleep(5000);
 }
 
 tries++;
 }
 
 return(result);
}


Who is online

Users browsing this forum: Amazon [Bot], ChatGPT [Bot], Grapeshot [Bot], SijjiN and 97 guests