Download MetaTrader 5

Script to build a synthetic pair for mt4?

To add comments, please log in or register
The Market has more than 400 indicators. Try any of them!
deadbouncecat
38
deadbouncecat 2015.12.21 21:54 

Is there a order script that let's me build a synthetic pair?

 

 e.g.-  I want to create a EURUSD synthetic using the JPY.  So it would place and order to long EURJPY and short USDJPY simultanesouly, as well as calculate the correct amount I need to take to stay dollar neutral.  

 

Does anything like this exist?  Thanks in advance.   

Marco vd Heijden
Moderator
4704
Marco vd Heijden 2015.12.21 22:05  

there are many ways to do this.

you can for example let the robot open two positions, or you can let the robot scan the open orders and automatically add the other order when you manually open up a position.

also you can add the dual profits and losses so you get the product of the two and plot is as comment on the chart.

then you can also make it close both order when a specific profit product is reached, or you can, once in profit close the losing position and let the winner run out..

so basically first you will have to choose and then describe the exact mechanism you want to use.

your are definitely thinking in a correct direction here.

i will be happy to help you if you construct a flow diagram.

Xiangdong Guo
3741
Xiangdong Guo 2015.12.22 01:59  
deadbouncecat:

Is there a order script that let's me build a synthetic pair?

e.g.-  I want to create a EURUSD synthetic using the JPY.  So it would place and order to long EURJPY and short USDJPY simultanesouly, as well as calculate the correct amount I need to take to stay dollar neutral.  

Does anything like this exist?  Thanks in advance.   

Your target is triangular arbitrage?

Many strategies based on triangular arbitrage.

Friendly advice: It wastes your time!

deadbouncecat
38
deadbouncecat 2015.12.22 07:10  
Marco vd Heijden:

there are many ways to do this.

you can for example let the robot open two positions, or you can let the robot scan the open orders and automatically add the other order when you manually open up a position.

also you can add the dual profits and losses so you get the product of the two and plot is as comment on the chart.

then you can also make it close both order when a specific profit product is reached, or you can, once in profit close the losing position and let the winner run out..

so basically first you will have to choose and then describe the exact mechanism you want to use.

your are definitely thinking in a correct direction here.

i will be happy to help you if you construct a flow diagram.


Wow, I didn't think of that many features.  I was looking for something that would save me the time it takes for me to calculate the correctly weighted amount to create the synthetics I want.  

I'll attempt to throw together a flow chart.  I've never actually made one.  
deadbouncecat
38
deadbouncecat 2015.12.22 07:10  
Xiangdong Guo:

Your target is triangular arbitrage?

Many strategies based on triangular arbitrage.

Friendly advice: It wastes your time!

No this isn't a arb not.  I'll be using this manually.  
Stuart Browne
5814
Stuart Browne 2015.12.22 07:45  
Xiangdong Guo:

Your target is triangular arbitrage?

Many strategies based on triangular arbitrage.

Friendly advice: It wastes your time!

Triangular pair trading doesn't necessarily mean arb. It can actually be a very successful trading strategy.
Marco vd Heijden
Moderator
4704
Marco vd Heijden 2015.12.22 09:20  
deadbouncecat:

Wow, I didn't think of that many features.  I was looking for something that would save me the time it takes for me to calculate the correctly weighted amount to create the synthetics I want.  

I'll attempt to throw together a flow chart.  I've never actually made one.  

you can use MX Graph for free at https://www.draw.io/

here i made an example for you.


So you can make your own by removing and adding flow components this is very useful when designing and writing the final code blocks and modules.

draw.io - free flow chart maker and diagrams online
draw.io - free flow chart maker and diagrams online
  • www.draw.io
draw.io (formerly Diagramly) is free online diagram software. You can use it as a flowchart maker, network diagram software, to create UML online, as an ER diagram tool, to...
deadbouncecat
38
deadbouncecat 2015.12.23 22:58  
Marco vd Heijden:

you can use MX Graph for free at https://www.draw.io/

here i made an example for you.


So you can make your own by removing and adding flow components this is very useful when designing and writing the final code blocks and modules.

This is probably pretty sloppy from a coders persepctive, but tell me if this makes any sense. Let me know if something doesn't make sense. 

 

 

 

Atsushi Yamanaka
5416
Atsushi Yamanaka 2016.01.12 00:11  

https://www.mql5.com/en/code/909

https://www.mql5.com/en/code/14596

The order Panel for MT4 will be on the Market soon.

Marco vd Heijden
Moderator
4704
Marco vd Heijden 2016.01.12 07:25  
deadbouncecat:

This is probably pretty sloppy from a coders persepctive, but tell me if this makes any sense. Let me know if something doesn't make sense. 

Yes it does make sense but requires manual input the way you wrote it.

If you want to have it fully automated then you must either have it sense new positions or open new position previously before applying the calculation.

So the question is do you want it to trade on it's own, or do you want it to be of assistance only?

To add comments, please log in or register