can anyone chnage this to market execution

 

hi i have the following EA,, it only trading on "instant execution " brokers and 4 digit brokers .. can any one chnage this to trade on market execution and 5 pip brokers?

this is is instant execution broker, it can able to place tp and sl at the time of trade execution... since we have to place tp and sl only after the order executed and then you need to modify that order to place tp an sl, its not working in ecn or market execution broker..

can any one modify this code to work with market execution brokers (5 digit)?

thanks

/*
  
*/
#property copyright "Copyright ©2012 Fxmaster999"
#property link      "http://abc.com"

extern int MinPrfofit = 1;
extern int MaxLoss = 10;
extern int Delta = 3;
extern int BB_Period = 1;
extern int BB_Deviation = 2;
extern bool FixLotMM = TRUE;
extern double FixLotSize = 1.0;
extern double RiskPercent = 10.0;
extern int Slippage = 20;
extern string Comm = ".";
bool gi_128 = TRUE;
int g_magic_132;
int gi_unused_136;
double g_stoplevel_140;
double g_spread_148;
double g_maxlot_156;
double g_minlot_164;
double g_lotstep_172;
double g_lots_180;
double gd_188;

int init()
{ 
//Checking for unconventional Point digits number
   if (Point == 0.0001) Poin = 0.00001; //5 digits
   else if (Point == 0.001) Poin = 0.01; //3 digits
   else Poin = Point; //Normal
   return(0);
}


int init() {
   gi_unused_136 = 0;
   g_magic_132 = StringGetChar(Symbol(), 0) + 77704 + StringGetChar(Symbol(), 1) * 2 + 3 * StringGetChar(Symbol(), 3) + StringGetChar(Symbol(), 4) << 2 + 100000 * Period();
   g_stoplevel_140 = MarketInfo(Symbol(), MODE_STOPLEVEL);
   g_spread_148 = MarketInfo(Symbol(), MODE_SPREAD);
   g_maxlot_156 = MarketInfo(Symbol(), MODE_MAXLOT);
   g_minlot_164 = MarketInfo(Symbol(), MODE_MINLOT);
   g_lotstep_172 = MarketInfo(Symbol(), MODE_LOTSTEP);
   HideTestIndicators(TRUE);
   return (0);
}

int start() {
   string ls_0;
   double l_price_8;
   double l_price_16;
   double ld_24;
   bool li_32;
   bool li_36;
   if (gi_128) {
      ls_0 = "forex master999";
      Comment(ls_0);
   }
   if (!IsTradeAllowed()) {
      Comment("Error:  connection failed");
      return (0);
   }
   Comment("");
   if (FixLotMM) g_lots_180 = FixLotSize;
   else g_lots_180 = AccountFreeMargin() / 1000.0 * (RiskPercent / 100.0);
   if (g_lots_180 < g_minlot_164) g_lots_180 = g_minlot_164;
   else {
      if (g_lots_180 > g_maxlot_156) g_lots_180 = g_maxlot_156;
      else {
         for (gd_188 = g_minlot_164; gd_188 <= g_lots_180; gd_188 += g_lotstep_172) {
         }
         g_lots_180 = gd_188 - g_lotstep_172;
      }
   }
   for (int l_pos_40 = OrdersTotal() - 1; l_pos_40 >= 0; l_pos_40--) {
      OrderSelect(l_pos_40, SELECT_BY_POS);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != g_magic_132) continue;
      if (OrderType() == OP_BUY) {
         ld_24 = Bid - OrderOpenPrice();
         if ((MinPrfofit > 0 && ld_24 >= MinPrfofit * Poin) || (MaxLoss > 0 && ld_24 <= (-1 * MaxLoss) * Poin)) {
            OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, Purple);
            return (0);
         }
      }
      if (OrderType() == OP_SELL) {
         ld_24 = OrderOpenPrice() - Ask;
         if ((MinPrfofit > 0 && ld_24 >= MinPrfofit * Poin) || (MaxLoss > 0 && ld_24 <= (-1 * MaxLoss) * Poin)) {
            OrderClose(OrderTicket(), OrderLots(), Ask, Slippage, Red);
            return (0);
         }
      }
      return (0);
   }
   double l_ibands_44 = iBands(Symbol(), 0, BB_Period, BB_Deviation, 0, PRICE_OPEN, MODE_UPPER, 0);
   double l_ibands_52 = iBands(Symbol(), 0, BB_Period, BB_Deviation, 0, PRICE_OPEN, MODE_LOWER, 0);
   if (Close[0] > l_ibands_44 + Delta * Poin) li_36 = TRUE;
   else li_36 = FALSE;
   if (Close[0] < l_ibands_52 - Delta * Poin) li_32 = TRUE;
   else li_32 = FALSE;
   if (li_32) {
      if (MaxLoss == 0) l_price_8 = 0;
      else l_price_8 = Ask - (MaxLoss + g_stoplevel_140) * Poin;
      if (MinPrfofit == 0) l_price_16 = 0;
      else l_price_16 = Ask + (MinPrfofit + g_stoplevel_140 + g_spread_148) * Poin;
      ticket=OrderSend(Symbol(),OP_SELL,1, g_minlot_164, Bid, Slippage, 0,0,0,"My order #2",16384,0,Green);
if(ticket>0)
{
OrderSelect(ticket,SELECT_BY_TICKET);
OrderModify(OrderTicket(),OrderOpenPrice(),l_price_8, l_price_16,0,Green);
}
else
{
Print("OrderSend failed with error #",GetLastError());
}
}
   if (li_36) {
      if (MaxLoss == 0) l_price_8 = 0;
      else l_price_8 = Bid + (MaxLoss + g_stoplevel_140) * Poin;
      if (MinPrfofit == 0) l_price_16 = 0;
      else l_price_16 = Bid - (MinPrfofit + g_stoplevel_140 + g_spread_148) * Poin;
      
   ticket=OrderSend(Symbol(),OP_SELL,1, g_minlot_164, Bid, Slippage, 0,0,0,"My order #2",16384,0,Green);
if(ticket>0)
{
OrderSelect(ticket,SELECT_BY_TICKET);
OrderModify(OrderTicket(),OrderOpenPrice(), l_price_8, l_price_16,0,Red);
}
else
{
Print("OrderSend failed with error #",GetLastError());
}
}
   return (0);
}

 
Looks like DECOMPILED code to me . . .
 

yes it is... this can be done?

 

kindly consider to change this

 
DO NOT POST DECOMPILED (Stolen) CODE
 
ajitreddy123:
yes it is...

Yep, decompiled code, STOLEN from someone. Either you are a thief or the receiver of stolen code. If you paid for it, return it and try to get your money back.

Either way no one should help you with it. Contact the original owner of the code, beg forgiveness, and ask how much for the EA with the modification.

Reason: