Thread: 100 pips
View Single Post
  #10 (permalink)  
Old 01-02-2006, 07:47 PM
fxid10t's Avatar
fxid10t fxid10t is offline
Member
 
Join Date: Sep 2005
Location: MidAtlantic USA
Posts: 71
fxid10t is on a distinguished road
Exclamation modified

the attached ea has the timeperiod=0; by default, meaning it will use the period of the chart it is attached to. Also, fixed the StopLoss bug, and changed trailing stop default parameter to the minimum accepted by the author's origional coding...

Code:
extern int     timeframe=0;
extern double stopLoss     = 50; 
extern double lTakeProfit = 20;
extern double sTakeProfit = 15;
extern double lTrailingStop = 10;
extern double sTrailingStop = 10;
extern color clOpenBuy = Blue;
extern color clCloseBuy = Aqua;
extern color clOpenSell = Red;
extern color clCloseSell = Violet;
extern color clModiBuy = Blue;
extern color clModiSell = Red;
extern string Name_Expert = "100 pips";
extern int Slippage = 2;
extern bool UseSound = true;
extern string NameFileSound = "shotgun.wav";
extern double Lots = 0.1;
Code:
void OpenBuy() { 
   double ldLot, ldStop, ldTake; 
   string lsComm; 
   ldLot = GetSizeLot(); 
   ldStop = Ask-Point*stopLoss; 
   ldTake = GetTakeProfitBuy(); 
   lsComm = GetCommentForOrder(); 
   OrderSend(Symbol
(),OP_BUY,ldLot,Ask,Slippage,ldStop,ldTake,lsComm,0,0,clOpenBuy); 
   if (UseSound) PlaySound(NameFileSound); 
} 
void OpenSell() { 
   double ldLot, ldStop, ldTake; 
   string lsComm; 

   ldLot = GetSizeLot(); 
   ldStop = Bid+Point*stopLoss; 
   ldTake = GetTakeProfitSell(); 
   lsComm = GetCommentForOrder(); 
   OrderSend(Symbol
(),OP_SELL,ldLot,Bid,Slippage,ldStop,ldTake,lsComm,0,0,clOpenSell); 
   if (UseSound) PlaySound(NameFileSound); 
}
for some reason, this expert only seems to place trades when the timeframe is set to 5... and if you set a hard stoploss of 50, watch out below, cause thats where account equity is falling...
Attached Files
File Type: mq4 100 pips v3.1.mq4 (4.5 KB, 1168 views)
__________________
"You should not have a favourite weapon. To become over-familiar with one weapon is as much a fault as not knowing it sufficiently well. You should not copy others, but use weapons which you can handle properly. It is bad for commanders and troopers to have likes and dislikes. These are things you must learn thoroughly." Miyamoto Musashi

Last edited by fxid10t; 01-02-2006 at 08:49 PM. Reason: reattached working modified file
Reply With Quote