Cross trade future via java api

moti

New member
Joined
Dec 19, 2023
Posts
1
Likes
1
How can I use the selected cross traded instrument via the java api ?

eg. trade MES instead of ES in a strategy via the java API when "Cross trade" is enabled on the chart.

When I create a trade via the java api, it will use the main instrument, not the cross traded instrument. The example TradeManager also trades the main instrument and ignores the cross traded instrument.

If it is not possible, how can i programmatically add an extra instrument without using the settings dialog. I like to add an instrument MES, MNQ when the main isntrument is ES, NQ wihtout needing to select it in the settings menu. In Ninjatrader l can add instruments via the csharp api as i like, i can not find it in Motivewave.

thanks,
 

HalTrader

Active member
Joined
May 26, 2022
Posts
36
Likes
13
It would be great to have such a method that allows to trade micros (MES, MNQ) on a mini (ES, NQ) chart loaded with a bunch of volume-based or other studies. But so far, we don't have that option.
The only way is to have an "Instrument Descriptor" in your settings where you select "MES" and then open trades on MES. Alternatively, you could just save some "Double, Boolean or Integer" values to "DataSeries" and/or the cursor data window, export them to a .csv file (or to a database), then have a "reader study" on another chart (MES), where you import the cursor data window values from the ES chart.
 

Spin

Well-known member
Joined
May 22, 2019
Posts
480
Likes
192
It would be great to have such a method that allows to trade micros (MES, MNQ) on a mini (ES, NQ) chart loaded with a bunch of volume-based or other studies. But so far, we don't have that option.
The only way is to have an "Instrument Descriptor" in your settings where you select "MES" and then open trades on MES. Alternatively, you could just save some "Double, Boolean or Integer" values to "DataSeries" and/or the cursor data window, export them to a .csv file (or to a database), then have a "reader study" on another chart (MES), where you import the cursor data window values from the ES chart.
That is indeed a great solution, @HalTrader ! I cannot think of another way to accomplish this right now (y)(y)
 

Aionda

Member
Joined
Dec 26, 2022
Posts
17
Likes
1
I once tried to develop a pair trading strategy. Unfortunately, Motivewave's SDK is not designed for this, so I gave up in the end.
 
Top