The Forex Autopilot and FapTurbo Forum

This forum provides free community support for the following expert advisors (forex robots):
FapTurbo - Most Popular (Fapturbo version 50 is out!)
Forex Autopilot System




Recommended: FAP Turbo Expert Guide - Make the most of FAP Turbo

Our own Forex VPS solution is live and open for business!! Click here to find out more!

(Unlimited Memory & Bandwidth - host as many forex robots as you want!)

Attention Visitor:
You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   The Forex Autopilot and FapTurbo Forum > Main Forex Autopilot Forum > Forex Autopilot Settings and Back-Testing

Sponsors
Top Forex VPS Providers
MetaTrader 4 (MT4) Forex Brokers


Notices

Forex Autopilot Settings and Back-Testing New threads posted to this board should include a log of back-testing results as well as the settings used to arrive at them.

Reply
 
Thread Tools Display Modes
  #11  
Old 02-24-2010, 06:35 PM
Sooner Sooner is offline
Senior Member
 
Join Date: Nov 2008
Posts: 552
Thanks: 2
Thanked 23 Times in 11 Posts
Default

Earl I would be interested in seeing the hedger. I have an idea running around in my head that the hedger would work for I think.
__________________
Reply With Quote

  #12  
Old 02-24-2010, 07:20 PM
Earl Earl is offline
Super Moderator
 
Join Date: Sep 2008
Posts: 820
Thanks: 3
Thanked 25 Times in 15 Posts
Default

I'm still playing with it...I just recoded ESS Hedger

do you want me to post it here??? or you can PM me your e-mail and I'll send it to you

Last edited by Earl; 03-01-2010 at 08:45 PM.
Reply With Quote
  #13  
Old 02-24-2010, 07:21 PM
Earl Earl is offline
Super Moderator
 
Join Date: Sep 2008
Posts: 820
Thanks: 3
Thanked 25 Times in 15 Posts
Default

or I could just post the whole code here in the forum
Reply With Quote
  #14  
Old 02-24-2010, 07:33 PM
Sooner Sooner is offline
Senior Member
 
Join Date: Nov 2008
Posts: 552
Thanks: 2
Thanked 23 Times in 11 Posts
Default

Just post it here, perhaps someone else can make use of it as well.
__________________
Reply With Quote
  #15  
Old 02-24-2010, 07:51 PM
Earl Earl is offline
Super Moderator
 
Join Date: Sep 2008
Posts: 820
Thanks: 3
Thanked 25 Times in 15 Posts
Default

//+------------------------------------------------------------------+
//| EES Hedger.mq4 |
//| Copyright © 2008, Elite E Services |
//| http://www.eliteeservices.net http://www.getfxnow.com |
//| Programmed by: Mikhail Veneracion |
//| |
//|Support: http://www.eesfx.com Group: http://www.forexcoding.com|
//|Elite E Services (646)837-0059 2620 Regatta Dr. Suite 102 LV, NV |
//+------------------------------------------------------------------+
/*
Instructions:
Example you are trading SAR EA on GBPUSD and SAR EA uses magicnumber of 1234,
so you want to use EES Hedger in conjunction with SAR EA in this example, so this is what you do.
Open another GBPUSD chart(same pair SAR EA is trading), does not matter what time frame, but it is
ideal that you use the same timeframe as what the SAR EA is trading from, or a lower timeframe. Now
on Advocates external var: Original_EA_Magic enter SAR EA's magicnumber which is in this example 1234.
Now make sure that Advocate_EA_Magic is different from Original_EA_Magic.
Then that's it. Once SAR EA opens a trade, EES Hedger will open the opposite order.
Now if you want to use EES Hedger for Manual trades. Simply input Original_EA_Magic = 0;
*/

#property copyright "Copyright © 2008, Elite E Services"
#property link "http://eliteeservices.net"

