Forex



Go Back   Forex Trading > Downloads > Expert Advisors - Metatrader 4
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #41 (permalink)  
Old 02-03-2008, 08:09 PM
Senior Member
 
Join Date: Jan 2006
Posts: 1,119
omelette is on a distinguished road
Wow Oilfx, never thought I'd hear you say something positive about Hans' strategy - you have always been less than complementary in the past...

FWIW, I forward tested this strategy for almost a year, until another strategy on the same account blew it, so I never bothered restarting it. And yes, it was profitable during this period. Unfortunately, the drawdowns that it sees would ensure that I would never trade it with real money - but that's just me...

Jgerousis has been live-testing this since Jan '07 but the link he posted a page or so back now goes to some ugly advert site, not the cool multiple live strategy results he had before - shame...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #42 (permalink)  
Old 02-03-2008, 08:26 PM
Banned
 
Join Date: Nov 2007
Posts: 374
oilfxpro is on a distinguished road
Quote:
Originally Posted by omelette View Post
Wow Oilfx, never thought I'd hear you say something positive about Hans' strategy - you have always been less than complementary in the past...

FWIW, I forward tested this strategy for almost a year, until another strategy on the same account blew it, so I never bothered restarting it. And yes, it was profitable during this period. Unfortunately, the drawdowns that it sees would ensure that I would never trade it with real money - but that's just me...

Jgerousis has been live-testing this since Jan '07 but the link he posted a page or so back now goes to some ugly advert site, not the cool multiple live strategy results he had before - shame...
Omlette

A 1500 pip drawdown for 4 trades equates to around 400 pips average per trade/pair.It is in line with most of the profitable strategies

You have to look at all these strategies negatively and the worst case scenario

Traders misused the strategy and relied on it solely

No reason why it can not be used as part of a portfolio of expert advisors

OILFXPRO

Last edited by oilfxpro; 02-03-2008 at 08:30 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #43 (permalink)  
Old 09-26-2008, 12:29 PM
Member
 
Join Date: Aug 2008
Location: Chianti...
Posts: 32
l'orsotoro® is on a distinguished road
Why can not I run the HANS's experts, have expired?


This one:

//+------------------------------------------------------------------+
//| Hans123MV22 |
//| Copyright © 2006, Milan Volf |
//| |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Milan Volf"

//---- input parameters
extern int Start1=10; //begin of the first session; time adjust by your broker time
extern int Start2=14; //begin of the second session
extern int EOD=20; //time for closing orders at end of day
extern int FridayClosing=20; //broker friday closing time
extern bool FirstSessionOnly=0; //if it equals 1, it trades the first range only (for testing)
extern int Length=4; //length of range for determining high/low
extern int Pips=5; //trigger above/bellow range
extern int StopLoss=33; // 50
extern int BreakEven=18; //if equals 0 - disabled
extern int TrailingStop=0; //if equals 0 - disabled
extern int TakeProfit=120; // 80
extern double Lots=1;

extern string s4="//====GMACD settings====//";
extern int FastEMA = 8;
extern int SlowEMA = 17;
extern int SignalSMA = 9;
bool gmacdbuysignal=false;
bool gmacdsellsignal=false;


//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{

//----
//+---------------------------GMACD Logic coded --------------------------

double macd_H1=iMACD(NULL,PERIOD_H1,FastEMA,SlowEMA,Signa lSMA,PRICE_CLOSE,MODE_MAIN,0);
double macd_HH1=iMACD(NULL,PERIOD_H1,FastEMA,SlowEMA,Sign alSMA,PRICE_CLOSE,MODE_SIGNAL,0);
double macd_H4=iMACD(NULL,PERIOD_H4,FastEMA,SlowEMA,Signa lSMA,PRICE_CLOSE,MODE_MAIN,0);
double macd_HH4=iMACD(NULL,PERIOD_H4,FastEMA,SlowEMA,Sign alSMA,PRICE_CLOSE,MODE_SIGNAL,0);
double macd_D1=iMACD(NULL,PERIOD_D1,FastEMA,SlowEMA,Signa lSMA,PRICE_CLOSE,MODE_MAIN,0);
double macd_DD1=iMACD(NULL,PERIOD_D1,FastEMA,SlowEMA,Sign alSMA,PRICE_CLOSE,MODE_SIGNAL,0);

int _h1=0, _h4=0, _d1=0;

if ((macd_H1 > macd_HH1)) { _h1 = 1; }
if ((macd_H1 < macd_HH1)) { _h1 = -1; }

if ((macd_H4 > macd_HH4)) { _h4 = 1; }
if ((macd_H4 < macd_HH4)) { _h4 = -1; }

if ((macd_D1 > macd_DD1)) { _d1 = 1; }
if ((macd_D1 < macd_DD1)) { _d1 = -1; }

if (_h4==1 && _d1==1) {gmacdbuysignal=true; gmacdsellsignal=false;}
if (_h4==-1 && _d1==-1) {gmacdsellsignal=true; gmacdbuysignal=false;}

//+---------------------------GMACD Logic --------------------------

//----
int i,Ticket,MN;

//Normalize times
if(EOD==24) EOD=0;
if(FridayClosing==0) FridayClosing=24;

//Setup comment
string Text="Hans123"+Symbol();

//Setup orders
if(Hour()==Start1 && Minute()<10){
MN=1;
SetOrders(Text,MN);
}
if(Hour()==Start2 && Minute()<10 && FirstSessionOnly==0){
MN=2;
SetOrders(Text,MN);
}

//Manage opened orders
for (i=0;i<OrdersTotal();i++){
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderComment()==Text){
//close open positions at EOD
if(Hour()==EOD || (DayOfWeek()>=5 && Hour()==FridayClosing-1 && Minute()>=50)){
switch (OrderType()){
case OP_BUY: OrderClose(OrderTicket(),OrderLots(),Bid,3,Red);
break;
case OP_SELL: OrderClose(OrderTicket(),OrderLots(),Ask,3,Red);
break;
default: OrderDelete(OrderTicket());
break;
}
Sleep(10000);
}
else {
//move at BE if profit>BE
if(BreakEven>=0){
if(OrderType()==OP_BUY){
if(High[0]-OrderOpenPrice()>=BreakEven*Point && OrderStopLoss()<OrderOpenPrice()){
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOp enPrice(),OrderTakeProfit(),0,Green);
Sleep(10000);
}
}
if(OrderType()==OP_SELL){
if(OrderOpenPrice()-Low[0]>=BreakEven*Point && OrderStopLoss()>OrderOpenPrice()){
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOp enPrice(),OrderTakeProfit(),0,Green);
Sleep(10000);
}
}
}

if(TrailingStop>=0) {
if(OrderType()==OP_BUY){
if(High[0]-OrderStopLoss()>TrailingStop*Point){
OrderModify(OrderTicket(),OrderOpenPrice(),High[0]-TrailingStop*Point,OrderTakeProfit(),0,Green);
Sleep(10000);
}
}
if(OrderType()==OP_SELL){
if(OrderStopLoss()-Low[0]>TrailingStop*Point){
OrderModify(OrderTicket(),OrderOpenPrice(),Low[0]+TrailingStop*Point,OrderTakeProfit(),0,Green);
Sleep(10000);
}
}
}
}
}
}

return(0);
}
//+------------------------------------------------------------------+

void SetOrders(string Text,int MN){
int i,Ticket,Bought,Sold;
double EntryLong,EntryShort,SLLong,SLShort,TPLong,TPShort ;

//Determine range
EntryLong =iHigh(NULL,60,Highest(NULL,60,MODE_HIGH,Length,1) )+(Pips/*+MarketInfo(Symbol(),MODE_SPREAD)*/)*Point;
EntryShort =iLow (NULL,60,Lowest (NULL,60,MODE_LOW, Length,1))-Pips*Point;
SLLong =MathMax(EntryLong-StopLoss*Point,EntryShort);
SLShort =MathMin(EntryShort+StopLoss*Point,EntryLong);
TPLong =EntryLong+TakeProfit*Point;
TPShort =EntryShort-TakeProfit*Point;

//Send orders
for (i=0;i<OrdersTotal();i++){
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderComment()==Text && OrderMagicNumber()==MN){
if(OrderType()==OP_BUYSTOP || OrderType()==OP_BUY) Bought++;
if(OrderType()==OP_SELLSTOP || OrderType()==OP_SELL) Sold++;
}
}
if (gmacdbuysignal == true)
{
if(Bought==0){ //no buy order
Ticket=OrderSend(Symbol(),OP_BUYSTOP,Lots,EntryLon g,3,SLLong,TPLong,Text,MN,0,Blue);
if(Ticket<0 && High[0]>=EntryLong)
Ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,SLLong ,TPLong,Text,MN,0,Blue);
Sleep(10000);
}
}

if (gmacdsellsignal == true)
{
if(Sold==0){ //no sell order
Ticket=OrderSend(Symbol(),OP_SELLSTOP,Lots,EntrySh ort,3,SLShort,TPShort,Text,MN,0,Magenta);
if(Ticket<0 && Low[0]<=EntryShort)
Ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,SLSho rt,TPShort,Text,MN,0,Magenta);
Sleep(10000);
}
}

//Check orders
for (i=0;i<OrdersTotal();i++){
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderComment()==Text && OrderMagicNumber()==MN){
if(OrderType()==OP_BUYSTOP && (MathAbs(OrderOpenPrice()-EntryLong)>Point
|| MathAbs(OrderStopLoss()-SLLong)>Point || MathAbs(OrderTakeProfit()-TPLong)>Point))
OrderModify(OrderTicket(),EntryLong,SLLong,TPLong, 0,Blue);
if(OrderType()==OP_SELLSTOP && (MathAbs(OrderOpenPrice()-EntryShort)>Point
|| MathAbs(OrderStopLoss()-SLShort)>Point || MathAbs(OrderTakeProfit()-TPShort)>Point))
OrderModify(OrderTicket(),EntryShort,SLShort,TPSho rt,0,Magenta);
}
}
}

Last edited by l'orsotoro®; 09-26-2008 at 01:39 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #44 (permalink)  
Old 09-27-2008, 02:11 PM
Junior Member
 
Join Date: Aug 2007
Location: Nashville, Tennessee
Posts: 18
Supra is on a distinguished road
l'orsotoro,

You had a lot of spaces in your code which was giving off many errors. I closed the spaces and made no other changes and then backtested the code to make sure it ran properly, which it did.



//+------------------------------------------------------------------+
//| Hans123MV22 |
//| Copyright © 2006, Milan Volf |
//| |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Milan Volf"

//---- input parameters
extern int Start1=10; //begin of the first session; time adjust by your broker time
extern int Start2=14; //begin of the second session
extern int EOD=20; //time for closing orders at end of day
extern int FridayClosing=20; //broker friday closing time
extern bool FirstSessionOnly=0; //if it equals 1, it trades the first range only (for testing)
extern int Length=4; //length of range for determining high/low
extern int Pips=5; //trigger above/bellow range
extern int StopLoss=33; // 50
extern int BreakEven=18; //if equals 0 - disabled
extern int TrailingStop=0; //if equals 0 - disabled
extern int TakeProfit=120; // 80
extern double Lots=1;

extern string s4="//====GMACD settings====//";
extern int FastEMA = 8;
extern int SlowEMA = 17;
extern int SignalSMA = 9;
bool gmacdbuysignal=false;
bool gmacdsellsignal=false;


//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{

//----
//+---------------------------GMACD Logic coded --------------------------

double macd_H1=iMACD(NULL,PERIOD_H1,FastEMA,SlowEMA,Signa lSMA,PRICE_CLOSE,MODE_MAIN,0);
double macd_HH1=iMACD(NULL,PERIOD_H1,FastEMA,SlowEMA,Sign alSMA,PRICE_CLOSE,MODE_SIGNAL,0);
double macd_H4=iMACD(NULL,PERIOD_H4,FastEMA,SlowEMA,Signa lSMA,PRICE_CLOSE,MODE_MAIN,0);
double macd_HH4=iMACD(NULL,PERIOD_H4,FastEMA,SlowEMA,Sign alSMA,PRICE_CLOSE,MODE_SIGNAL,0);
double macd_D1=iMACD(NULL,PERIOD_D1,FastEMA,SlowEMA,Signa lSMA,PRICE_CLOSE,MODE_MAIN,0);
double macd_DD1=iMACD(NULL,PERIOD_D1,FastEMA,SlowEMA,Sign alSMA,PRICE_CLOSE,MODE_SIGNAL,0);

int _h1=0, _h4=0, _d1=0;

if ((macd_H1 > macd_HH1)) { _h1 = 1; }
if ((macd_H1 < macd_HH1)) { _h1 = -1; }

if ((macd_H4 > macd_HH4)) { _h4 = 1; }
if ((macd_H4 < macd_HH4)) { _h4 = -1; }

if ((macd_D1 > macd_DD1)) { _d1 = 1; }
if ((macd_D1 < macd_DD1)) { _d1 = -1; }

if (_h4==1 && _d1==1) {gmacdbuysignal=true; gmacdsellsignal=false;}
if (_h4==-1 && _d1==-1) {gmacdsellsignal=true; gmacdbuysignal=false;}

//+---------------------------GMACD Logic --------------------------

//----
int i,Ticket,MN;

//Normalize times
if(EOD==24) EOD=0;
if(FridayClosing==0) FridayClosing=24;

//Setup comment
string Text="Hans123"+Symbol();

//Setup orders
if(Hour()==Start1 && Minute()<10){
MN=1;
SetOrders(Text,MN);
}
if(Hour()==Start2 && Minute()<10 && FirstSessionOnly==0){
MN=2;
SetOrders(Text,MN);
}

