Cross instrument trading pair

Custom indicators, trading strategies, data export and recording and more...
SuperDriveGuy
Posts: 67
Joined: Thu Nov 01, 2018 1:50 pm
Has thanked: 38 times
Been thanked: 9 times

Cross instrument trading pair

Post by SuperDriveGuy » Mon Jul 29, 2019 9:11 am

Hi,
  Whilst trading the cross instrument trading pair, the api plugin escape seems to be using the data of the "minor" instrument.

  These plugins need to enabled on a instrument basis, so If one enables it on the "major" instrument, it does NOT get applied to the "minor" one. if one enables this api on the "minor" instrument, this works, but uses the data of the "minor" instrument.

The expected behaviour would be that "in a cross instrument trading pair, the api would move the limit orders on the "minor" instrument based on the data from the "major" instrument.

   Please advice.


Thanks
Attachments
Capture.JPG
Capture.JPG (35.26 KiB) Viewed 7599 times

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: Cross instrument trading pair

Post by Andry API support » Wed Jul 31, 2019 3:08 pm

Hi SuperDriveGuy,
we'll check it out

SuperDriveGuy
Posts: 67
Joined: Thu Nov 01, 2018 1:50 pm
Has thanked: 38 times
Been thanked: 9 times

Re: Cross instrument trading pair

Post by SuperDriveGuy » Wed Aug 07, 2019 10:03 am

Hi AndreyR,
    Did you manage to see the issue I was highlighting?
Thanks

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: Cross instrument trading pair

Post by Andry API support » Fri Aug 09, 2019 9:42 am

Hi SuperDriveGuy,
although the issue exists I am not sure if it will be fixed soon because there are higher priority issues. if it's blocking you, you may want to fix it yourself. Start from this class
https://github.com/BookmapAPI/DemoStrat ... ategy.java

SuperDriveGuy
Posts: 67
Joined: Thu Nov 01, 2018 1:50 pm
Has thanked: 38 times
Been thanked: 9 times

Re: Cross instrument trading pair

Post by SuperDriveGuy » Tue Aug 13, 2019 9:20 am

Hi AndreyR,
  Thanks for the feedback.

  I am aware of the strategies use and their code, what I don't know is  "How to use the data from one instrument, to place trades on another instrument".

  If you can point me towards a code snippet or example, it will be much appreciated!

Thanks

SuperDriveGuy
Posts: 67
Joined: Thu Nov 01, 2018 1:50 pm
Has thanked: 38 times
Been thanked: 9 times

Re: Cross instrument trading pair

Post by SuperDriveGuy » Tue Aug 13, 2019 9:26 am

    I am aware that this strategy has no idea about cross instrument trading, and that was my question. Since it is available in a cross-instrument trading context, it seems odd that its not applied. The reason for raising this support ticket was to find out how to go about making it "cross-instrument" aware, if you will. Since I can trade cross-instrument, where I am clicking on the "major" instrument", but the trades are being placed in the "minor" instrument. there must be some  code or api I can call. Any help is much appreciated. Thanks

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: Cross instrument trading pair

Post by Andry API support » Tue Aug 13, 2019 2:58 pm

Hi SuperDriveGuy,
I can prevent using 'minor' instrument's data by unticking the 'Enabled for [minor instrument]' box in the 'Enable' section of the Escape strategy for the 'minor' instrument tab (activating Escape strategy for a cross-trading pair ticks both boxes in by default in my case).
Let me know if that partially solves the issue for you.
Attachments
Clipboard01.jpg
Clipboard01.jpg (68.58 KiB) Viewed 6422 times

SuperDriveGuy
Posts: 67
Joined: Thu Nov 01, 2018 1:50 pm
Has thanked: 38 times
Been thanked: 9 times

Re: Cross instrument trading pair

Post by SuperDriveGuy » Tue Aug 13, 2019 7:45 pm

Thanks AndreyR,

  Much appreciated. I have "unchecked" the "enable" for the minor instrument. I will confirm, how I get along.

Regards

SuperDriveGuy
Posts: 67
Joined: Thu Nov 01, 2018 1:50 pm
Has thanked: 38 times
Been thanked: 9 times

Re: Cross instrument trading pair

Post by SuperDriveGuy » Tue Aug 13, 2019 8:10 pm

Hi AndreyR,
  I tried this on replay and it does NOT move/cancel the order for the "minor" instrument. I tried the same replay(same date/time) for the "major" and it works fine ie moves/cancels the order.

  In your example you should confirm whether the order was placed in the "major" or "minor" instrument. I also noticed in your example, cross pair trading in NOT enabled i.e. the "cross pair trading" has not been "START"ed.
Thanks

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: Cross instrument trading pair

Post by Andry API support » Tue Aug 13, 2019 8:57 pm

I also noticed in your example, cross pair trading in NOT enabled
That's because there was the 'minor' MESU9 instrument tab active.
EDITED: sorry for a misconception from my side
Thank you for your remarks.

Post Reply