MTS “HEDGE”
The term “hedging” (the term derives from the English word “hedge”, which means “insurance”, “guarantee”) refers to taking equal and opposite futures positions in two different markets to offset effects of price risks. The hedging is aimed at protecting against adverse fluctuations in the prices of stocks, commodities, currencies, interest rates, etc.
The principle behind the strategy.
We understand that prices of financial instruments move almost synchronously, and we hope that it will be forever. However, a habitual way of move of the instruments – let’s call them S1 and S2 – sometimes starts to change. For example, suddenly S2 has lagged behind S1 or even turned down after both of the instruments have been moving upwards. We understand that the given situation is an exception from the rule and these instruments will start to move synchronously at a later point in time. Therefore, we place a sell order for S1 and a buy order for S2 at the point. Whenever these instruments go now – upwards or downwards – they will go synchronously again: if S2 lags behind S1, it will catch up with S1 a bit later or S1 will slow down; and if the trend has reversed, then it seems that S1 has lagged behind S2, while moving down at this time, and it will try to catch up with S2 anyway. We realize that there has been a period, when S1 and S2 have moved nonsynchronously. We have successfully “caught” the period and wait, until the instruments start to move synchronously. We will make profit from it anyway. Of course, there are situations, where the instruments diverge farther and farther apart – that is the fault of some important political and economic events. We should open new orders every time, when these instruments diverge apart at a distance equal to the delta step value. Eventually, we should also wait for profit, since it is almost impossible to change a correlation established over many years!
The Expert Advisor trades the instruments that a capable to offset effects of each other’s price risks, for example, gold and silver or CHFJPY and EURJPY. The main thing is that these counter-instruments must have a common “denominator”. Below are tables of instruments correlated to each other.
We should set necessary instruments in the Expert Advisor settings. The Expert Advisor will determine, what instrument should be sold or bought at the moment, wait for the right price movement to happen and place stakes. It protects your deposit from a drawdown by using counter-orders. Orders are closed by total profit set by an external variable.
The Expert Advisor uses “Hedge” indicator.
The indicator compares two instruments, calculates the value of the delta divergence between them and makes a decision about if it should enter the market or not.
Here is an example how the “HEDGE” Expert Advisor trades:
<Description of variables:
extern string SYMBOL2 = ""; //второй символ extern string _period_ = "0-H1 1-H4 2-D1 3-W1 4-MN1"; //это просто текст, показывающий какой число что будет значить для Period_Comparison extern int Period_Comparison = 2; //Это временной промежуток, на котором советник находит максимальное и минимальное расхождение дельты extern int averaging = 5; //усреднение дельты по N свечей extern double StopMarga = 10.0; //маржа для закрытия ордеров //как только прибыль всех ордеров достигнет этого значения (в валюте депозита) все ордера будут закрыты. extern double MinDelta = 30.0; //минимальная дельта для открытия ордеров extern double StepDelta = 10.0; //минимальный шаг дельты для открытия последующих ордеров extern double StopLossMarga = 10000.0; //убыток для закрытия ордеров //как только убыток всех ордеров достигнет этого значения (в валюте депозита) все ордера будут закрыты. extern double LOT = 0.5; //лот первого инструмента (текущего окна) extern double LOT2 = 0.0; //лот второго инструмента, если 0 то определяем автоматом extern double K_LOT = 1.5; //коэффициент увеличения лота при увеличении дельты extern int Magic = 777888; extern int OrderTotal = 5; extern int N_Open_orders = 10; //количество попыток закрытия extern int Slippage = 3; extern color WevesColor = Gold; extern string часы.работы.советника=""; extern int TimeStart = 4 , //время начала работы советника TimeEnd = 24; //время окончания работы советника extern bool DelSingleEntry = true; //удалять ордер, если он остался в одиночестве (без встречной сделки) extern int TimeOpenOrder = 180; //удалять только если ордер открыт более TimeOpenOrder секунд назад extern bool revers = false; //смена направление ордеров extern bool LanguageEng = true; //Language English / Russian |
Algorithm of operation:
The indicator calculates a correlation (hereinafter called the “Delta”) between two instruments over a period determined by “Period_Comparison” variable (one hour = 0, four hours = 1, day = 2, week = 3, month = 4).
The Expert Advisor will open trades at the moment, when the line of delta slides down after its top has been formed, and the current delta value is higher than “MinDelta” value.
The Expert Advisor will close orders, if total profit (in deposit currency) of the orders is higher than “StopMarga” value.
If the delta line continues to rise after orders have been opened, then the Expert Advisor will open additional orders (their lot size is multiplied by “K_LOT” coefficient), when the line covers a distance set by “StepDelta” once again.
The Expert Advisor is allowed to open such a number of orders of every direction that doesn’t exceed the number set by “OrderTotal” variable.
“LOT2”. Lot size of the second instrument will be automatically calculated by the Expert Advisor itself depending on the relation between tick prices of the first and the second instruments. However, if LOT2>0, then the lot size will be set automatically.
The delta is calculated over a certain period of time (hour, day, week, month). When crossing these time thresholds, the current period will be changed for the next one. At the time the delta value might change sharply, so it is desirable that you don’t trade during this time.
The Expert Advisor has a filter (a variable) responsible for its operation time: “часы работы советника”.
“TimeStart” – start of operation time
“TimeEnd” – end of operation time
If an order has not been closed yet, and the end of operation time (set in “TimeEnd”) has come, then the Expert Advisor will wait for the whole series of orders to be closed (it will open additional averaging orders, if necessary). Thereafter it will wait for the start of operation time to come so that it can continue its operation.
If an order is closed with a requote, then the Expert Advisor will repeat the action for the number of times specified in “N_Open_orders” variable. If the order cannot be closed, then it will inform you about it by an alert message.
When trading M1-M5 timeframes, you would better select such conservative instruments as gold – silver. You can also select oil or shares of companies bound by government obligations to each other.
To get a ready-made Expert Advisor or Indicator, you need to pay its cost by one of the methods specified on the Payment web-page and send an e-mail at cmillion@narod.ru, which should contain the name of Expert Advisor or Indicator and a payment option. After doing that, your order will be immediately sent to you.
Price – 500$