Jump to content

REQ - convert funnel to ECN


awsl

Recommended Posts

would someone help to convert this ea to 5 digit and ecn compatible, thank you!

 

Below are the codes:

 

/*

Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []

Website: http://purebeam.biz

E-mail : [email protected]

*/

#property copyright "Copyright ForexFunnel"

#property link ""

 

extern double Lots = 0.1;

extern bool quotes_from_broker = FALSE;

int gi_88 = 35;

int gi_92 = 1000;

extern bool Use_time = FALSE;

extern bool Sunday = TRUE;

extern bool Monday = TRUE;

extern bool Tuesday = TRUE;

extern bool Wednesday = TRUE;

extern bool Thursday = TRUE;

extern bool Friday = TRUE;

extern bool Saturday = TRUE;

int gi_128 = 25;

int gi_132 = 20;

int gi_136 = 20;

int gi_140 = 20;

int gi_144 = 20;

int gi_148 = 20;

int gi_152 = 25;

int gi_156 = 20;

int gi_160 = 25;

int gi_164 = 25;

int gi_168 = 20;

int gi_172 = 25;

int gi_176 = 20;

int gi_180 = 20;

int gi_184 = 20;

int gi_188 = 20;

int gi_192 = 20;

int gi_196 = 20;

int gi_200 = 25;

int gi_204 = 30;

int g_slippage_208 = 3;

int gi_unused_212 = 2;

int gi_216 = 0;

int gi_220 = 24;

extern int magic_nr = 4290;

bool gi_228 = FALSE;

bool gi_232 = FALSE;

double g_lots_236 = 0.0;

 

int init() {

if (quotes_from_broker) g_lots_236 = 100000.0 * Lots;

else g_lots_236 = Lots;

return (0);

}

 

int start() {

double l_price_0;

double l_price_8;

double l_price_16;

double l_lots_24;

double l_pips_32;

double l_pips_40;

int l_ticket_48 = 0;

int l_ticket_52 = 0;

int l_ticket_56 = 0;

int l_ticket_60 = 0;

int l_ticket_64 = 0;

int l_ticket_68 = 0;

double l_ord_lots_72 = 0;

double l_ord_lots_80 = 0;

double l_ord_open_price_88 = 0;

double l_ord_open_price_96 = 0;

double l_ord_takeprofit_104 = 0;

double l_ord_takeprofit_112 = 0;

double ld_unused_120 = 0;

double l_ord_lots_128 = 0;

double ld_unused_136 = 0;

double l_ord_lots_144 = 0;

double ld_152 = 0;

double ld_160 = 0;

gi_232 = FALSE;

if (Use_time == TRUE) {

switch (DayOfWeek()) {

case 0:

if (Sunday == TRUE) gi_232 = TRUE;

break;

case 1:

if (Monday == TRUE) gi_232 = TRUE;

break;

case 2:

if (Tuesday == TRUE) gi_232 = TRUE;

break;

case 3:

if (Wednesday == TRUE) gi_232 = TRUE;

break;

case 4:

if (Thursday == TRUE) gi_232 = TRUE;

break;

case 5:

if (Friday == TRUE) gi_232 = TRUE;

break;

case 6:

if (Saturday == TRUE) gi_232 = TRUE;

}

} else gi_232 = TRUE;

for (int l_pos_172 = 0; l_pos_172 < OrdersTotal(); l_pos_172++) {

OrderSelect(l_pos_172, SELECT_BY_POS, MODE_TRADES);

if (OrderSymbol() == Symbol() && OrderMagicNumber() == magic_nr) {

if (OrderType() == OP_BUY && l_ticket_48 < OrderTicket()) {

l_ord_lots_72 = OrderLots();

l_ord_open_price_88 = OrderOpenPrice();

l_ticket_48 = OrderTicket();

l_ord_takeprofit_112 = OrderTakeProfit();

if (OrderLots() == g_lots_236) ld_152 = OrderOpenPrice() - gi_92 * Point;

}

if (OrderType() == OP_SELL && l_ticket_52 < OrderTicket()) {

l_ord_lots_80 = OrderLots();

l_ord_open_price_96 = OrderOpenPrice();

l_ticket_52 = OrderTicket();

l_ord_takeprofit_104 = OrderTakeProfit();

if (OrderLots() == g_lots_236) ld_160 = OrderOpenPrice() + gi_92 * Point;

}

if (OrderType() == OP_BUYLIMIT) {

l_ticket_56 = OrderTicket();

l_ord_lots_144 = OrderLots();

}

if (OrderType() == OP_SELLLIMIT) {

l_ticket_60 = OrderTicket();

l_ord_lots_144 = OrderLots();

}

if (OrderType() == OP_BUYSTOP) {

l_ticket_64 = OrderTicket();

l_ord_lots_128 = OrderLots();

}

if (OrderType() == OP_SELLSTOP) {

l_ticket_68 = OrderTicket();

l_ord_lots_128 = OrderLots();

}

}

}

if (l_ticket_48 == 0) {

if (l_ticket_56 != 0) OrderDelete(l_ticket_56);

if (l_ticket_64 != 0) OrderDelete(l_ticket_64);

l_price_8 = Ask - gi_92 * Point;

if (gi_92 <= 0) l_price_8 = 0;

l_price_16 = Ask + gi_88 * Point;

if (TimeHour(TimeCurrent()) >= gi_216 && TimeHour(TimeCurrent()) < gi_220 && gi_232) OrderSend(Symbol(), OP_BUY, g_lots_236, Ask, g_slippage_208, l_price_8, l_price_16, "magic_nr = " + magic_nr, magic_nr, 0, CLR_NONE);

}

if (l_ticket_52 == 0) {

if (l_ticket_60 != 0) OrderDelete(l_ticket_60);

if (l_ticket_68 != 0) OrderDelete(l_ticket_68);

l_price_8 = Bid + gi_92 * Point;

if (gi_92 <= 0) l_price_8 = 0;

l_price_16 = Bid - gi_88 * Point;

if (TimeHour(TimeCurrent()) >= gi_216 && TimeHour(TimeCurrent()) < gi_220 && gi_232) OrderSend(Symbol(), OP_SELL, g_lots_236, Bid, g_slippage_208, l_price_8, l_price_16, "magic_nr = " + magic_nr, magic_nr, 0, CLR_NONE);

}

if (l_ticket_48 != 0 && l_ticket_56 == 0) {

l_pips_40 = Finalinc(l_ord_lots_72);

l_pips_32 = FinalincNr(l_ord_lots_72);

l_price_0 = l_ord_open_price_88 + l_pips_40 * Point;

if (gi_228 == FALSE) l_price_8 = l_price_0 - gi_92 * Point;

else l_price_8 = ld_152;

if (gi_92 <= 0) l_price_8 = 0;

l_price_16 = l_price_0 - l_pips_32 * Point;

l_lots_24 = NormalizeDouble(2.0 * l_ord_lots_72, l_pips_32);

if (gi_232) OrderSend(Symbol(), OP_BUYLIMIT, l_lots_24, l_price_0, g_slippage_208, l_price_8, l_price_16, "magic_nr = " + magic_nr, magic_nr, 0, CLR_NONE);

}

if (l_ticket_52 != 0 && l_ticket_60 == 0) {

l_pips_40 = Finalinc(l_ord_lots_80);

l_pips_32 = FinalincNr(l_ord_lots_80);

l_price_0 = l_ord_open_price_96 + l_pips_40 * Point;

if (gi_228 == FALSE) l_price_8 = l_price_0 + gi_92 * Point;

else l_price_8 = ld_160;

if (gi_92 <= 0) l_price_8 = 0;

l_price_16 = l_price_0 - l_pips_32 * Point;

l_lots_24 = NormalizeDouble(2.0 * l_ord_lots_80, l_pips_32);

if (gi_232) OrderSend(Symbol(), OP_SELLLIMIT, l_lots_24, l_price_0, g_slippage_208, l_price_8, l_price_16, "magic_nr = " + magic_nr, magic_nr, 0, CLR_NONE);

}

if (l_ticket_48 != 0 && l_ticket_64 == 0) {

l_pips_40 = Finalinc(l_ord_lots_72);

l_pips_32 = FinalincNr(l_ord_lots_72);

l_price_0 = l_ord_open_price_88 + l_pips_32 * Point;

if (gi_228 == FALSE) l_price_8 = l_price_0 + gi_92 * Point;

else l_price_8 = ld_152;

if (gi_92 <= 0) l_price_8 = 0;

l_price_16 = l_price_0 + l_pips_32 * Point;

l_lots_24 = NormalizeDouble(2.0 * l_ord_lots_72, l_pips_32);

if (gi_232) OrderSend(Symbol(), OP_BUYSTOP, l_lots_24, l_price_0, g_slippage_208, l_price_8, l_price_16, "magic_nr = " + magic_nr, magic_nr, 0, CLR_NONE);

}

if (l_ticket_52 != 0 && l_ticket_68 == 0) {

l_pips_40 = Finalinc(l_ord_lots_80);

l_pips_32 = FinalincNr(l_ord_lots_80);

l_price_0 = l_ord_open_price_96 - l_pips_40 * Point;

if (gi_228 == FALSE) l_price_8 = l_price_0 - gi_92 * Point;

else l_price_8 = ld_160;

if (gi_92 <= 0) l_price_8 = 0;

l_price_16 = l_price_0 - l_pips_32 * Point;

l_lots_24 = NormalizeDouble(2.0 * l_ord_lots_80, l_pips_32);

if (gi_232) OrderSend(Symbol(), OP_SELLSTOP, l_lots_24, l_price_0, g_slippage_208, l_price_8, l_price_16, "magic_nr = " + magic_nr, magic_nr, 0, CLR_NONE);

}

for (l_pos_172 = 0; l_pos_172 < OrdersTotal(); l_pos_172++) {

OrderSelect(l_pos_172, SELECT_BY_POS, MODE_TRADES);

if (OrderSymbol() == Symbol() && OrderType() == OP_BUY && l_ticket_48 != 0 && OrderMagicNumber() == magic_nr) {

if (gi_228 == FALSE) l_price_8 = l_ord_open_price_88 - gi_92 * Point;

else l_price_8 = ld_152;

if (gi_92 <= 0) l_price_8 = 0;

if (l_ticket_48 != OrderTicket()) l_price_16 = l_ord_takeprofit_112;

else l_price_16 = OrderTakeProfit();

if (l_price_16 != OrderTakeProfit() || l_price_8 != OrderStopLoss()) OrderModify(OrderTicket(), OrderOpenPrice(), l_price_8, l_price_16, 0, CLR_NONE);

}

if (OrderSymbol() == Symbol() && OrderType() == OP_SELL && l_ticket_52 != 0 && OrderMagicNumber() == magic_nr) {

if (gi_228 == FALSE) l_price_8 = l_ord_open_price_96 + gi_92 * Point;

else l_price_8 = ld_160;

if (gi_92 <= 0) l_price_8 = 0;

if (l_ticket_52 != OrderTicket()) l_price_16 = l_ord_takeprofit_104;

else l_price_16 = OrderTakeProfit();

if (l_price_16 != OrderTakeProfit() || l_price_8 != OrderStopLoss()) OrderModify(OrderTicket(), OrderOpenPrice(), l_price_8, l_price_16, 0, CLR_NONE);

}

}

return (0);

}

 

