Jump to content

Forex Harvester


mopips

Recommended Posts

  • Replies 63
  • Created
  • Last Reply

Top Posters In This Topic

Re: Forex Harvester

 

I get invalid receipt all the time. Do you thing you could kill this and the email. Will it still work with the alerts coming up?

 

Just type any valid email for the email address parameter and a random string for the clickbank receipt. You can use "moo" for the clickbank receipt and "[email protected]" for the email address.

 

If you're feeling heroic, modify the MQ4 by removing the extern keyword in front of the license parameters and hardcoding some values in there. I modified the MQ4 like that but it seems I packaged the wrong one and I overwrote the right one just now when testing it.

Link to comment
Share on other sites

Re: Forex Harvester

 

harvester v17 + edu + no e-mail

 

 

-----------------------------------------------------------------------------------------------

 

#property copyright "Copyright © 2010, MT4 Trading"

#property link "http://www.forexharvester.com"

 

#import "forexharvester17.dll"

bool quad_f1(string& a0[], double& a1[], double& a2[], double& a3[]);

double quad_f2(string& a0[], double& a1[], double& a2[], double& a3[]);

#import

 

extern string l0 = "=== License Settings ===";

extern string ClickBankReceipt = "";

extern string EMailAddress = "";

extern string l1 = "=== Money Management Settings ===";

extern bool UseMM = TRUE;

extern double Risk = 20.0;

extern double LotSize = 1.0;

extern int MaxOrders = 3;

extern int stop.loss = 0;

int gi_136 = 5;

extern string l2 = "=== Trade Settings ===";

extern int Slippage = 10;

bool gi_152 = TRUE;

extern string l3 = "=== General Settings ===";

extern bool StatusDisplay = TRUE;

extern int MagicNumber = 1976;

extern string ExpertComment = "Forex Harvester v16";

double gd_unused_180 = 0.0;

double gd_188 = 17.0;

double gd_196;

double gd_204;

double gd_212;

int g_count_220;

double gda_224[40];

double gda_228[2000][6];

double gda_232[2000][6];

string gsa_236[10];

double gd_288 = 0.0;

string gs_dummy_304;

string gs_dummy_312;

string gs_dummy_320;

bool gi_332;

bool gi_336;

bool gi_340;

double gd_352;

string gs_dummy_364;

string gs_dummy_372;

double gd_380;

double gd_388;

double g_price_396;

bool gi_404;

 

int init() {

string ls_0 = StringSubstr(Symbol(), 0, 6);

gi_404 = FALSE;

gsa_236[5] = Symbol();

gsa_236[6] = Symbol();

if (ls_0 == "EURUSD" || ls_0 == "USDCHF" || ls_0 == "GBPUSD" || ls_0 == "EURJPY" || ls_0 == "USDJPY") gi_404 = TRUE;

else Alert("This EA only runs on the EURUSD, USDCHF, GBPUSD, EURJPY, USDJPY");

//if (EMailAddress == "" || StringLen(EMailAddress) < 8 || StringFind(EMailAddress, "@", 0) < 1) {

// gi_404 = FALSE;

// Alert("Please enter a valid EMail address");

//}

prepare_arrays();

if (!quad_f1(gsa_236, gda_224, gda_228, gda_232)) gi_404 = FALSE;

return (0);

}

 

int deinit() {

return (0);

}

 

int start() {

double ld_0;

if (gi_404) {

gd_352 = 0.01;

if (Digits >= 4) {

gd_352 = 0.0001;

Slippage = 10 * Slippage;

}

prepare_arrays();

analyse.positions();

display.status();

gd_288 = Ask - Bid;

if (Month() == 1 && Day() <= 14) return (0);

if (Month() == 12 && Day() >= 14) return (0);

if (DayOfWeek() > 1) {

gda_224[25] = 1;

gi_340 = FALSE;

}

if (g_count_220 == 0) {

gd_380 = 0;

gd_388 = 0;

gi_332 = FALSE;

gi_336 = FALSE;

}

if (g_count_220 > 0) {

if (gi_332 && Bid >= gd_204) close.all();

if (gi_336 && Bid <= gd_212) close.all();

if (gi_152) panther.start();

}

if (!gi_340 && DayOfWeek() == 0 || DayOfWeek() == 1 && Minute() < 35) {

ld_0 = quad_f2(gsa_236, gda_224, gda_228, gda_232);

if (ld_0 == 0.0 && gda_224[25] == 3.0) {

Print("Valid trade setup detected, but spread too high (", DoubleToStr(gd_288 / gd_352, 1), "). Waiting");

return (0);

}

if (ld_0 == 1.0) {

Print("Valid trade setup detected");

gi_336 = FALSE;

gi_332 = FALSE;

gd_204 = gda_224[21];

gd_212 = gda_224[22];

if (gda_224[17] == 1.0) gi_336 = TRUE;

if (gda_224[17] == 2.0) gi_332 = TRUE;

if (gi_336) entry.short();

if (gi_332) entry.long();

}

}

}

return (0);

}

 