//Manage opened orders
for (i=0;i<OrdersTotal();i++){
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderComment()==Text){
//close open positions at EOD
if(Hour()==EOD || (DayOfWeek()>=5 && Hour()==FridayClosing-1 && Minute()>=50)){
switch (OrderType()){
case OP_BUY: OrderClose(OrderTicket(),OrderLots(),Bid,3,Red);
break;
case OP_SELL: OrderClose(OrderTicket(),OrderLots(),Ask,3,Red);
break;
default: OrderDelete(OrderTicket());
break;
}
Sleep(10000);
}
else {
//move at BE if profit>BE
if(BreakEven>=0){
if(OrderType()==OP_BUY){
if(High[0]-OrderOpenPrice()>=BreakEven*Point && OrderStopLoss()<OrderOpenPrice()){
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOp enPrice(),OrderTakeProfit(),0,Green);
Sleep(10000);
}
}
if(OrderType()==OP_SELL){
if(OrderOpenPrice()-Low[0]>=BreakEven*Point && OrderStopLoss()>OrderOpenPrice()){
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOp enPrice(),OrderTakeProfit(),0,Green);
Sleep(10000);
}
}
}

if(TrailingStop>=0) {
if(OrderType()==OP_BUY){
if(High[0]-OrderStopLoss()>TrailingStop*Point){
OrderModify(OrderTicket(),OrderOpenPrice(),High[0]-TrailingStop*Point,OrderTakeProfit(),0,Green);
Sleep(10000);
}
}
if(OrderType()==OP_SELL){
if(OrderStopLoss()-Low[0]>TrailingStop*Point){
OrderModify(OrderTicket(),OrderOpenPrice(),Low[0]+TrailingStop*Point,OrderTakeProfit(),0,Green);
Sleep(10000);
}
}
}
}
}
}

return(0);
}
//+------------------------------------------------------------------+

void SetOrders(string Text,int MN){
int i,Ticket,Bought,Sold;
double EntryLong,EntryShort,SLLong,SLShort,TPLong,TPShort ;

//Determine range
EntryLong =iHigh(NULL,60,Highest(NULL,60,MODE_HIGH,Length,1) )+(Pips/*+MarketInfo(Symbol(),MODE_SPREAD)*/)*Point;
EntryShort =iLow (NULL,60,Lowest (NULL,60,MODE_LOW, Length,1))-Pips*Point;
SLLong =MathMax(EntryLong-StopLoss*Point,EntryShort);
SLShort =MathMin(EntryShort+StopLoss*Point,EntryLong);
TPLong =EntryLong+TakeProfit*Point;
TPShort =EntryShort-TakeProfit*Point;

//Send orders
for (i=0;i<OrdersTotal();i++){
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderComment()==Text && OrderMagicNumber()==MN){
if(OrderType()==OP_BUYSTOP || OrderType()==OP_BUY) Bought++;
if(OrderType()==OP_SELLSTOP || OrderType()==OP_SELL) Sold++;
}
}
if (gmacdbuysignal == true)
{
if(Bought==0){ //no buy order
Ticket=OrderSend(Symbol(),OP_BUYSTOP,Lots,EntryLon g,3,SLLong,TPLong,Text,MN,0,Blue);
if(Ticket<0 && High[0]>=EntryLong)
Ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,SLLong ,TPLong,Text,MN,0,Blue);
Sleep(10000);
}
}

if (gmacdsellsignal == true)
{
if(Sold==0){ //no sell order
Ticket=OrderSend(Symbol(),OP_SELLSTOP,Lots,EntrySh ort,3,SLShort,TPShort,Text,MN,0,Magenta);
if(Ticket<0 && Low[0]<=EntryShort)
Ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,SLSho rt,TPShort,Text,MN,0,Magenta);
Sleep(10000);
}
}

//Check orders
for (i=0;i<OrdersTotal();i++){
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderComment()==Text && OrderMagicNumber()==MN){
if(OrderType()==OP_BUYSTOP && (MathAbs(OrderOpenPrice()-EntryLong)>Point
|| MathAbs(OrderStopLoss()-SLLong)>Point || MathAbs(OrderTakeProfit()-TPLong)>Point))
OrderModify(OrderTicket(),EntryLong,SLLong,TPLong, 0,Blue);
if(OrderType()==OP_SELLSTOP && (MathAbs(OrderOpenPrice()-EntryShort)>Point
|| MathAbs(OrderStopLoss()-SLShort)>Point || MathAbs(OrderTakeProfit()-TPShort)>Point))
OrderModify(OrderTicket(),EntryShort,SLShort,TPSho rt,0,Magenta);
}
}
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
hans123, Hans123 EA, hans123 mq4, hans123 breakout system, hans123 breakout ea, EA hans123, hans123 expert advisor, hans123 breakout, settings hans123, hans 123, hans123 trader


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT. The time now is 08:15 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.