Forex
Google
New signals service!

Go Back   Forex Trading > Downloads > Expert Advisors - Metatrader 4


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-04-2007, 08:37 PM
DanielTyrkiel's Avatar
Senior Member
 
Join Date: Nov 2005
Posts: 176
DanielTyrkiel is on a distinguished road
I've searched but couldn't find it...

There has been an EA that opened trades based on a given price band. trader inputs the band's high/low value, and the ea buys on high, stops and reverses on low (and vice versa). If any of you have anything similar or can help with coding, it would be most appreciated. the logic should be very simple. All the ea should do is place market orders and increase the tp by the value of lost pips after reversal occurs. Also the magic number is important to be able to have multiple eas on at the same time.
The idea is to buy on previous day's high, or sell on its low, and reverse if the sl gets hit. initial tp is 20 pips and sl is the other order's level. The ea should allow for direction change as many times as it is necessary for the price to finally take off away from the set band.

Edit: had to update the pic.
Attached Images
File Type: gif high low buy sell 20 pip target.gif (60.1 KB, 78 views)
__________________
Think for Yourself, Question Authority

SKYPE: danieltyrkiel

Last edited by DanielTyrkiel; 02-04-2007 at 09:57 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-04-2007, 09:50 PM
DanielTyrkiel's Avatar
Senior Member
 
Join Date: Nov 2005
Posts: 176
DanielTyrkiel is on a distinguished road
I've found this thread on a high/low break out : Daily high-low break system EA
do you think it could be a good starting point?
__________________
Think for Yourself, Question Authority

SKYPE: danieltyrkiel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-04-2007, 10:21 PM
DanielTyrkiel's Avatar
Senior Member
 
Join Date: Nov 2005
Posts: 176
DanielTyrkiel is on a distinguished road
I've found another ea on mt yahoo forum: http://www.lightpatch.com/forex/_MT4...uy_Lo_Sell.mq4


//+------------------------------------------------------------------+
//| Hi_Buy_Lo_Sell |
//|This EA will take the previous bar hi and low, set a stop buy on |
//|the high price, set a stop sell at the low price, and close |
//|pending trades at EOD. |
//+------------------------------------------------------------------+

//---- input parameters
extern int EOD=24;
extern int BreakEven=10;
extern int StopLoss=50;
extern int TrailingStopStep=20;
extern int TakeProfit=15;
extern double Lots=0.1;
extern int Pips=5;
extern double StartingBalance=5000;
extern int timeframe=0;

//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
int i,Ticket,LastOrderTime,StartTime,StartTime1,EODTim e,MN;

//Settings for each currency pair. Copy "else if" to create more.
if (!IsTesting()){
if (Symbol()=="EURUSD"){
StopLoss=20;
BreakEven=0;
TakeProfit=0;
}
else if (Symbol()=="GBPUSD"){
StopLoss=20;
BreakEven=0;
TakeProfit=0;
}
else { //default
StopLoss=20;
BreakEven=0;
TakeProfit=0;
}
}

// Ron's mod for lot increasement based on StartingBalance
// this will trade 1.0, then 1.1, then 1.2 etc as balance grows
// or 0.9 then 0.8 then 0.7 as balance shrinks
Lots=NormalizeDouble(AccountBalance()/StartingBalance,1);
Lots=Lots/10; //allow for mini account.
if (Lots>50) Lots=50;


//Count time
if(CurTime()==StrToTime("00:00")) {
StartTime1=StrToTime("00:00");
if(DayOfWeek()==5) EODTime=MathMin(StrToTime("22:55"),StrToTime(EOD+" :00"));
else if (EOD==24) EODTime=StrToTime("23:59");
else EODTime=StrToTime(EOD+":00")-60;
}

//Set orders
if(CurTime()>=StartTime1 && CurTime()<StartTime1+300){
MN=1;
StartTime=StartTime1;
SetOrders(MN,StartTime);
}
/*
//Manage of open orders
for (i=0;i<OrdersTotal();i++){
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(CurTime()<=GlobalVariableGet("LastOrderTime")+1 0) Sleep(10000);
if(CurTime()>=EODTime){
//if(OrderSymbol()==Symbol() && OrderType()==OP_BUY) OrderClose(OrderTicket(),OrderLots(),Bid,3,Red);
//if(OrderSymbol()==Symbol() && OrderType()==OP_SELL) OrderClose(OrderTicket(),OrderLots(),Ask,3,Red);
if(OrderSymbol()==Symbol() && OrderType()==OP_BUYSTOP) OrderDelete(OrderTicket());
if(OrderSymbol()==Symbol() && OrderType()==OP_SELLSTOP) OrderDelete(OrderTicket());
GlobalVariableSet("LastOrderTime",CurTime());
}
else {
if(TrailingStopStep==0){ //move at break even ("BE") if profit>BE
if(OrderSymbol()==Symbol() && OrderType()==OP_BUY){
if(High[0]-OrderOpenPrice()>=BreakEven*Point && OrderStopLoss()!=OrderOpenPrice()){
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOp enPrice(),OrderTakeProfit(),0,Green);
GlobalVariableSet("LastOrderTime",CurTime());
}
}
if(OrderSymbol()==Symbol() && OrderType()==OP_SELL){
if(OrderOpenPrice()-Low[0]>=BreakEven*Point && OrderStopLoss()!=OrderOpenPrice()){
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOp enPrice(),OrderTakeProfit(),0,Green);
GlobalVariableSet("LastOrderTime",CurTime());
}
}
}
else { //use trailing stop
if(OrderSymbol()==Symbol() && OrderType()==OP_BUY){
if(High[0]-OrderStopLoss()>=(StopLoss+TrailingStopStep)*Point ){
OrderModify(OrderTicket(),OrderOpenPrice(),OrderSt opLoss()+TrailingStopStep*Point,OrderTakeProfit(), 0,Green);
GlobalVariableSet("LastOrderTime",CurTime());
}
}
if(OrderSymbol()==Symbol() && OrderType()==OP_SELL){
if(OrderStopLoss()-Low[0]>=(StopLoss+TrailingStopStep)*Point){
OrderModify(OrderTicket(),OrderOpenPrice(),OrderSt opLoss()-TrailingStopStep*Point,OrderTakeProfit(),0,Green);
GlobalVariableSet("LastOrderTime",CurTime());
}
}
}
}
}
*/
//Reset global variables at EOD
if(CurTime()>=EODTime) GlobalVariablesDeleteAll();

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

int SetOrders(int MN,int StartTime){
int i,Ticket,LastOrderTime,Bought=0,Sold=0,ShiftToStar t,ShiftToBeginOfRange,timeframe;
double EntryLong,EntryShort,SLLong,SLShort,TPLong=0,TPSho rt=0;

if(timeframe==0) {timeframe=Period();}
//Determine entry and stop.
EntryLong =High[1];
EntryShort =Low[1];
SLLong =MathMax(EntryLong-StopLoss*Point,EntryShort);
SLShort =MathMin(EntryShort+StopLoss*Point,EntryLong);

if (TakeProfit>0)
{
TPLong =EntryLong+TakeProfit*Point;
TPShort =EntryShort-TakeProfit*Point;
}

//Check Orders
for (i=0;i<OrdersTotal();i++)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()==Symbol() && (OrderType()==OP_BUYSTOP) && OrderMagicNumber()==MN) OrderDelete(OrderTicket());
if(OrderSymbol()==Symbol() && (OrderType()==OP_SELLSTOP) && OrderMagicNumber()==MN) OrderDelete(OrderTicket());
}
// if(Bought==0)
// { //no buy order
Ticket=OrderSend(Symbol(),OP_BUYSTOP,Lots,EntryLon g,3,SLLong,TPLong,"Hi_Buy_Lo_Sell",MN,0,Green);
if(Ticket<0 && GetLastError()==130)
Ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,SLLong ,TPLong,"Hi_Buy_Lo_Sell",MN,0,Green);
GlobalVariableSet("LastOrderTime",OrderOpenTime()) ;
// }
// if(Sold==0)
// { //no sell order
Ticket=OrderSend(Symbol(),OP_SELLSTOP,Lots,EntrySh ort,3,SLShort,TPShort,"Hi_Buy_Lo_Sell",MN,0,Green) ;
if(Ticket<0 && GetLastError()==130)
Ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,SLSho rt,TPShort,"Hi_Buy_Lo_Sell",MN,0,Green);
GlobalVariableSet("LastOrderTime",OrderOpenTime()) ;
// }
}
__________________
Think for Yourself, Question Authority

SKYPE: danieltyrkiel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

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 On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can someone tell me about Super RSI? Where can I find it? carly96 Expert Advisors - Metatrader 4 8 06-11-2007 01:59 PM
Please help to find this expert. savio Expert Advisors - Metatrader 4 5 06-06-2007 02:56 PM
Find newest SDX-Tzpivots toddanderson Indicators - Metatrader 4 6 03-21-2007 10:45 PM
simple trendline breakeout EA searched forex2006 Suggestions for Trading Systems 1 02-10-2007 04:57 PM
Where can i find this Charting ? nak71 Tools and utilities 3 08-24-2006 04:56 AM


All times are GMT. The time now is 11:51 AM.



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