void entry.long() {

if (!UseMM) gda_224[19] = LotSize;

double l_price_0 = Ask;

if (Ask == 0.0) l_price_0 = Bid;

if (OrderSend(Symbol(), OP_BUY, gda_224[19], l_price_0, Slippage, 0, 0, ExpertComment, MagicNumber, 0, Blue) > 0) {

g_price_396 = l_price_0;

gi_340 = TRUE;

return;

}

Print("Long order failed with code " + GetLastError());

gda_224[25] = 3;

}

 

void entry.short() {

if (!UseMM) gda_224[19] = LotSize;

if (OrderSend(Symbol(), OP_SELL, gda_224[19], Bid, Slippage, 0, 0, ExpertComment, MagicNumber, 0, Red) > 0) {

g_price_396 = Bid;

gi_340 = TRUE;

return;

}

Print("Short order failed with code " + GetLastError());

gda_224[25] = 3;

}

 

void analyse.positions() {

gd_196 = 0;

g_count_220 = 0;

if (OrdersTotal() > 0) {

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

OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);

gd_196 += OrderProfit();

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

if (OrderStopLoss() == 0.0 && OrderType() == OP_BUY) OrderModify(OrderTicket(), OrderOpenPrice(), OrderOpenPrice() - gda_224[14], OrderOpenPrice() + gi_136 * MaxOrders * gd_352, 0, CLR_NONE);

if (OrderStopLoss() == 0.0 && OrderType() == OP_SELL) OrderModify(OrderTicket(), OrderOpenPrice(), OrderOpenPrice() + gda_224[14], OrderOpenPrice() - gi_136 * MaxOrders * gd_352, 0, CLR_NONE);

g_count_220++;

}

}

}

if (g_count_220 > MaxOrders) prune.orders();

}

 

void panther.start() {

if (gi_332) {

gd_380 = g_price_396 + gi_136 * gd_352;

if (Ask >= gd_380 && gd_380 + gd_288 < gd_204) entry.long();

}

if (gi_336) {

gd_388 = g_price_396 - gi_136 * gd_352;

if (Bid <= gd_388 && gd_388 - gd_288 > gd_212) entry.short();

}

}

 

void close.all() {

double l_price_4;

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

OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);

if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber && OrderProfit() > 0.0) {

l_price_4 = Ask;

if (OrderType() == OP_BUY) l_price_4 = Bid;

OrderClose(OrderTicket(), OrderLots(), l_price_4, Slippage, CLR_NONE);

}

}

}

 

void display.status() {

string ls_0;

string ls_unused_8;

if (StatusDisplay) {

ls_0 = "false";

if (UseMM) ls_0 = "true";

Comment("----Forex Harvester V16----\n", "---------------------------",

"\n", "Account : ", AccountNumber(),

"\n", "Name : ", AccountName(),

"\n", "FreeMargin : ", AccountFreeMargin(),

"\n", "Currency : ", AccountCurrency(),

"\n", "---------------------------",

"\n", "MM : ", ls_0,

"\n", "Risk : ", Risk, "%\n", "---------------------------",

"\n", "Open Trades : ", g_count_220,

"\n", "Profit : ", gd_196,

"\n", "Arr2[25] : ", gda_224[25],

"\n", "Arr2[17] : ", gda_224[17],

"\n", "---------------------------",

"\n", "---------------------------",

"\n");

}

}

 

void prune.orders() {

double l_price_12;

double l_ord_profit_0 = 0;

int l_ticket_8 = 0;

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

OrderSelect(l_pos_20, SELECT_BY_POS, MODE_TRADES);

if (OrderProfit() > l_ord_profit_0 && OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {

l_ord_profit_0 = OrderProfit();

l_ticket_8 = OrderTicket();

}

}

if (l_ord_profit_0 > 0.0) {

OrderSelect(l_ticket_8, SELECT_BY_TICKET, MODE_TRADES);

if (OrderType() == OP_BUY) l_price_12 = Bid;

if (OrderType() == OP_SELL) l_price_12 = Ask;

OrderClose(OrderTicket(), OrderLots(), l_price_12, Slippage, CLR_NONE);

}

}

 

