Help with MT EA - page 2

 

OK, I'll give you a little help using WHRoeder's code just to show that it does actually does work very well, then if make a grovelling apology maybe you will get some more help.

You can follow this example, if you want, and adjust the other TPs, SLs and Slippage . . .

extern int Slippage=3;
                               // insert code here

//++++ These are adjusted for 5 digit brokers.
int     pips2points;    // slippage  3 pips    3=points    30=points
double  pips2dbl;       // Stoploss 15 pips    0.0015      0.00150
int     Digits.pips;    // DoubleToStr(dbl/pips2dbl, Digits.pips)

int     init(){
    if (Digits == 5 || Digits == 3){    // Adjust for five (5) digit brokers.
                pips2dbl    = Point*10; pips2points = 10;   Digits.pips = 1;
    } else {    pips2dbl    = Point;    pips2points =  1;   Digits.pips = 0; }
    // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl



//+------------------------------------------------------------------+
//    expert start function
//+------------------------------------------------------------------+
int start()
{
  double MyPoint=Point;
  if(Digits==3 || Digits==5) MyPoint=Point*10;
  
  double TheStopLoss=0;
  double TheTakeProfit=0;
  if( TotalOrdersCount()==0 ) 
  {
     int result=0;
     if((iCustom(NULL,0,"My_Indictor"...,..) > (iCustom(NULL,0,"MY_Indictor"...,..))) // Here is your open buy rule
     {
        result=OrderSend(Symbol(),OP_BUY,AdvancedMM(),Ask,  Slippage * pips2points  ,0,0,"EA Generator www.ForexEAdvisor.com",MagicNumber,0,Blue);  // <--------  adjust like this
        if(result>0)
        {
         TheStopLoss=0;
         TheTakeProfit=0;
         if(TakeProfit>0) TheTakeProfit=Ask+TakeProfit * pips2points;     // <--------  adjust like this     *MyPoint;
         if(StopLoss>0) TheStopLoss=Ask-StopLoss * pips2points;            // <--------  adjust like this             *MyPoint;
         OrderSelect(result,SELECT_BY_TICKET);
         OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(TheStopLoss,Digits),NormalizeDouble(TheTakeProfit,Digits),0,Green);
 
 
1Sword:
I dont see whats so difficult about what i fucking asked raptor
  1. You want the code inserted, fine. I won't bother to tell you where I'd insert it other than it would be painful.
  2. We are here to help, not code it for you. You just want it coded for free and we're not going to do that.
  3. Please do not feed the troll.

    When you respond, you give the troll power. When you ignore the troll, he starves for attention and eventually dies.
    Do not help this person
 
Reason: