Can you make a stop-loss on a hedged position, hence a long-short position, in MT5?

 

Hello

I am looking for a way to make a stop loss on a hedged position, can anyone help me?

Of course I know how to make a regular stop loss. e.g. If I buy stock A at price 100, I can fx make a stop loss at 90, so if the price goes below 90, the stock will be sold. What I am looking for is a stop loss on a hedged position. e.g. if you buy stock A at 100 and sell stock B at 50, then the ratio on the long-short position is 2 (=100/50). I would now like to put a stop on this ratio, such that if fx the ratio moves to below 1.6 the position will be closed hence stock A will be sold and stock B will be bought back.

I like to hedge out risk in this way. But i need to be able to set this stop-loss on the ratio. you cannot set one stop-loss on stock A and one stop-loss on stock B, you have to put the stop loss on the ratio. I hope that since MT5 has a auto-trading function, then maybe it´s possible to code this? - I don´t know? Most plafforms doesn´t have the opportunity to make this ratio stop-loss, but they do exist. The problem is that these platform are very expensive and can only be afforded by Hedge Funds and Investments Banks.

If anyone can help - or point me in the wright direction, I would be very thankful. Honestly I don´t know where else to figure it out at the moement. If it´s not possible in MT5, then maybe someone know another way, maybe another platform where it´s possible.

THX

Esben (Denmark)

 
Esben86:

Hello

I am looking for a way to make a stop loss on a hedged position, can anyone help me?

Of course I know how to make a regular stop loss. e.g. If I buy stock A at price 100, I can fx make a stop loss at 90, so if the price goes below 90, the stock will be sold. What I am looking for is a stop loss on a hedged position. e.g. if you buy stock A at 100 and sell stock B at 50, then the ratio on the long-short position is 2 (=100/50). I would now like to put a stop on this ratio, such that if fx the ratio moves to below 1.6 the position will be closed hence stock A will be sold and stock B will be bought back.

I like to hedge out risk in this way. But i need to be able to set this stop-loss on the ratio. you cannot set one stop-loss on stock A and one stop-loss on stock B, you have to put the stop loss on the ratio. I hope that since MT5 has a auto-trading function, then maybe it´s possible to code this? - I don´t know? Most plafforms doesn´t have the opportunity to make this ratio stop-loss, but they do exist. The problem is that these platform are very expensive and can only be afforded by Hedge Funds and Investments Banks.

If anyone can help - or point me in the wright direction, I would be very thankful. Honestly I don´t know where else to figure it out at the moement. If it´s not possible in MT5, then maybe someone know another way, maybe another platform where it´s possible.

THX

Esben (Denmark)

It can be coded. You just have to hire a freelancer.

By the way if you really trade stocks, you will have a netting account and only 1 position so it's even easier to do, and you don't need to code.

 

Hi

Thank you for your answer. I have traded a little, but have never tried this strategy, where you have to close two positions at the same time, by automated stop-loss, based on the ratio between the stocks. What I want is to have maybe 5 pairs of long-short positions, so 10 stocks in all.

1) How does such a netting account work and how do you get it? 

2) How do I hire a freelancer and what should the price be? - I have no idea of how long it would take and how difficult it is, so what is a fair price? How does the transactions work, and can you trust the freelancers?

 

Position Accounting System

Two position accounting systems are supported in the trading platform: Netting and Hedging. The system used depends on the account and is set by the broker.

--------

and continue with this link - https://www.metatrader5.com/en/terminal/help/trading/general_concept#position_type

Basic Principles - Trading Operations - MetaTrader 5 Help
Basic Principles - Trading Operations - MetaTrader 5 Help
  • www.metatrader5.com
is an instruction given to a broker to buy or sell a financial instrument. There are two main types of orders: Market and Pending. In addition, there are special Take Profit and Stop Loss levels. is the commercial exchange (buying or selling) of a financial security. Buying is executed at the demand price (Ask), and Sell is performed at the...
 

Freelance

Freelance


The forum

  1. What MQL5 developers think about the Freelance service  
  2. Freelance arbitration - forum thread, and also the rules here (what will happen if the employer is not logging in his account for many days during arbitration)
  3. Use tips in the Freelance service! - good tread with the instruction about HowTo use Freelance
  4. Add translation of your Market product or order it in Freelance
  5. MQL5.com Freelance: Developers' Source of Income (Infographic) 
  6. Freelance, decompilation, the rules, examples of the decompiled code - the thread with examples
  7. Some new Freelance services (translation, consultation, converting) - the post.
  8. Freelance service new webdesign - the post

The articles

  1. How to implement traders' orders and make a profit in the MQL5 Freelance service 
  2. How to create Requirements Specification for ordering a trading robot (Detailed Instruction)
  3. Freelance Jobs on MQL5.com - Developer's Favorite Place 
  4. MQL5.com Freelance: Developers' Source of Income (Infographic) 
  5. Do Traders Need Services From Developers?
  6. A Few Tips for First-Time Customers
============
 
Esben86:

Hi

Thank you for your answer. I have traded a little, but have never tried this strategy, where you have to close two positions at the same time, by automated stop-loss, based on the ratio between the stocks. What I want is to have maybe 5 pairs of long-short positions, so 10 stocks in all.

1) How does such a netting account work and how do you get it? 

I missed the point that you want to open positions on 2 different stocks. So in all cases (netting or hedging)you will have 2 positions. Anyway, it can be coded.

2) How do I hire a freelancer and what should the price be? - I have no idea of how long it would take and how difficult it is, so what is a fair price? How does the transactions work, and can you trust the freelancers?

See the links provided by Sergey. It's 1 hour work maximum. About trust, it's up to you to pick one who is trustworthy.

Reason: