hello guys im using a hedging EA, and i had this great idea…
this robot is very very simple and it creates and hedge everytime there is no orders open.
i want just to add annother function that is: whenever it reachers a take profit of one side it will change the take profit of the oposite side to a minimum just to avoid any losses.
so the price doesnt have to go completely down to make a profit:
#property copyright “Copyright © 2010 - Monu Ogbe”
#define MAGIC 1234
#define IDENT “lepolepo”
extern double lots = 1;
extern double stop_loss = 100; // (8 pips) optimise 50-2000
extern double take_profit = 70; // (75 pips) optimise 50-2000
int last_bar = 0;
int start(){
if (last_bar == Bars) return(0);
last_bar = Bars;
if (OrdersTotal() == 0){
OrderSend(Symbol(), OP_BUY, lots ,Ask, 3, Ask - stop_loss * Point, Bid + take_profit * Point, IDENT, MAGIC, 0, Blue);
OrderSend(Symbol(), OP_SELL, lots ,Bid, 3, Bid + stop_loss * Point, Ask - take_profit * Point, IDENT, MAGIC, 0, Red);
}
return(0);
}