Systematic Forex Trading

Font Awesome 5 Icons
      Previous Post       Next Post

Systematic Forex Trading

Interactive Brokers C++ API + ExSan

Forex Algorithm ExSan Solution

Forex State Diagram

A Single Square Matrix [n, n]  is needed. The upper triangular Matrix  [sell\buy]
and the  lower triangular Matrix  [sell\buy] 



Forex Market is the trading of currencies for a profit. Forex is a very real problem that promises a lot of money, if it were not for fees, taxes, and other imposed bounds. The challenge in Forex is finding an optimal solution despite the size of the search space.The problem consist to write a program that determines whether a sequence of currency exchanges can yield a profit as described above. To result in successful trade, a sequence of exchanges must begin and end with the same currency, but any starting currency may be considered. For example, for a set of 20 currencies, the search space consists of  
3×1024
 (read “three septillion” in the short scale

Notes/ What if:
  • Market Circuit Breakers must be considered
  • What if a Deadlock?
  • Other Black Swans ...
  • What if an idle market/coin?
It sounds complicated, it is indeed! 
However an appropriate algorithm and the correct tool can beat it !

 29    =======================

 30 

 31     Generate Exsan ( 10 ,  10 )

 32      Overview

 33     WORKSHEET 8  H[8, 8]

             USD        EUR        JPY        GBP        CHF        CAD        AUD       HKD

 35         >-----------------------------------------------------------------------------------<

 36  USD:         1      1.053     0.0077      1.246      1.008     0.7785     0.7001     0.1274 

 37  EUR:    0.9493          1     0.0074      1.183     0.9565      0.739     0.6646     0.1209 

 38  JPY:    & 129.1        136          1      160.9      130.1      100.5      90.41      16.45 

 39  GBP:    0.8026     0.8455     0.0062          1     0.8087     0.6249     0.5619     0.1022 

 40  CHF:    0.9925      1.046     0.0077      1.237          1     0.7727     0.6948     0.1264 

 41  CAD:     1.284      1.353     0.0099        1.6      1.294          1     0.8993     0.1636 

 42  AUD:     1.428      1.505     0.0111       1.78      1.439      1.112          1      0.182 

 43  HKD:     7.85      8.269     0.0608       9.78      7.909      6.111      5.496          1 

 44         <--------------------------------------------------------------------------------->

 45 

 45   Deadlock     <EUR> ---...---<GBP>

 46    no !!! -TRADING SEQUENCE- deadlock !!! no

 47    Row 1: Forex Trading Sequence

 48    Row 2: Forex Trading Exchange

 49     WORKSHEET 0  @[2, 5] FLOAT

 50              A       B       C       D       E 

 51         >-----------------------------------<

 52      1:      1       4       2       4       0 

 53      2:  1.246  0.8455   1.183       0       0 

 54         <----------------------------------->

 55 

 56    

 27    =======================

 28 

 29     Generate Exsan ( 10 ,  10 )

 30 

 31     WORKSHEET 8  H[8, 8] AMERICAS

 32          USD      PEN      MXN      BRL      ARS      CLP      COP      EUR

 33         >------------------------------------------------------------------------<

 34 USD:       1    0.266     0.05    0.201   0.0085   0.0012   0.0002     1.05 

 35 PEN:    3.76        1    0.188    0.756   0.0319   0.0044   0.0009     3.96 

 36 MXN:      20     5.31        1     4.01    0.169   0.0235    0.005     21.1 

 37 BRL:    4.98     1.32    0.249        1   0.0422   0.0059   0.0012     5.25 

 38 ARS:     118     31.4      5.9     23.7        1    0.139   0.0292      124 

 39 CLP:     851      226     42.6      171     7.21        1    0.211      896 

 40 COP:4.04e+03 1.07e+03      202      810     34.2     4.75        1 4.25e+03 

 41 EUR:    0.95    0.252   0.0475    0.191    0.008   0.0011   0.0002        1 

 42         <------------------------------------------------------------------------>

 43 

 44    - ok TRADING SEQUENCE- 

 45    Row 1: Forex Trading Sequence

 46    Row 2: Forex Trading Exchange

 47     WORKSHEET 0  @[2, 5] FLOAT

 48              A       B       C       D       E 

 49         >-----------------------------------<

 50      1:      1       8       1       8       0 

 51      2:  1.053  0.9496   1.053       0       0 

 52         <----------------------------------->

 53 

 54    

 29    =======================

 30 

 31     Generate Exsan ( 10 ,  10 )

 32 

 33     WORKSHEET 8  H[8, 8] Europe, Middle East & Africa

 34        USD    EUR    GBP    CHF    SEK    NOK    DKK    ZAR

 35         >--------------------------------------------------------<

 36 USD:     1   1.05   1.25   1.01  0.101  0.103  0.141 0.0627 

 37 EUR:  0.95      1   1.18  0.956 0.0955 0.0978  0.134 0.0595 

 38 GBP: 0.802  0.845      1  0.808 0.0807 0.0827  0.114 0.0503 

 39 CHF: 0.993   1.05   1.24      1 0.0999  0.102  0.141 0.0623 

 40 SEK:  9.94   10.5   12.4     10      1   1.02   1.41  0.623 

 41 NOK:  9.71   10.2   12.1   9.77  0.976      1   1.37  0.608 

 42 DKK:  7.07   7.44   8.81   7.12  0.711  0.728      1  0.443 

 43 ZAR:    16   16.8   19.9   16.1    1.6   1.64   2.26      1 

 44         <-------------------------------------------------------->

 45 

 46    no !!! -TRADING SEQUENCE- deadlock  !!! no

 47    Row 1: Forex Trading Sequence

 48    Row 2: Forex Trading Exchange

 49     WORKSHEET 0  @[2, 5] FLOAT

 50              A       B       C       D       E 

 51         >-----------------------------------<

 52      1:      1       3       2       3       0 

 53      2:  1.246   0.845   1.183       0       0 

 54         <----------------------------------->

 55 

 29    =======================

 30 

 31     Generate Exsan ( 10 ,  10 )

 32 

 33     WORKSHEET 8  H[8, 8] Asia Pacific

 34          USD      CNY      JPY      HKD      IDR      KRW      SGD      EUR

 35         >----------------------------------------------------------------<

 36 USD:       1     0.15   0.0077     0.13   0.0001   0.0008     0.72      1.1 

 37 CNY:     6.7        1    0.052     0.86   0.0005   0.0053      4.9      7.1 

 38 JPY: 1.3e+02       19        1       16   0.0088      0.1       93  1.4e+02 

 39 HKD:     7.8      1.2    0.061        1   0.0005   0.0062      5.7      8.3 

 40 IDR: 1.5e+04  2.2e+03  1.1e+02  1.9e+03        1       11  1.1e+04  1.5e+04 

 41 KRW: 1.3e+03  1.9e+02      9.9  1.6e+02    0.087        1  9.2e+02  1.3e+03 

 42 SGD:     1.4     0.21    0.011     0.18   0.0001   0.0011        1      1.5 

 43 EUR:    0.95     0.14   0.0074     0.12   0.0001   0.0007     0.69        1 

 44         <------------------------------------------------------->

 45 

 46    !!! OK -TRADING SEQUENCE- !!! 

 47    Row 1: Forex Trading Sequence

 48    Row 2: Forex Trading Exchange

 49     WORKSHEET 0  @[2, 5] FLOAT

 50              A       B       C       D       E 

 51         >-----------------------------------<

 52      1:      1       8       1       8       0 

 53      2:  1.053  0.9497   1.053       0       0 

 54         <----------------------------------->

 55 

 51         >-----------------------------------<

      Previous Post       Next Post
Flag Counter

Comments

Popular posts from this blog

Interactive Brokers tick by tick Data Market - C++ API & ExSan jobID 106391

Interactive Brokers C++ API & ExSan xsn 279947