Discussion of article "Swaps (Part I): Locking and Synthetic Positions"

 

New article Swaps (Part I): Locking and Synthetic Positions has been published:

In this article I will try to expand the classic concept of swap trading methods. I will explain why I have come to the conclusion that this concept deserves special attention and is absolutely recommended for study.

I will not explain the idea of swaps and their theory. I am only interested in the practical application of swaps. The most important question is whether it is possible to generate profit via swaps. From a trader's point of view, a swap is a profit or a loss. Furthermore, a lot of traders simply ignore it as they stick to intraday trading. Others try not to pay attention to it, thinking that it is so insignificant that it can hardly affect trading. In fact, almost half of the spread can be hidden in the swap. This spread is taken not at the time of buying or selling, but when the day changes on the server.

The swap is charged relative to the open position volume. This happens at the following moments:

  1. Monday to Tuesday
  2. Tuesday to Wednesday
  3. From Wednesday to Thursday (almost all brokers charge a triple swap this night)
  4. Thursday to Friday

Usually, the swap value is indicated in the trading instrument specification in points or as a percentage. There can be other calculation method, but I have managed to understand only two of them, which is quite enough. There is very little structured information about swaps. However, if you study the question, you may even find some efficient swap-based strategies. They generate minimal profit percent, but they have a great advantage — the profit is absolutely guaranteed. The main difficulty of this approach is the fact that the most popular brokers have very few instruments with a positive swap, so it is really hard to earn money from this idea. Even the possible potential profit is extremely low. Nevertheless, this is better than completely losing the deposit. And if you are using any other trading system, you will most likely lose it. 

Author: Evgeniy Ilin

 
MetaQuotes:

New article Swaps (Part I): Locking and Synthetic Positions has been published:

Author: Evgeniy Ilin

Thank you for your articles.

 
pi.xero #:

Thank you for your articles.

You're the welcome ).

 

Hi,
I ran the expert on both MT4 and MT5, when there are a PostFix the expert will not run and won't get any results.
can you find out why or fix it?

Many Thanks

 
void FillPairsArray()// fill the array with required information about the instruments
   {
   int iterator=0;
   double correction;
   int TempSwapMode;
   
   for ( int i=0; i<ArraySize(Pairs); i++ )// reset symbols
      {
      Pairs[iterator].Name="";
      }   
   
   for ( int i=0; i<SymbolsTotal(false); i++ )// check symbols from the MarketWatch window
      {
      TempSwapMode=int(SymbolInfoInteger(Pairs[iterator].Name,SYMBOL_SWAP_MODE));
      if ( StringLen(SymbolName(i,false)) == 6+PrefixE+PostfixE && IsValid(SymbolName(i,false)) && SymbolInfoInteger(SymbolName(i,false),SYMBOL_TRADE_MODE) == SYMBOL_TRADE_MODE_FULL  
      && ( ( TempSwapMode  == 1 )  ||  ( ( TempSwapMode == 5 || TempSwapMode == 6 ) && CorrectedValue(Pairs[iterator].Name,correction) )) )
         {
         if ( iterator >= ArraySize(Pairs) ) break;
         Pairs[iterator].Name=SymbolName(i,false);
         Pairs[iterator].TickSize=SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_TRADE_TICK_SIZE);
         Pairs[iterator].PointX=SymbolInfoDouble(Pairs[iterator].Name, SYMBOL_POINT);
         Pairs[iterator].ContractSize=SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_TRADE_CONTRACT_SIZE);
         switch(TempSwapMode)
           {
            case  1:// in points
              Pairs[iterator].SwapBuy=SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_SWAP_LONG)*Pairs[iterator].TickValue*(Pairs[iterator].PointX/Pairs[iterator].TickSize);
              Pairs[iterator].SwapSell=SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_SWAP_SHORT)*Pairs[iterator].TickValue*(Pairs[iterator].PointX/Pairs[iterator].TickSize);              
              break;
            case  5:// in percent
              Pairs[iterator].SwapBuy=correction*SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_SWAP_LONG)*SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_BID)*Pairs[iterator].ContractSize/(360.0*100.0);
              Pairs[iterator].SwapSell=correction*SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_SWAP_SHORT)*SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_BID)*Pairs[iterator].ContractSize/(360.0*100.0);              
              break;
            case  6:// in percent
              Pairs[iterator].SwapBuy=correction*SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_SWAP_LONG)*SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_BID)*Pairs[iterator].ContractSize/(360.0*100.0);
              Pairs[iterator].SwapSell=correction*SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_SWAP_SHORT)*SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_BID)*Pairs[iterator].ContractSize/(360.0*100.0);              
              break;              
           }     
         Pairs[iterator].Margin=SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_MARGIN_INITIAL);
         Pairs[iterator].TickValue=SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_TRADE_TICK_VALUE);         // <= this
         iterator++;
         }
      }
   }

Hello,
I have a question about the FillPairsArray() method.

In the FillPairsArray() method, isn't the place where the value of SYMBOL_TRADE_TICK_VALUE is set to Pairs[iterator].TickValue before SWAP is calculated?

It appears to be set after the SWAP calculation.


Thank you.