Jump to content

{share}f0rex aut0 trader


Recommended Posts

Re: {share}f0rex aut0 trader

 

has anyone managed to get the page linked to open? on my connection it is perpetually 'waiting' for a response from the site.

 

i would appreciate if anyone could upload the files to a file-sharing site. thankyoumuchly.

"It is inconceivable that anyone will divulge a truly effective get-rich scheme for the price of a book."

Victor Niederhoffer (1943–), US hedge fund manager and statistician

Link to comment
Share on other sites

Re: {share}f0rex aut0 trader

 

Have not tried it yet.

Kudos please

=============================================Start

 

#property copyright "Copyright © 2009, "

#property link "http://[email protected]"

 

#include <WinUser32.mqh>

 

extern string _d0 = "xxxTrader ver: 1.3.3";

extern string _d1 = "System Parameters";

extern int MagicNumber = 7531;

extern int Slippage = 3;

extern bool SignalMail = FALSE;

extern string _d2 = "Order Parameters";

extern int BuyTakeProfit = 170;

extern int BuyStopLoss = 100;

extern int BuyTrailingStop = 15;

extern int SellTakeProfit = 170;

extern int SellStopLoss = 100;

extern int SellTrailingStop = 15;

extern double Lots = 0.1;

extern string _d3 = "Money Managment Risk (Risk>0 - MM is on)";

extern double Risk = 0.1;

extern string _d4 = "Starategy Parameters";

extern string _d5 = "Trading Day Ranges (from TradeDayStart to TradeDayEnd)";

extern int SessionStart = 0;

extern int SessionEnd = 24;

int g_period_184 = 14;

int g_period_188 = 21;

int g_period_192 = 48;

int gi_196 = 2;

double gd_200 = 0.01;

double gd_208 = 0.2;

bool gi_216 = TRUE;

int gi_220 = D'30.09.2009 21:00';

bool gi_224 = FALSE;

double gd_228;

double gda_236[];

double gda_240[];

double gda_244[];

double g_isar_248;

double g_isar_256;

int gia_264[22];

int gia_268[22];

int gia_272[22];

int gia_276[22];

int gia_280[22];

int gia_284[22];

int gia_288[22];

int gia_292[22];

double gda_296[22];

int gi_300 = -1;

int gi_304 = 0;

int g_ticket_308 = 0;

int g_ticket_312 = 0;

bool gi_316 = TRUE;

int gi_320 = 0;

int gi_324 = 0;

 

void InitParams() {

gia_264[0] = 946684800;

gia_268[0] = 190;

gia_272[0] = 40;

gia_276[0] = 55;

gia_280[0] = 13;

gia_284[0] = 18;

gia_288[0] = 98;

gia_292[0] = 2;

gia_264[1] = 978307200;

gia_268[1] = 130;

gia_272[1] = 130;

gia_276[1] = 50;

gia_280[1] = 1;

gia_284[1] = 24;

gia_288[1] = 73;

gia_292[1] = 2;

gia_264[2] = D'31.12.2001 20:00';

gia_268[2] = 120;

gia_272[2] = 140;

gia_276[2] = 50;

gia_280[2] = 8;

gia_284[2] = 29;

gia_288[2] = 117;

gia_292[2] = 7;

gia_264[3] = D'31.12.2002 20:00';

gia_268[3] = 40;

gia_272[3] = 25;

gia_276[3] = 0;

gia_280[3] = 15;

gia_284[3] = 23;

gia_288[3] = 78;

gia_292[3] = 5;

gia_264[4] = D'31.05.2003 21:00';

gia_268[4] = 75;

gia_272[4] = 28;

gia_276[4] = 0;

gia_280[4] = 4;

gia_284[4] = 17;

gia_288[4] = 131;

gia_292[4] = 2;

gia_264[5] = D'31.12.2003 20:00';

gia_268[5] = 80;

gia_272[5] = 22;

gia_276[5] = 0;

gia_280[5] = 5;

gia_284[5] = 23;

gia_288[5] = 99;

gia_292[5] = 2;

gia_264[6] = D'31.05.2004 21:00';

gia_268[6] = 55;

gia_272[6] = 22;

gia_276[6] = 25;

gia_280[6] = 10;

gia_284[6] = 19;

gia_288[6] = 99;

gia_292[6] = 2;

gia_264[7] = D'31.12.2004 20:00';

gia_268[7] = 80;

gia_272[7] = 16;

gia_276[7] = 0;

gia_280[7] = 8;

gia_284[7] = 32;

gia_288[7] = 75;

gia_292[7] = 2;

gia_264[8] = D'31.05.2005 21:00';

gia_268[8] = 80;

gia_272[8] = 22;

gia_276[8] = 10;

gia_280[8] = 8;

gia_284[8] = 30;

gia_288[8] = 134;

gia_292[8] = 5;

gia_264[9] = D'31.12.2005 20:00';

gia_268[9] = 30;

gia_272[9] = 25;

gia_276[9] = 0;

gia_280[9] = 4;

gia_284[9] = 33;

gia_288[9] = 135;

gia_292[9] = 3;

gia_264[10] = D'31.05.2006 21:00';

gia_268[10] = 20;

gia_272[10] = 22;

gia_276[10] = 15;

gia_280[10] = 14;

gia_284[10] = 28;

gia_288[10] = 64;

gia_292[10] = 2;

gia_264[11] = D'31.12.2006 20:00';

gia_268[11] = 20;

gia_272[11] = 19;

gia_276[11] = 25;

gia_280[11] = 15;

gia_284[11] = 20;

gia_288[11] = 72;

gia_292[11] = 6;

gia_264[12] = D'31.05.2007 21:00';

gia_268[12] = 80;

gia_272[12] = 10;

gia_276[12] = 0;

gia_280[12] = 5;

gia_284[12] = 33;

gia_288[12] = 68;

gia_292[12] = 2;

gia_264[13] = D'31.12.2007 20:00';

gia_268[13] = 40;

gia_272[13] = 28;

gia_276[13] = 0;

gia_280[13] = 2;

gia_284[13] = 18;

gia_288[13] = 130;

gia_292[13] = 2;

gia_264[14] = D'31.05.2008 21:00';

gia_268[14] = 65;

gia_272[14] = 16;

gia_276[14] = 15;

gia_280[14] = 9;

gia_284[14] = 22;

gia_288[14] = 86;

gia_292[14] = 5;

gia_264[15] = D'31.07.2008 21:00';

gia_268[15] = 60;

gia_272[15] = 15;

gia_276[15] = 25;

gia_280[15] = 3;

gia_284[15] = 18;

gia_288[15] = 115;

gia_292[15] = 5;

gia_264[16] = D'30.09.2008 21:00';

gia_268[16] = 220;

gia_272[16] = 30;

gia_276[16] = 30;

gia_280[16] = 11;

gia_284[16] = 33;

gia_288[16] = 60;

gia_292[16] = 3;

gda_296[16] = 0.01;

gia_264[17] = D'31.10.2008 21:00';

gia_268[17] = 300;

gia_272[17] = 60;

gia_276[17] = 45;

gia_280[17] = 11;

gia_284[17] = 33;

gia_288[17] = 77;

gia_292[17] = 5;

gda_296[17] = 0.01;

gia_264[18] = D'31.12.2008 20:00';

gia_268[18] = 100;

gia_272[18] = 70;

gia_276[18] = 20;

gia_280[18] = 9;

gia_284[18] = 15;

gia_288[18] = 63;

gia_292[18] = 2;

gda_296[18] = 0.01;

gia_264[19] = D'31.03.2009 21:00';

gia_268[19] = 50;

gia_272[19] = 50;

gia_276[19] = 10;

gia_280[19] = 8;

gia_284[19] = 26;

gia_288[19] = 53;

gia_292[19] = 2;

gda_296[19] = 0.01;

gia_264[20] = D'30.04.2009 21:00';

gia_268[20] = 270;

gia_272[20] = 160;

gia_276[20] = 15;

gia_280[20] = 9;

gia_284[20] = 20;

gia_288[20] = 37;

gia_292[20] = 2;

gda_296[20] = 0.01;

gia_264[21] = D'09.06.2009 21:00';

gia_268[21] = 110;

gia_272[21] = 60;

gia_276[21] = 40;

gia_280[21] = 4;

gia_284[21] = 31;

gia_288[21] = 45;

gia_292[21] = 3;

gda_296[21] = 0.01;

}

 

int vLine(string as_0, int a_datetime_8, color a_color_12) {

string l_str_concat_16 = StringConcatenate(as_0, " - ", a_datetime_8);

ObjectCreate(l_str_concat_16, OBJ_VLINE, 0, a_datetime_8, 0);

ObjectSet(l_str_concat_16, OBJPROP_COLOR, a_color_12);

return (0);

}

 

void CheckParams() {

int li_0 = ArrayBsearch(gia_264, Time[1]);

if (gi_300 != li_0) {

BuyTakeProfit = gia_268[li_0];

BuyStopLoss = gia_272[li_0];

BuyTrailingStop = gia_276[li_0];

SellTakeProfit = BuyTakeProfit;

SellStopLoss = BuyStopLoss;

SellTrailingStop = BuyTrailingStop;

g_period_184 = gia_280[li_0];

g_period_188 = gia_284[li_0];

g_period_192 = gia_288[li_0];

if (gda_296[li_0] > 0.0) {

gd_200 = gda_296[li_0];

gi_216 = TRUE;

} else gi_216 = FALSE;

if (gi_196 != gia_292[li_0]) {

gi_196 = gia_292[li_0];

ArrayResize(gda_236, gi_196);

ArrayResize(gda_240, gi_196);

ArrayResize(gda_244, gi_196);

}

gi_300 = li_0;

}

}

 

int init() {

gd_228 = 0.0001 / Point;

if (Risk <= 0.0) Lots = NormalizeLots(Lots);

if (IsTesting()) InitParams();

ArrayResize(gda_236, gi_196);

ArrayResize(gda_240, gi_196);

ArrayResize(gda_244, gi_196);

Comment("ForexAutoTrader ver: 1.3.3");

if (StringFind(Symbol(), "EUR") < 0 || StringFind(Symbol(), "USD") < 0) MessageBox("You have selected the wrong currency pair!\nForexAutoTrader works with the EURUSD pair only!", "ForexAutoTrader: Warning", MB_ICONEXCLAMATION);

if (Period() != PERIOD_M15) MessageBox("You have selected wrong timeframe!\nPlease, select M15 timeframe on the upper panel of your MetaTrader4 window!", "ForexAutoTrader: Warning", MB_ICONEXCLAMATION);

return (0);

}

 

int deinit() {

Comment("");

return (0);

}

 

void setRules() {

if (IsTesting()) CheckParams();

HideTestIndicators(TRUE);

for (int l_index_0 = 0; l_index_0 < gi_196; l_index_0++) {

gda_236[l_index_0] = iMA(NULL, 0, g_period_184, 0, MODE_EMA, PRICE_CLOSE, l_index_0 + 1);

gda_240[l_index_0] = iMA(NULL, 0, g_period_188, 0, MODE_EMA, PRICE_CLOSE, l_index_0 + 1);

gda_244[l_index_0] = iMA(NULL, 0, g_period_192, 0, MODE_EMA, PRICE_CLOSE, l_index_0 + 1);

}

g_isar_248 = iSAR(NULL, 0, gd_200, gd_208, 1);

g_isar_256 = iSAR(NULL, 0, gd_200, gd_208, 2);

HideTestIndicators(FALSE);

}

 

int EmaCross(int ai_0) {

if (gda_236[0] * ai_0 >= gda_240[0] * ai_0 && gda_236[1] * ai_0 <= gda_240[1] * ai_0) {

for (int l_index_4 = 0; l_index_4 < gi_196 - 1; l_index_4++)

if (gda_236[l_index_4] * ai_0 >= gda_244[l_index_4] * ai_0 && (gda_236[l_index_4 + 1]) * ai_0 <= (gda_244[l_index_4 + 1]) * ai_0) return (1);

} else {

if (gda_236[0] * ai_0 >= gda_244[0] * ai_0 && gda_236[1] * ai_0 <= gda_244[1] * ai_0) {

for (l_index_4 = 0; l_index_4 < gi_196 - 1; l_index_4++)

if (gda_236[l_index_4] * ai_0 >= gda_240[l_index_4] * ai_0 && (gda_236[l_index_4 + 1]) * ai_0 <= (gda_240[l_index_4 + 1]) * ai_0) return (1);

}

}

return (0);

}

 

int openBuyRule() {

return ((g_isar_248 < Close[1] && EmaCross(1)) || (gi_216 && (gda_236[0] > gda_240[0] && gda_240[0] > gda_244[0] && g_isar_256 > Close[1] && g_isar_248 < Close[1])));

}

 

int openSellRule() {

return ((g_isar_248 > Close[1] && EmaCross(-1)) || (gi_216 && (gda_236[0] < gda_240[0] && gda_240[0] < gda_244[0] && g_isar_256 < Close[1] && g_isar_248 > Close[1])));

}

 

bool closeBuyRule() {

return (Close[1] < gda_236[0] && Close[1] < gda_240[0] && Close[1] < gda_244[0]);

}

 

bool closeSellRule() {

return (Close[1] > gda_236[0] && Close[1] > gda_240[0] && Close[1] > gda_244[0]);

}

 

int openBuy() {

double l_price_0 = 0;

double l_price_8 = 0;

int l_stoplevel_16 = MarketInfo(Symbol(), MODE_STOPLEVEL);

if (BuyStopLoss > 0) {

if (BuyStopLoss * gd_228 > l_stoplevel_16) l_price_8 = NormalizeDouble(Bid - BuyStopLoss * Point * gd_228, Digits);

else l_price_8 = NormalizeDouble(Bid - l_stoplevel_16 * Point, Digits);

}

if (BuyTakeProfit > 0) {

if (BuyTakeProfit * gd_228 > l_stoplevel_16) l_price_0 = NormalizeDouble(Ask + BuyTakeProfit * Point * gd_228, Digits);

else l_price_0 = NormalizeDouble(Ask + l_stoplevel_16 * Point, Digits);

}

int l_ticket_20 = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, l_price_8, l_price_0, "ForexAutoTrader ver: 1.3.3" + ": Buy", MagicNumber, 0, Green);

if (l_ticket_20 > 0)

if (SignalMail) SendMail("ForexAutoTrader ver: 1.3.3", "Open Buy: [" + Symbol() + "] " + NormalizeDouble(Ask, Digits));

return (l_ticket_20);

}

 

int openSell() {

double l_price_0 = 0;

double l_price_8 = 0;

int l_stoplevel_16 = MarketInfo(Symbol(), MODE_STOPLEVEL);

if (SellStopLoss > 0) {

if (SellStopLoss * gd_228 > l_stoplevel_16) l_price_8 = NormalizeDouble(Ask + SellStopLoss * Point * gd_228, Digits);

else l_price_8 = NormalizeDouble(Ask + l_stoplevel_16 * Point, Digits);

}

if (SellTakeProfit > 0) {

if (SellTakeProfit * gd_228 > l_stoplevel_16) l_price_0 = NormalizeDouble(Bid - SellTakeProfit * Point * gd_228, Digits);

else l_price_0 = NormalizeDouble(Bid - l_stoplevel_16 * Point, Digits);

}

int l_ticket_20 = OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, l_price_8, l_price_0, "ForexAutoTrader ver: 1.3.3" + ": Sell", MagicNumber, 0, Red);

if (l_ticket_20 > 0)

if (SignalMail) SendMail("ForexAutoTrader ver: 1.3.3", "Open Sell: [" + Symbol() + "] " + NormalizeDouble(Bid, Digits));

return (l_ticket_20);

}

 

bool CheckOrder(int ai_0) {

double l_ord_takeprofit_4 = OrderTakeProfit();

int li_12 = MathFloor(NormalizeDouble(100.0 * (100.0 * l_ord_takeprofit_4 - MathFloor(100.0 * l_ord_takeprofit_4)), 8));

if (li_12 == ai_0) {

vLine(StringConcatenate(gi_304, " - ", DoubleToStr(l_ord_takeprofit_4, Digits), " | ", li_12, " = ", ai_0), Time[1], Red);

return (TRUE);

}

return (FALSE);

}

 

int buyControl() {

if (g_ticket_308 != OrderTicket()) {

g_ticket_308 = OrderTicket();

if (CheckOrder(13)) gi_304++;

}

if (closeBuyRule())

if (OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, Violet)) return (-1);

if (BuyTrailingStop > 0) {

if (Bid - OrderOpenPrice() > Point * gd_228 * BuyTrailingStop)

if (OrderStopLoss() < Bid - Point * gd_228 * BuyTrailingStop || OrderStopLoss() == 0.0) OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(Bid - Point * gd_228 * BuyTrailingStop, Digits), OrderTakeProfit(), 0, Green);

}

return (OrderTicket());

}

 

int sellControl() {

if (g_ticket_312 != OrderTicket()) {

g_ticket_312 = OrderTicket();

if (CheckOrder(13)) gi_304++;

}

if (closeSellRule())

if (OrderClose(OrderTicket(), OrderLots(), Ask, Slippage, Violet)) return (-1);

if (SellTrailingStop > 0) {

if (OrderOpenPrice() - Ask > Point * gd_228 * SellTrailingStop)

if (OrderStopLoss() > Ask + Point * gd_228 * SellTrailingStop || OrderStopLoss() == 0.0) OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(Ask + Point * gd_228 * SellTrailingStop, Digits), OrderTakeProfit(), 0, Red);

}

return (OrderTicket());

}

 

double MMLots(double ad_0) {

return (NormalizeLots(ad_0 * AccountFreeMargin() / MarketInfo(Symbol(), MODE_MARGINREQUIRED) / (AccountLeverage() / 100.0)));

}

 

double NormalizeLots(double ad_0) {

double l_lotstep_16 = MarketInfo(Symbol(), MODE_LOTSTEP);

double l_minlot_24 = MarketInfo(Symbol(), MODE_MINLOT);

double l_maxlot_32 = MarketInfo(Symbol(), MODE_MAXLOT);

double ld_ret_8 = MathCeil(ad_0 / l_lotstep_16) * l_lotstep_16;

if (ld_ret_8 < l_minlot_24) ld_ret_8 = l_minlot_24;

if (ld_ret_8 > l_maxlot_32) ld_ret_8 = l_maxlot_32;

return (ld_ret_8);

}

 

int start() {

string ls_32;

if (Bars < 100) {

Print("bars less than 100");

return (0);

}

setRules();

int li_0 = -1;

int li_4 = -1;

for (int l_pos_8 = OrdersTotal() - 1; l_pos_8 >= 0; l_pos_8--) {

if (OrderSelect(l_pos_8, SELECT_BY_POS)) {

if (OrderMagicNumber() == MagicNumber) {

if (OrderSymbol() == Symbol()) {

switch (OrderType()) {

case OP_BUY:

li_0 = buyControl();

break;

case OP_SELL:

li_4 = sellControl();

}

}

}

}

}

if (!gi_224 && TimeCurrent() > gi_220) {

gi_224 = TRUE;

MessageBox("Your copy of ForexAutoTrader is now out of date!\nIt will not perform trading operations!\nPlease download the latest version at forex-auto-trader.com.", "ForexAutoTrader: Warning", MB_ICONEXCLAMATION);

Print("Your copy of ForexAutoTrader is now out of date! It will not perform trading operations! Please download the latest version at forex-auto-trader.com.");

}

if (gi_224) return (0);

int li_16 = openBuyRule();

int li_20 = openSellRule();

if (Risk > 0.0) Lots = MMLots(Risk);

bool li_24 = TRUE;

int l_hour_28 = Hour();

if ((SessionStart < SessionEnd && (l_hour_28 >= SessionStart && l_hour_28 <= SessionEnd - 1)) || (SessionStart >= SessionEnd && l_hour_28 >= SessionStart || l_hour_28 <= SessionEnd - 1)) li_24 = TRUE;

else li_24 = FALSE;

if (gi_316 != li_24) {

if (li_24) ls_32 = "Starting trading day";

else ls_32 = "Finishing trading day";

Print(ls_32, " at ", TimeToStr(TimeCurrent()));

}

gi_316 = li_24;

if (!li_24) return (0);

if (li_16 || li_20 && AccountFreeMargin() < MarketInfo(Symbol(), MODE_MARGINREQUIRED) * Lots) {

Print("We have no money. Free Margin = ", AccountFreeMargin(), " RequiredMargin = ", MarketInfo(Symbol(), MODE_MARGINREQUIRED) * Lots);

return (0);

}

if (gi_320 != Time[1] && li_16 && li_0 < 0) {

if (openBuy() > 0) gi_320 = Time[1];

} else {

if (gi_324 != Time[1] && li_20 && li_4 < 0)

if (openSell() > 0) gi_324 = Time[1];

}

return (0);

}

 

==============================End

Link to comment
Share on other sites

Re: {share}f0rex aut0 trader

 

lawl @ the EA changing its variables for different times on the backtest.

 

if it needs optimisation regularly, say so. this is just scamming pure. i wouldnt trust this EA to be anything other then a nice backtester.

"It is inconceivable that anyone will divulge a truly effective get-rich scheme for the price of a book."

Victor Niederhoffer (1943–), US hedge fund manager and statistician

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...