[0:01]Hello guys. I hope you all are doing well. In this video, I'm going to teach you how to use hedging strategy. This video contains two different section, the sections. The first section is about the hedging strategy itself and I explain how it works. The second section is about the math behind the hedging strategy and how to use the mathematics to calculate the lot size for each trade in each iteration. So if you are already familiar with hedging strategy and you are only interested in the mathematics subject, I suggest you to skip the video to the minute and second that you can see below in this video. If this is the first time watching our video, in our channel, we speak about the algorithmic trading and different kind of strategies for cryptocurrencies, forex and any other markets. If you are interested in this subject, I would really appreciate if you subscribe our channel and at the end of the video, if you liked it, please hit the like button so YouTube algorithm will introduce us to others who are interested in these subjects. And if you have any suggestion for me, any subjects that you want me to cover, I would really appreciate if you leave a comment and give me your feedback in the comments. I will read them and will consider them for future videos. I wish you enjoy this video and stay with us until the end.
[1:44]Imagine that the price for one share or one pair going like that and based on our strategy, we decide to send a buy order here in this price and we send one lot buy order. Then normally we have a take profit here. we consider it as a sixty pips. Uh and we have a stop loss that uh based on the fact that here we consider the risk to reward three. uh it would be twenty pips lower than entry points. Uh normally when the price hit the stop loss, we close the order and we lose money. This is the normal way of trading. But when we are using the hedging technique, uh I don't call it strategy because I consider it as a technique to uh close the orders, not uh opening a trade. So, uh with hedging techniques, instead of closing uh the order when it hits the stop loss, we have another line which in this case, instead of closing the order, we open another order which is in contrast with the first all order. When it is buy here we enter with a sell and we decide to enter with 1.5 lot. And as I mentioned, how to calculate these lot size, I would explain in next section. Here I only uh explain how the uh hedging techniques work and then I explain how to calculate these lots for each iteration. So, uh and after opening another order in uh other direction, we have another line here. Uh this line would be take profit for the sells orders and stop loss for buy orders. And the line here would be take profit for buy orders and stop loss for sell orders.
[4:14]So. And both of these uh sections are 60 pips and here it is 20 pips. But uh this is just an an example and it can be any pips. Just uh we must do it based on our risk to reward. So. Now, uh imagine that in this case price goes in our favor and go down and down and down and hit these sells take profit. And uh buy stop loss. When we hit it, we close all open orders, whether they are sell orders or buy orders. And in this case, uh what would be our profit? First, uh we opened uh we opened 1.5 lot sell order here which it gains 60 pips. And it would be 60 multiply 1.5 lot and plus minus 80 multiply one. Why? Because we have a buy order. It is uh its value is one lot and it has lost 80 pips. So it would be minus 80 multiply one and the result would be 10 unit. Uh so in the normal way of trading when we hit the take the stop loss actually we would have lost uh money. But in this case, we gained even a little amount of money, although the purpose of this strategy is not gaining money, it is preventing to stop to losing money. So, now imagine that after this iteration, uh price does not go in our favor and it again goes back and go higher and again hit this buy lines. In this case, we send another buy order. For example, here 1.1 lot and I explain how to calculate these lot here. It is not complicated. It is simple. Uh and after sending this 1.1 buy lot, the the price goes in our favor and hit the buys take profit or sells stop loss. What would be our profit in this case? Here we have two open buy orders. One of them is one lot and other is 1.1 and both of them gain 60 pips. Plus minus 1.5 multiply 80 and the result would be six unit and still still we would gain some money.
[7:07]Again, the next iteration if uh the price does not go in our favor and goes back and hit uh the sell lines, we again send another sell order with 1.6 lot. And uh when it continues in our favor, uh our profit would be 80, 18 units. So, basically this is how the hedging technique works. theoretically these techniques help you never lose money. But it's not possible to to hedge forever and in one point, because you are paying spread, you you are paying commissions, you are paying swaps, in one point, uh your margin would be limited. And uh the broker will not uh or would not let you to send another order. So it is very important that you know that whenever you are using this techniques to close your orders, actually you are risking uh your whole balance for being margin called. Although it is rare to be margin call, but it would happen. Some things in these markets may not happen in three years, but once they happen, uh they will margin call your account. So, you must be very careful and uh of course, it's better to start hedging with very small lots. You're first when you are using these techniques, your first order must be very small. It is important to notice that uh for us, it is better to uh only open one order and the first order that we open based on our strategy hit the take profit because in this case, uh we would gain the maximum amount of money. But uh when we are implementing actually the uh hedging strategy, hedging techniques to close the order, it means that our fair our first uh preconceptions regarding uh the entry points and uh the signal that gave us to send the order was not true and we were wrong. So, uh we don't want to gain money. We just want to close the orders without losing money. So, in this section, I teach you how to calculate the lot size for each iteration in hedging strategy. Uh to this point, we know that we have a buy lines buys line and the sells line here and uh two different line. That uh here this line would be the take profit for buys orders and the stop loss for uh sells orders and uh vice versa. Here we this line would be the take profit for all sells order and stop loss for buy orders. This distance would be A, as you can see in the formula, the A uh would be can be anything and it doesn't matter because uh we have a division that all A's would be simplified together.
[10:19]But you can see it uh in the next section. And uh this distance would be risk to reward multiply A. For the previous example, we considered here 20 pips and here three times uh bigger and it was 60. But generally, it is risk to reward multiply A and here again, it is risk to reward multiply A. So, if the price go goes like that and we enter here with uh the lot size of first buy and price goes down and we enter with the lot size of first sell. And uh when the price goes in our favor, in order to stay in profit, this non-equation must be true. What is that? Uh lot size of first sell multiply this distance, this distance, which is risk to reward multiply A. Must be greater than lot size of first buy multiply its distance, which is this distance, this distance plus this one A plus risk to reward multiply A. And then uh it would become this one. Here A plus risk to reward A divided to risk to reward multiply A, the A would be simplified together. And LS1 must be greater than risk to reward plus one divided risk to reward multiply lot size of first buy.
[12:06]So, this is the final equation for the first iteration.
[12:13]Uh as an example, if the lot size of first buy be one and the risk to reward be three, then based on this formula, lot size of first sell must be greater than 1.34. And in order to cover the commission, spread and swap, I usually multiply it to 1.1. So it would be 10% higher and lot size of first sell would be 1.48. Of course, you can use, for example, uh your percentage. Maybe 1.2 or 1.05, 5% higher than that. But I prefer, based on my broker, I prefer to multiply it by 1.1 and uh and consider it 10% higher. So, now we continue our uh equation. Imagine that we hit these lines several times and here it would be the lot size of first buy, lot size of first sell, lot size of second buy, lot size of second sell, lot size of third buy, and here lot size of N-1 sell, lot size of N's sell. So, we continue, we write the calculation again. In order to stay in profit, the sum of all sells lots multiply 60 or risk to reward multiply A. Here I wrote 60 to be to seems uh more simple. Must be greater than the sum of buys lots multiply 80. But of course, here it is risk to reward multiply A.
[14:23]And here is A plus risk to reward multiply A. So, it would change to this non-equation, which it means lot size of N's L must be plus lot size of N-1 sells, plus lot size of second sells, plus lot size of first sells. Must be greater than risk to reward plus one divided risk to reward multiply lot size of N's buy, plus lot size of third buy, plus lot size of second buy, and plus lot size of first buy.
[15:20]And if we transmit this parenthesis here, because all of these lot size are known for us, because we have calculated them in previous iterations. Except this one, lot size of N's sell. This one is known, this one is known, this one is all of them are known because we have calculated them in previous iterations. So, we transmit the parenthesis here, we want to find out the value of this lot size. So, lot size of N's sell must be equal to risk to reward plus one divided risk to reward multiply the sum of open buys lots.
[16:15]All the buys lots which are open right now, minus the sum of open sells lot. Here, this blue one means the sum of all of these lots. And the red one means the sum of all these lots. And in order to cover the commission and spreads and swaps, I multiply whole of this equation by 1.1. So consider the lot size 10% higher. And this is the final formula for calculating the lot size of uh the sell. And if uh instead of calculating the sell lot size, we are crossing the buys line and we want to calculate the buy, the lot size of buy order. The formula would be exactly vice versa. And uh the lot size of N's buy would be risk to reward plus one divided by risk to reward. Multiply sum of open sells lots, minus sum of open buys lots. And in order to cover the expenses, we multiply them by 1.1 to consider it 10% higher. So, I use this formula to implement my expert advisor and use algorithmic trading to implement the hedging strategy. Because hedging strategy is a little sensitive and uh it's not efficient to sit down in front of the your computer and uh always check whether it's time to open the next order or not and it must be done by algorithmic trading. Uh this formula is the formula that I always use in hedging techniques. I hope you enjoyed this video. Please, uh do not forget uh to introduce us to your friends. Those who are interested in this subjects. And if you like the video, please hit the like button so YouTube algorithm will introduce us to others who are interested in this subject. I wish you have a good day. Goodbye.



