very blondie sys: hedge at every tp

 

Hello,

Help me pls, how can I find (or create) a very simple EA:

I set the: Lot, and the take profit.

Initially its open a long and short order, whithout any stop, just with the tps.

When a tp is reached, a new long-short pair will open. (all others remain the same)

thats it.

 

What you are proposing is no different than setting two contrary orders with TPs and then setting pending orders at the TP intervals. Why do you need an EA for this? 

 

I thinking in EA, cause this process should continues like a robot. I would like the EA make an initial buy market and a sell market order with two take profit, and after that repeat this at the take profit levels again.

I try to start writing some code, but its bleeding from several wounds..:

extern int       tp=30;
extern double    lot=0.1;
int start()                                      
  {
   double bid   =MarketInfo(Symbol(),MODE_BID);  
   double ask   =MarketInfo(Symbol(),MODE_ASK);  
   double point =MarketInfo(Symbol(),MODE_POINT);
   OrderSend(Symbol(),OP_BUY,lot,ask,3,bid-15*Point,bid+tp*Point);

   OrderSend(Symbol(),OP_SELL,lot,bid,3,ask+150*Point,ask-tp*Point);

   if (Bid>tp)  // Opening BUY
   OrderSend(Symbol(),OP_BUY,lot,ask,3,bid-150*Point,bid+tp*Point);
   OrderSend(Symbol(),OP_SELL,lot,bid,3,ask+150*Point,ask-tp*Point);
 //  Alert (GetLastError());                       
   return;                                       
  }


 
chucknorris:

I thinking in EA, cause this process should continues like a robot. I would like the EA make an initial buy market and a sell market order with two take profit, and after that repeat this at the take profit levels again.

I try to start writing some code, but its bleeding from several wounds..:

extern int       tp=30;
extern double    lot=0.1;
int start()                                      
  {
   double bid   =MarketInfo(Symbol(),MODE_BID);  
   double ask   =MarketInfo(Symbol(),MODE_ASK);  
   double point =MarketInfo(Symbol(),MODE_POINT);
   OrderSend(Symbol(),OP_BUY,lot,ask,3,bid-15*Point,bid+tp*Point);

   OrderSend(Symbol(),OP_SELL,lot,bid,3,ask+150*Point,ask-tp*Point);

   if (Bid>tp)  // Opening BUY
   OrderSend(Symbol(),OP_BUY,lot,ask,3,bid-150*Point,bid+tp*Point);
   OrderSend(Symbol(),OP_SELL,lot,bid,3,ask+150*Point,ask-tp*Point);
 //  Alert (GetLastError());                       
   return;                                       
  }



 

 Use SRC button for showing the code

extern int       tp=30;
extern double    lot=0.1;
int start()                                      
  {
   double bid   =MarketInfo(Symbol(),MODE_BID);       //Is this needed ??  
   double ask   =MarketInfo(Symbol(),MODE_ASK);       //...........??
   double point =MarketInfo(Symbol(),MODE_POINT);     //...........?? 
   OrderSend(Symbol(),OP_BUY,lot,ask,3,bid-15*Point,bid+tp*Point);      //Every Tick ?? Slippage 3 also on 5 digit...   

   OrderSend(Symbol(),OP_SELL,lot,bid,3,ask+150*Point,ask-tp*Point);    //will not work on ECN no MagicNumber ?? OrderComment ??




   if (Bid>tp)  // Opening BUY                                           // What Symbol  EURUSD will fail 
   OrderSend(Symbol(),OP_BUY,lot,ask,3,bid-150*Point,bid+tp*Point);
   OrderSend(Symbol(),OP_SELL,lot,bid,3,ask+150*Point,ask-tp*Point);
//  Alert (GetLastError());                       
   return;                                       
  } 

Here you see the difference... 

You have to learn yourself more it is a miserable code the way you have it now

It is more like some lines put together then it is an EA you made

 

tnx :((

(I use tradestation,where easylanguage more simplier, but it can't hedging..)

Can you suggest me somebody who can make this EA form me not too expensive?

 
chucknorris:

tnx :((

(I use tradestation,where easylanguage more simplier, but it can't hedging..)

Can you suggest me somebody who can make this EA form me not too expensive?

Register at the MT5 Site and go here:  MT4 & MT5 coding
 

ok, I try it.

tnx a lot!

 
I did it: https://www.mql5.com/en/job/5642
Reason: