MQL4 - automated forex trading   /  

Code Base

ODL Securities

Code Base  Expert Advisors  TrendMeLeaveMe To post a new code, please log in or register

This expert is for
MetaTrader 4
Download MT4 - 3.5 Mb

Mobile trading!
Buy a license and be mobile in your trading!

Name:
TrendMeLeaveMe
Author: waddahattar (2007.02.19 17:23)
Rating: 6.3
Downloaded: 10962
Download:
 TrendMeLeaveMe.mq4 (7.5 Kb) View


Just draw Trend Up or Trend Down before the Expert Advisor "TrendMeLeaveMe" start. Set properties, run expert and go to sleep or work.

This expert does not work automatically. You must draw trend up, trend down or horizontal trend. Name it buystop or sellstop , set BuyStop_StepUpper, BuyStop_StepLower, SellStop_StepUpper and SellStop_StepLower Properties.

When price enter area between your buystop trend and BuyStop_StepLower, expert will open buystop order at Price BuyStop_StepUpper. When price enter area between your sellstop trend and SellStop_StepUpper, expert will open sellstop order at Price SellStop_StepLower.

The expert will always modify OpenPrice to both orders when the price walks with the trends Until Price goes out Previuos area.

You can set BuyStop_StopLoss , BuyStop_Takeprofit and BuyStop_Lot to buystop. You can set SellStop_StopLoss , SellStop_Takeprofit and SellStop_Lot to sellstop.

Look this chart to more explain:





This is another example:



 

10 comments  To post a new comment, please, log in or register
DarkHTC wrote:
After trying a good number of EAs that are found here, I have concluded that the purpose of most of the participants are just to post something, if really you EA do a good thing, here we have this yearly championship, try it there....

this is a manual trading expert , meaning it doesn't trade by it self how could Waddah use it on the championship !!

please read before you post your opinionĀ 


28.07.2008 09:44 fadiy

Is the big problem to set the lines:

BuyStop_StepUpper, BuyStop_StepLower, SellStop_StepUpper, SellStop_StepLower, buystop, sellstop

as the moved lines with the changed for each hour chart? I mean that EA should control current 1H candle and last 24 candles in order to change and set proper the lines.
If the lower minimum candles was changed then the lines:
SellStop_StepUpper, SellStop_StepLower and sellstop should be also change. If the upper max candles was changed then the lines:
BuyStop_StepUpper, BuyStop_StepLower, buystop should be also change.

? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?



17.07.2008 09:11 puncher
After trying a good number of EAs that are found here, I have concluded that the purpose of most of the participants are just to post something, if really you EA do a good thing, here we have this yearly championship, try it there....
12.07.2008 18:56 DarkHTC

Hi waddahattar,


Thanks a lot for this EA. It is very useful mainly if you work on the other place than home ;).

Does it work on each time frame - for example daily chart or 30 min charts ???

Could you please also change on your EA the stop loss and take profit into hidden stop loss and hidden take profit? I mean something like this:


extern double hidden_TakeProfit = 73;
extern double hidden_StopLoss = 333;

extern double Lots = 0.1;
extern double target_tp1 = 25; //  first level of the profit
extern double target_tp2 = 36; //  second level of the profit
extern double target_tp3 = 54; // third level of the profit

.

.

.

// check for opened orders


for(cnt = 0; cnt < total; cnt++)
      {
        OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
        if(OrderType() <= OP_SELL && OrderSymbol() == Symbol())
          {
            if(OrderType() == OP_BUY)   // If long is opened
              {
                     // we secure current profit or we are acepting the loss defined on hidden_StopLoss variable
                if(Bid <= (OrderOpenPrice()-(hidden_StopLoss*Point)) || Bid >= (OrderOpenPrice()+(hidden_TakeProfit*Point)) )
                      {
                        OrderClose(OrderTicket(),Lots,Bid,3,Green);
                        return(0);
                      }
                     // we secure third level of profit
                if(Bid >= OrderOpenPrice()+(target_tp3*Point))
                     {
                        OrderModify(OrderTicket(), OrderOpenPrice(), Bid - (Point * (target_tp3-13)), Ask + (Point * hidden_TakeProfit), 0, Green);
                        return(0);
                     }
                     // we secure second level of profit
                if(Bid >= OrderOpenPrice()+(target_tp2*Point) && Bid < OrderOpenPrice()+(target_tp3*Point))
                     {
                        OrderModify(OrderTicket(), OrderOpenPrice(), Bid - (Point * (target_tp2-13)), Ask + (Point * hidden_TakeProfit), 0, Green);
                        return(0);
                     }
                     // we secure first level of profit
                if(Bid >= OrderOpenPrice()+(target_tp1*Point) && Bid < OrderOpenPrice()+(target_tp3*Point) && Bid < OrderOpenPrice()+(target_tp2*Point))
                     {
                        OrderModify(OrderTicket(), OrderOpenPrice(), Bid - (Point * (target_tp1-13)), Ask + (Point * hidden_TakeProfit), 0, Green);
                        return(0);
                     }
              }
            else //  If short is opened
              {
              // we secure current profit or we are acepting the loss defined on hidden_StopLoss variable
                if(Ask >= (OrderOpenPrice()+ (hidden_StopLoss * Point)) || Ask <= (OrderOpenPrice()-(hidden_TakeProfit*Point)) )
                      {
                        OrderClose(OrderTicket(),Lots,Ask,3,Red);
                        return(0);
                      }
               // we secure third level of profit      
                if(Ask <= OrderOpenPrice()-(target_tp3*Point))
                     {
                       OrderModify(OrderTicket(), OrderOpenPrice(), Ask + (Point * (target_tp3+13)), Bid - (Point * hidden_TakeProfit), Red);
                       return(0);                       
                     }
                 // we secure second level of profit
                if(Ask <= OrderOpenPrice()-(target_tp2*Point) && Ask > OrderOpenPrice()-(target_tp3*Point) )
                     {
                       OrderModify(OrderTicket(), OrderOpenPrice(), Ask + (Point * (target_tp2+13)), Bid - (Point * hidden_TakeProfit), Red);
                       return(0);                       
                     }
                  // we secure first level of profit
                if(Ask <= OrderOpenPrice()-(target_tp1*Point) && Ask > OrderOpenPrice()-(target_tp2*Point) && Ask > OrderOpenPrice()-(target_tp3*Point) )
                     {
                       OrderModify(OrderTicket(), OrderOpenPrice(), Ask + (Point * (target_tp1+13)), Bid - (Point * hidden_TakeProfit), Red);
                       return(0);                       
                     }               
                 return(0);
              }
          }
      }
//----
    return(0);
  }
//+------------------------------------------------------------------+




Regards,

Puncher

11.07.2008 17:37 puncher
jeffzie wrote:
Please how can i get this expert??




i want to know what is the mean of sellStop_step lower and etc?
24.01.2008 06:13 firma
Please how can i get this expert??




17.11.2007 11:45 jeffzie

This is a great tool. but sometimes the red dot lines do not show up. It does not trade when dot lines are not visible. I don't know why. Anybody has the answer? thanks

03.05.2007 08:03 MARSHALL18
gatowman wrote:
Indicatoren,

Hi Waddahadda,

my template looks different, and the EA dont works by me, can you tell me why?

If i need more indicators please tell me...

Thanks

gatowman
pls just draw a trend and name it sellstop or buystop

this expert don't need any thing ( indicator or dll )

thank you
13.03.2007 03:23 waddahattar
Indicatoren,

Hi Waddahadda,

my template looks different, and the EA dont works by me, can you tell me why?

If i need more indicators please tell me...

Thanks

gatowman
12.03.2007 16:18 gatowman
This is a great EA. I have tried this on demo the last few nights. I have been trying to find or program a similar trend/order method (automated) for a while. I will definetly be trying this further.

One suggestion would be a trailing stop even a multi-level/pyramiding trailing stop ie; 0 to 30 pips profit use a 30 point trailing stop, 30 - 50 pips profit use a 15 pip stop etc... for 2 or 3 levels. Iv'e had a quick look at the code to do this but am not that fluent in mql4.... any way this is a great EA!

Greg.
 
09.03.2007 02:36 gdwhite73