extern int
Original_EA_Magic = 231313, //This is the magic number that your 1st EA uses where advocate EA will base its trades on
Advocate_EA_Magic = 2019, //This is the advocate EAs own magic number please keep it unique to avoid conflict
Slippage = 3, //Amount of allowed slippage
TakeProfit = 10, //Take profit amount, per trade
StopLoss = 0, //Stop loss, per trade
TS_MinProfit = 1, //minimum profit require before trailing stop starts
TrailingStop = 9, //this is the trailing stop in pips
BreakEvenAfterPips = 9; //when this amount in profit in pips is reached SL will be moved to breakeven
extern double
Lots = 0.1;


datetime TT;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
TT=0;
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----

//TRAILING STOP SECTION FOR TRADE 2
if(TrailingStop>0 && subTotalTrade()>0)
{
int total = OrdersTotal();
for(int cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);

if(OrderType()<=OP_SELL &&
OrderSymbol()==Symbol() &&
OrderMagicNumber()==Advocate_EA_Magic)
{
subTrailingStop(OrderType());
}
}
}
//----------------------- BREAK EVEN AFTER PIPS SECTION
if(BreakEvenAfterPips >0 && subTotalTrade()>0)
{
total = OrdersTotal();
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);

if(OrderType()<=OP_SELL &&
OrderSymbol()==Symbol() &&
OrderMagicNumber()==Advocate_EA_Magic)
{
subBreakEvenAfterPips (OrderType());
}
}
}
subTradeOpenBar(Original_EA_Magic);
//----
return(0);
}
//+------------------------------------------------------------------+

int subTradeOpenBar(int MagicNumber)
{
int
cnt,
total = 0;

for(cnt=0;cnt<OrdersTotal();cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()==Symbol() &&
OrderMagicNumber()==MagicNumber)
{
total = iBarShift(Symbol(), 0, OrderOpenTime(), false);
if((total<1)&&(TT!=iTime(Symbol(),0,0)))
{
if(OrderType()==OP_BUY)
{
//OPEN SELL ORDER
subOpenOrder(OP_BUY, Lots, StopLoss, TakeProfit, Advocate_EA_Magic);
TT=iTime(Symbol(),0,0);
break;
}

if(OrderType()==OP_SELL)
{
//OPEN BUY ORDER
subOpenOrder(OP_SELL, Lots, StopLoss, TakeProfit, Advocate_EA_Magic);
TT=iTime(Symbol(),0,0);
break;
}
}
}
}
return(total);
}
int subOpenOrder(int type, double Lotz, int stoploss, int takeprofit,int MagicNumber)
{
int expiration;
double point;
int NumberOfTries = 15;
string TicketComment = "FAPS TOPPER";

int
ticket = 0,
err = 0,
c = 0;

double
aStopLoss = 0,
aTakeProfit = 0,
bStopLoss = 0,
bTakeProfit = 0;
//----
point=MarketInfo(Symbol(),MODE_POINT);
expiration=CurTime()+PERIOD_D1*1;
//----


if(type==OP_BUY)
{
for(c=0;c<NumberOfTries;c++)
{
ticket=OrderSend(Symbol(),OP_BUYSTOP,0.1,Ask+4*poi nt,0,0,0,"FAPS Pending 2019",16384,expiration,Green);
err=GetLastError();
if(err==0)
{
if(ticket>0) break;
}
else
{
if(err==0 || err==4 || err==136 || err==137 || err==138 || err==146) //Busy errors
{
Sleep(12000);
continue;
}
else //normal error
{
if(ticket>0) break;
}
}
}
}
if(type==OP_SELL)
{
for(c=0;c<NumberOfTries;c++)
{
ticket=OrderSend(Symbol(),OP_SELLSTOP,0.1,Bid-4*point,0,0,0,"Faps Pending 2019",16384,expiration,Red);
err=GetLastError();
if(err==0)
{
if(ticket>0) break;
}
else
{
if(err==0 || err==4 || err==136 || err==137 || err==138 || err==146) //Busy errors
{
Sleep(12000);
continue;
}
else //normal error
{
if(ticket>0) break;
}
}
}
}
return(ticket);
}
void subTrailingStop(int Type)
{
if(Type==OP_BUY) // buy position is opened
{
//----------------------- AFTER PROFIT TRAILING STOP

if(Bid-OrderOpenPrice()>Point*TS_MinProfit &&
OrderStopLoss()<Bid-Point*TrailingStop)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);
return(0);
}

}
if(Type==OP_SELL) // sell position is opened
{
//----------------------- AFTER PROFIT TRAILING STOP

if(OrderOpenPrice()-Ask>Point*TS_MinProfit)
{
if(OrderStopLoss()>Ask+Point*TrailingStop || OrderStopLoss()==0)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Poi nt*TrailingStop,OrderTakeProfit(),0,Red);
return(0);
}
}



}
}
//---------------------- BREAK EVEN FUNCTION
void subBreakEvenAfterPips(int Type)
{
if(Type==OP_BUY)
{
if(((Bid-OrderOpenPrice()) > (Point*BreakEvenAfterPips))&&(OrderStopLoss()<Orde rOpenPrice()))
OrderModify(
OrderTicket(),
OrderOpenPrice(),
NormalizeDouble(OrderOpenPrice()+(10*Point),Digits ),
OrderTakeProfit(),
0,
GreenYellow);
}
if(Type==OP_SELL)
{
if(((OrderOpenPrice()-Ask) > (Point*BreakEvenAfterPips))&&(OrderStopLoss()>Orde rOpenPrice()))
OrderModify(
OrderTicket(),
OrderOpenPrice(),
NormalizeDouble(OrderOpenPrice()-(10*Point),Digits),
OrderTakeProfit(),
0,
Red);
}
}
int subTotalTrade()
{
int
cnt,
total = 0;

for(cnt=0;cnt<OrdersTotal();cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()==Symbol() &&
OrderMagicNumber()==Advocate_EA_Magic) total++;
}
return(total);
}
Reply With Quote
The Following User Says Thank You to Earl For This Useful Post:
Sooner (02-24-2010)
  #16  
Old 02-24-2010, 07:53 PM
Earl Earl is offline
Super Moderator
 
Join Date: Sep 2008
Posts: 820
Thanks: 3
Thanked 25 Times in 15 Posts
Default

this one takes 1 order in the same direction 4 pips away using a stop
Reply With Quote
  #17  
Old 02-24-2010, 07:54 PM
Earl Earl is offline
Super Moderator
 
Join Date: Sep 2008
Posts: 820
Thanks: 3
Thanked 25 Times in 15 Posts
Default

//+------------------------------------------------------------------+
//| EES Hedger.mq4 |
//| Copyright © 2008, Elite E Services |
//| http://www.eliteeservices.net http://www.getfxnow.com |
//| Programmed by: Mikhail Veneracion |
//| |
//|Support: http://www.eesfx.com Group: http://www.forexcoding.com|
//|Elite E Services (646)837-0059 2620 Regatta Dr. Suite 102 LV, NV |
//+------------------------------------------------------------------+
/*
Instructions:
Example you are trading SAR EA on GBPUSD and SAR EA uses magicnumber of 1234,
so you want to use EES Hedger in conjunction with SAR EA in this example, so this is what you do.
Open another GBPUSD chart(same pair SAR EA is trading), does not matter what time frame, but it is
ideal that you use the same timeframe as what the SAR EA is trading from, or a lower timeframe. Now
on Advocates external var: Original_EA_Magic enter SAR EA's magicnumber which is in this example 1234.
Now make sure that Advocate_EA_Magic is different from Original_EA_Magic.
Then that's it. Once SAR EA opens a trade, EES Hedger will open the opposite order.
Now if you want to use EES Hedger for Manual trades. Simply input Original_EA_Magic = 0;
*/

#property copyright "Copyright © 2008, Elite E Services"
#property link "http://eliteeservices.net"

extern int
Original_EA_Magic = 231313, //This is the magic number that your 1st EA uses where advocate EA will base its trades on
Advocate_EA_Magic = 2011, //This is the advocate EAs own magic number please keep it unique to avoid conflict
Slippage = 25, //Amount of allowed slippage
TakeProfit = 10, //Take profit amount, per trade
StopLoss = 30, //Stop loss, per trade
TS_MinProfit = 1000, //minimum profit require before trailing stop starts
TrailingStop = 500, //this is the trailing stop in pips
BreakEvenAfterPips = 250; //when this amount in profit in pips is reached SL will be moved to breakeven
extern double
Lots = 0.1;


datetime TT;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
TT=0;
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----


//TRAILING STOP SECTION FOR TRADE 2
if(TrailingStop>0 && subTotalTrade()>0)
{
int total = OrdersTotal();
for(int cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);

if(OrderType()<=OP_SELL &&
OrderSymbol()==Symbol() &&
OrderMagicNumber()==Advocate_EA_Magic)
{
subTrailingStop(OrderType());
}
}
}
//----------------------- BREAK EVEN AFTER PIPS SECTION
if(BreakEvenAfterPips >0 && subTotalTrade()>0)
{
total = OrdersTotal();
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);

if(OrderType()<=OP_SELL &&
OrderSymbol()==Symbol() &&
OrderMagicNumber()==Advocate_EA_Magic)
{
subBreakEvenAfterPips (OrderType());
}
}
}
subTradeOpenBar(Original_EA_Magic);
//----
return(0);
}
//+------------------------------------------------------------------+

int subTradeOpenBar(int MagicNumber)
{
int
cnt,
total = 0;

for(cnt=0;cnt<OrdersTotal();cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()==Symbol() &&
OrderMagicNumber()==MagicNumber)
{
total = iBarShift(Symbol(), 0, OrderOpenTime(), false);
if((total<2)&&(TT!=iTime(Symbol(),0,0)))
{
if(OrderType()==OP_BUY)
{
//OPEN SELL ORDER
subOpenOrder(OP_SELL, Lots, StopLoss, TakeProfit, Advocate_EA_Magic);
TT=iTime(Symbol(),0,0);
break;
}

if(OrderType()==OP_SELL)
{
//OPEN BUY ORDER
subOpenOrder(OP_BUY, Lots, StopLoss, TakeProfit, Advocate_EA_Magic);
TT=iTime(Symbol(),0,0);
break;
}
}
}
}
return(total);
}
int subOpenOrder(int type, double Lotz, int stoploss, int takeprofit,int MagicNumber)
{
int expiration;
double point;
int NumberOfTries = 15;
string TicketComment = "FAPS TOPPER";

int
ticket = 0,
err = 0,
c = 0;

double
aStopLoss = 0,
aTakeProfit = 0,
bStopLoss = 0,
bTakeProfit = 0;
//----
point=MarketInfo(Symbol(),MODE_POINT);
expiration=CurTime()+PERIOD_D1*1;
//----


if(type==OP_BUY)
{
for(c=0;c<NumberOfTries;c++)
{
ticket=OrderSend(Symbol(),OP_BUYSTOP,0.1,Ask+8*poi nt,0,0,0,"FAPS Pending 2011",16384,expiration,Green);
err=GetLastError();
if(err==0)
{
if(ticket>0) break;
}
else
{
if(err==0 || err==4 || err==136 || err==137 || err==138 || err==146) //Busy errors
{
Sleep(9000);
continue;
}
else //normal error
{
if(ticket>0) break;
}
}
}
}
if(type==OP_SELL)
{
for(c=0;c<NumberOfTries;c++)
{
ticket=OrderSend(Symbol(),OP_SELLSTOP,0.1,Bid-8*point,0,0,0,"Faps Pending 2011",16384,expiration,Red);
err=GetLastError();
if(err==0)
{
if(ticket>0) break;
}
else
{
if(err==0 || err==4 || err==136 || err==137 || err==138 || err==146) //Busy errors
{
Sleep(9000);
continue;
}
else //normal error
{
if(ticket>0) break;
}
}
}
}
return(ticket);
}
void subTrailingStop(int Type)
{
if(Type==OP_BUY) // buy position is opened
{
//----------------------- AFTER PROFIT TRAILING STOP

if(Bid-OrderOpenPrice()>Point*TS_MinProfit &&
OrderStopLoss()<Bid-Point*TrailingStop)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);
return(0);
}

}
if(Type==OP_SELL) // sell position is opened
{
//----------------------- AFTER PROFIT TRAILING STOP

if(OrderOpenPrice()-Ask>Point*TS_MinProfit)
{
if(OrderStopLoss()>Ask+Point*TrailingStop || OrderStopLoss()==0)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Poi nt*TrailingStop,OrderTakeProfit(),0,Red);
return(0);
}
}



}
}
//---------------------- BREAK EVEN FUNCTION
void subBreakEvenAfterPips(int Type)
{
if(Type==OP_BUY)
{
if(((Bid-OrderOpenPrice()) > (Point*BreakEvenAfterPips))&&(OrderStopLoss()<Orde rOpenPrice()))
OrderModify(
OrderTicket(),
OrderOpenPrice(),
NormalizeDouble(OrderOpenPrice()+(10*Point),Digits ),
OrderTakeProfit(),
0,
GreenYellow);
}
if(Type==OP_SELL)
{
if(((OrderOpenPrice()-Ask) > (Point*BreakEvenAfterPips))&&(OrderStopLoss()>Orde rOpenPrice()))
OrderModify(
OrderTicket(),
OrderOpenPrice(),
NormalizeDouble(OrderOpenPrice()-(10*Point),Digits),
OrderTakeProfit(),
0,
Red);
}
}
int subTotalTrade()
{
int
cnt,
total = 0;

for(cnt=0;cnt<OrdersTotal();cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()==Symbol() &&
OrderMagicNumber()==Advocate_EA_Magic) total++;
}
return(total);
}
Reply With Quote
  #18  
Old 02-24-2010, 07:55 PM
Earl Earl is offline
Super Moderator
 
Join Date: Sep 2008
Posts: 820
Thanks: 3
Thanked 25 Times in 15 Posts
Default

this one takes 2 opposite orders 10 pip out using a stop

all the stops expire in 25 mins

I can tell you how to modify them to suit your needs
Reply With Quote
  #19  
Old 02-24-2010, 08:00 PM
Sooner Sooner is offline
Senior Member
 
Join Date: Nov 2008
Posts: 552
Thanks: 2
Thanked 23 Times in 11 Posts
Default

Ok had to fix some breaks in the code from the copy operation but pretty straight forward. Do you have settings you are already testing or are the ones coded in there what you are using currently?
__________________
Reply With Quote
  #20  
Old 02-24-2010, 08:06 PM
Earl Earl is offline
Super Moderator
 
Join Date: Sep 2008
Posts: 820
Thanks: 3
Thanked 25 Times in 15 Posts
Default

You need to set the lot size in the program...I think playing with it screwed the screen options...LOL

see I want it to take a stop instead of an actual order.......

The expiration time could be extended a bit..
but seems to be running good...

with my settings FAPS had made around 20% in the last 13 days or so
in a little draw down since the 19th but those orders should go into profit later today or tomorrow
Reply With Quote
Reply

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

Forum Jump


FapTurbo
Forex Autopilot System



These are the 100 most searched terms
Search Cloud
alpari uk gmt offset autopilot forum fab turbo fab turbo forum fab turbo settings fabturbo forum fabturbo settings fap settings fap turbo forum fap turbo settings faprobot faps forum fapsturbo fapturbo fapturbo dll fapturbo forum fapturbo forums fapturbo key fapturbo mq4 fapturbo settings fapturbo.dll fapturbo.ex4 fapturbo.mq4 fapturbo16 fapturbo16.ex4 fapturbo3.dll forex auto pilot forum forex autopilot forex autopilot forum forex autopilot key forex autopilot member zone forex autopilot members forex autopilot members area forex autopilot members zone forex autopilot members zone 125 forex autopilot settings forexautopilot forum forexautopilotforum forexautopilotforum.com fxparazitescalper gods gift ea meta4 brokers mt4 nifty mt4stats nfp pilot pipturbo setting fab turbo spangator ultra trend indicator www.forexautopilotforum.com ... powered by Simple Search Cloud

All times are GMT -5. The time now is 10:54 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

Skin design by bogu@project-voyageur

C-Logic SEO 1.0.3 by Computer-Logic.org
Ad Management by RedTyger