int Finalinc(double ad_0) {

ad_0 = NormalizeDouble(ad_0 / g_lots_236, 0);

switch (ad_0) {

case 1.0:

return (gi_128);

case 2.0:

return (gi_136);

case 4.0:

return (gi_144);

case 8.0:

return (gi_152);

case 16.0:

return (gi_160);

case 32.0:

return (gi_168);

case 64.0:

return (gi_176);

case 128.0:

return (gi_184);

case 256.0:

return (gi_192);

case 512.0:

return (gi_200);

}

return (gi_200);

}

 

int FinalincNr(double ad_0) {

ad_0 = NormalizeDouble(ad_0 / g_lots_236, 0);

switch (ad_0) {

case 1.0:

return (gi_132);

case 2.0:

return (gi_140);

case 4.0:

return (gi_148);

case 8.0:

return (gi_156);

case 16.0:

return (gi_164);

case 32.0:

return (gi_172);

case 64.0:

return (gi_180);

case 128.0:

return (gi_188);

case 256.0:

return (gi_196);

case 512.0:

return (gi_204);

}

return (gi_204);

}

Link to comment
Share on other sites

why? this is one of the worst eas ever made.

 

 

Becoz I have forward test it for while. It is a profitable EA. just like some folks who use robo miner ea.

You make some profits and take some loses, important point is consistently the profits is more than the loses.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...