void prepare_arrays() {

gda_224[1] = Digits;

gda_224[2] = Bid;

gda_224[3] = Ask;

gda_224[4] = MarketInfo(Symbol(), MODE_LOTSTEP);

gda_224[5] = MarketInfo(Symbol(), MODE_MINLOT);

gda_224[6] = MarketInfo(Symbol(), MODE_MAXLOT);

gda_224[7] = Risk;

gda_224[8] = MarketInfo(Symbol(), MODE_TICKVALUE);

gda_224[10] = AccountFreeMargin();

gda_224[11] = MaxOrders;

gda_224[13] = MarketInfo(Symbol(), MODE_LOTSIZE);

gda_224[15] = Bars;

gda_224[16] = gd_188;

gda_224[23] = ArrayCopyRates(gda_228, Symbol(), PERIOD_H1);

gda_224[24] = ArrayCopyRates(gda_232, Symbol(), PERIOD_D1);

gda_224[29] = stop.loss;

gsa_236[1] = Symbol();

gsa_236[2] = ClickBankReceipt;

gsa_236[3] = EMailAddress;

gsa_236[4] = DoubleToStr(AccountNumber(), 0);

gsa_236[7] = AccountCurrency();

}

-------------------------------------------------------------------------------------------

 

just compiled with meta editor

Link to comment
Share on other sites

  • 2 weeks later...
harvester v17 + edu + no e-mail

 

 

...........................

extern string ExpertComment = "Forex Harvester v16";

........................................

 

just compiled with meta editor

 

Thanks dyn :)

but what about that string?? it says v16 ?

 

I've compiled it and attached to my live account.. no error come out..thanks dyn

now waiting for it to start working...

what pair & TF should I use?

Link to comment
Share on other sites

Thanks dyn :)

but what about that string?? it says v16 ?

 

I've compiled it and attached to my live account.. no error come out..thanks dyn

now waiting for it to start working...

what pair & TF should I use?

 

The EA is designed to be used with the following currencies on the H4 time frame: USD/JPY, EUR/USD, GBP/USD, USD/CHF and EUR/JPY.

Link to comment
Share on other sites

The developer claims that the best results are obtained from using all pairs at the same time; however, the default risk is 20% of your account, meaning that if all five pairs were to suffer a maximum S/L at the same time, then your account would suffer a 100% loss. While highly unlikely in normal circumstances, we certainly can't say that this impossible, as the trading strategy behind the EA is that gaps that occur at Sunday night market open are to be faded until filled.

 

With all the volatility lately, I have been trying to imagine scenarios so here's one: Imagine a possible breakdown of the Eurozone over a weekend with Germany leaving the euro, where the EA opens positions on the gap open Sunday night, only to see the market completely run away from the gap due to the newsflow. If trading all five pairs on such an event, the account could blow.

 

Bottom line: I think that if running this live, you really need to be cognizant of major news over the weekend, and turn off the EA prior to Sunday night market open if there is a fat tail event.

Link to comment
Share on other sites

hi c4p;

 

thank you for the reply; but im a complete noob in the forex world. im sure you reply was quite informative but i really didnt understand. i got the "blow" the account part but what did you mean with this:

 

"Bottom line: I think that if running this live, you really need to be cognizant of major news over the weekend, and turn off the EA prior to Sunday night market open if there is a fat tail event. "

 

isnt this the idea of this ea? to trade on sundays?

 

also, what is a fat tail event

 

thank you,

Link to comment
Share on other sites

While not exactly a fat tail, the EU moves this past weekend to try and resolve the Greece situation (for now....) created an abnormally large gap open in many pairs. The market is moving away from the gap so far in EURUSD; it may come back and fill, but if you are demoing this one, drawdown could get interesting....

 

I have no problem with trading normal gaps, but ones like today are anything but normal.

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

Have try live for 2 weeks, so far give better result (Alpari no loss, Liteforex no loss, GalantFX several loss but still positive in total).

Seems this ea better run on fixed spread broker (marketmaker) than STP.

BTW I'm still use v16.

 

Cheers,

Benz

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