Hedging with Zone Recovery Area

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Hedging with Zone Recovery Area

Postby Halim Loutfi » Sat May 23, 2015 1:46 am

Hello,
I would like to know if it would be possible to develop the following trading strategy;
It is a simple hedging strategy that relies on “Zone Recovery Area”.
The main purpose of this strategy is to place automatically the orders as soon as the trade is taken, with a predetermined number of pips for the zone recovery area and for the take profit location.
The orders should also be cancelled automatically when the trade is out. Even if I did not get into the hedging cycle.
I will clarify the strategy using an example
Hypothesis: I am Trading EUR/USD and the zone recovery area consists of 35 pips; the take profit at 80 Pips. (This would mean that when a reverse trade is active to hedge, 115 (35+80) pips are required to close the trade and be out with a zero loss.
Assume I have bought 1 lot at 1.1000 and the market went down.
The system would sell automatically at 1.0965 1.5 lots and place a take profit at 1.08850 and a stop order at 1.1080. (1.1000-0.0035=1.0965).
If my target is not reached and the market goes back up again and RE-hits the 1.1100 and continues back up, and other order should be taken (ALL ORDERS SHOULD BE PLACED IMMEDIATELY WHEN THE TRADE IS TAKEN, I will just have to pre-specify the number of pips for the zone recovery area and the take profit point, those are 35 and 80 pips respectively and the number of lots that I want to enter with at eat reverse trade) to buy again at 1.1000, this time, 1.2 lots with a take profits of +80 pips, that is at 1.1080 and a stop loss at 1.8850 (that is 1.1000- 80 pips).And so on and so forth.
The main challenges for this algorithm is to be able to place all orders when the trade is taken and remove them altogether when I am out of the trade (Not necessarily the hedging trade, but even if I am going through a winning trade the orders should be cancelled when the trade is closed. I couldn’t find an option to close all orders on FXCM. You can close all trading positions but not orders. Unless someone knows if that option exists).
Or course, I would have to specify the number of entries that I want and should be able to get out of the trade at any desired time.

Thank you for your time.
Halim Loutfi
 
Posts: 3
Joined: Sat May 23, 2015 1:19 am

Re: Hedging with Zone Recovery Area

Postby Apprentice » Tue May 26, 2015 3:59 am

While it is complex, it is feasible.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Hedging with Zone Recovery Area

Postby Halim Loutfi » Tue May 26, 2015 4:16 am

I think I have made a mistake by asking to develop a trading Strategy at the top of my query.

In fact I need a FXCM program to be developed.

Anyone?

Thank you
Halim Loutfi
 
Posts: 3
Joined: Sat May 23, 2015 1:19 am

Re: Hedging with Zone Recovery Area

Postby Apprentice » Thu May 28, 2015 5:06 am

FXCM program?
As a standalone application, which will use FXCM data stream.
Indicator or...?
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Hedging with Zone Recovery Area

Postby Halim Loutfi » Thu May 28, 2015 5:26 am

Apprentice wrote:FXCM program?
As a standalone application, which will use FXCM data stream.
Indicator or...?



Yes it it should be for FXCM.
I am using FXCM.
I do not know exactly how it will be implemented in the FXCM application.
Thanks for the help.
Halim Loutfi
 
Posts: 3
Joined: Sat May 23, 2015 1:19 am

Re: Hedging with Zone Recovery Area

Postby easytrading » Thu Jul 30, 2015 12:09 am

Apprentice wrote:While it is complex, it is feasible.



Apprentice kindly, could you coded it as an automated strategy ? your help is much appreciated.
easytrading
FXCodeBase: Initiate
 
Posts: 154
Joined: Thu Sep 11, 2014 5:23 pm

Re: Hedging with Zone Recovery Area

Postby Apprentice » Tue Aug 04, 2015 2:19 am

Your request is added to the development list.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Hedging with Zone Recovery Area

Postby Ranger5542 » Fri Mar 01, 2019 10:56 am

To Apprentice


Hello and thank you for reading this

I would like to know if it would be possible to develop the following trading strategy Automated EA.
It is a hedging type strategy that is designed in the following manner

1. an initial OP_BUY order is placed either auto or manually

2. a OP_SELLSTOP order is placed at the same time at a user defined distance in PIPS below the Buy order


3. During market conditions if the market trends short from the original entry and passes through and triggers the SELLSTOP level, a OP_BUYSTOP order is placed at the same price level as the original BUY order
and this continues for every OP_BUYSTOP order during the combined trade

This same condition occurs when the market may head in the long direction after triggering a SELLSTOP order when the market passes through the OP_BUYSTOP level, a OP_SELLSTOP order is placed along the same price as the original OP_SELLSTOP price

4. Take Profit is user defined for both types of trades so two seperate TP inputs


5. all OP_BUYSTOP and OP_SELLSTOP orders have their own unique lots size so there would be 6 lots sizes for all buy orders and 6 lots sizes for all sell orders so total of 12 lots size therefore 12 inputs for each lot size
that are defined by the user in the EA Box of inputs


6. When a take profit level is passed all orders close both open and any that may not be opened the trade is completely closed, and the EA cycle begins again after the close of next candle following the closed trade

7. No Stop loss is required for this strategy as all orders close when a Take profit level is triggered

I hope this is clear in what I am asking and not to difficult to code

I have requested user inputs so anyone can use to their own trading strategy as I am more than happy for this EA to be used/shared publically for others to try as Im confident with the right settings it would be a profitable EA

The user input should look like the following
extern double Slippage = 5;
extern double Lots1 = 0.10;
extern double Lots2 = 0.10;
extern double Lots3 = 0.10;
extern double Lots4 = 0.10;
extern double Lots5 = 0.10;
extern double Lots6 = 0.10;
extern double Lots7 = 0.10;
extern double Lots8 = 0.10;
extern double Lots9 = 0.10;
extern double Lots10 = 0.10;
extern double Lots11 = 0.10;
extern double Lots12 = 0.10;
extern int TakeProfit = 2000;
extern int MagicNumber = 129568;
int i=1;


Example of what orders should look like except that there are 1 OP_BUY and 5 OP_BUYSTOP

There are 6 OP_SELLSTOP orders
{
OrderSend(Symbol(),OP_SELL,Lots1,Bid,5,Bid+StopLoss*Point,Bid-TakeProfit*Point,"",MagicNumber,0,CLR_NONE);
OrderSend(Symbol(),OP_SELL,Lots2,Bid,5,Bid+StopLoss*Point,Bid-TakeProfit*Point,"",MagicNumber,0,CLR_NONE);
OrderSend(Symbol(),OP_SELL,Lots3,Bid,5,Bid+StopLoss*Point,Bid-TakeProfit*Point,"",MagicNumber,0,CLR_NONE);
OrderSend(Symbol(),OP_SELL,Lots4,Bid,5,Bid+StopLoss*Point,Bid-TakeProfit*Point,"",MagicNumber,0,CLR_NONE);
OrderSend(Symbol(),OP_SELL,Lots5,Bid,5,Bid+StopLoss*Point,Bid-TakeProfit*Point,"",MagicNumber,0,CLR_NONE);
OrderSend(Symbol(),OP_SELL,Lots6,Bid,5,Bid+StopLoss*Point,Bid-TakeProfit*Point,"",MagicNumber,0,CLR_NONE);
OrderSend(Symbol(),OP_SELL,Lots7,Bid,5,Bid+StopLoss*Point,Bid-TakeProfit*Point,"",MagicNumber,0,CLR_NONE);
OrderSend(Symbol(),OP_SELL,Lots8,Bid,5,Bid+StopLoss*Point,Bid-TakeProfit*Point,"",MagicNumber,0,CLR_NONE);
OrderSend(Symbol(),OP_SELL,Lots9,Bid,5,Bid+StopLoss*Point,Bid-TakeProfit*Point,"",MagicNumber,0,CLR_NONE);
OrderSend(Symbol(),OP_SELL,Lots10,Bid,5,Bid+StopLoss*Point,Bid-TakeProfit*Point,"",MagicNumber,0,CLR_NONE);
OrderSend(Symbol(),OP_SELL,Lots11,Bid,5,Bid+StopLoss*Point,Bid-TakeProfit*Point,"",MagicNumber,0,CLR_NONE);
OrderSend(Symbol(),OP_SELL,Lots12,Bid,5,Bid+StopLoss*Point,Bid-TakeProfit*Point,"",MagicNumber,0,CLR_NONE);

Thank you for your time.
Ranger5542
 
Posts: 27
Joined: Thu Feb 28, 2019 10:07 am

Re: Hedging with Zone Recovery Area

Postby Apprentice » Mon Mar 04, 2019 7:08 am

Your request is added to the development list under Id Number 4514
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Next

Return to Indicator and Signal Requests

Who is online

Users browsing this forum: No registered users and 13 guests