|
Attention! Read the forum rules carefully before posting a topic.
Try to find an answer in Wiki before asking a question. Submit programming questions in this forum only. Off topics are strictly forbidden.
Any topics which do not satisfy these rules will be deleted.
How to identify orders closed because of 'merge' ? |
mtnfx
|
Post subject: How to identify orders closed because of 'merge' ? |
Post rating: 0
|
Posted: Tue 05 Jun, 2018, 12:45
|
|
User rating: 18
Joined: Thu 20 Apr, 2017, 22:42 Posts: 165 Location: Russian Federation,
|
I'd like to find orders closed because of merging into another order. Is there some 'sign' of this available in JForex API. I could not find it.
|
|
|
|
|
mtnfx
|
Post subject: Re: How to identify orders closed because of 'merge' ? |
Post rating: 0
|
Posted: Sat 09 Jun, 2018, 15:43
|
|
User rating: 18
Joined: Thu 20 Apr, 2017, 22:42 Posts: 165 Location: Russian Federation,
|
So .. the only way to identify merged orders I've found so far is to listen to onMessage and check if 'IMessage.getType()' is 'ORDERS_MERGE_OK'. But it seems there is no way to get that information for historic order
|
|
|
|
|
goose_
|
Post subject: Re: How to identify orders closed because of 'merge' ? |
Post rating: 0
|
Posted: Sat 09 Jun, 2018, 19:59
|
|
User rating: 2
Joined: Fri 06 Apr, 2018, 17:06 Posts: 23 Location: Poland,
|
|
|
|
|
mtnfx
|
Post subject: Re: How to identify orders closed because of 'merge' ? |
Post rating: 0
|
Posted: Mon 11 Jun, 2018, 10:32
|
|
User rating: 18
Joined: Thu 20 Apr, 2017, 22:42 Posts: 165 Location: Russian Federation,
|
Thanks, I did not notice that functionality. However it does not answer my question - I'm looking the answer for the question 'why the order was closed?'. That report answer the question 'why the order was created?' ...
|
|
|
|
|
goose_
|
Post subject: Re: How to identify orders closed because of 'merge' ? |
Post rating: 0
|
Posted: Tue 12 Jun, 2018, 07:16
|
|
User rating: 2
Joined: Fri 06 Apr, 2018, 17:06 Posts: 23 Location: Poland,
|
mtnfx wrote: Thanks, I did not notice that functionality. However it does not answer my question - I'm looking the answer for the question 'why the order was closed?'. That report answer the question 'why the order was created?' ... Something like when system cut losses and opened hedge in "margin cut" mode and you want to get that information about why system opened hedge and merged position . I don't know how to get this, sorry.
|
|
|
|
|
API Support
|
Post subject: Re: How to identify orders closed because of 'merge' ? |
Post rating: 0
|
Posted: Tue 12 Jun, 2018, 16:55
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Hello, Unfortunately, JForex-API didn't provide this possibility "out of the box". But, depending on your task, there is some options. Merged orders have empty closeHistory list, maybe this sample will be helpful. List<IOrder> myOrders = history.getOrdersHistory(myInstrument, from, to); for (IOrder order : myOrders) { if (order.getCloseHistory().size() == 0) { mergedOrders.add(order); } }
|
|
|
|
|
i_hate_java
|
Post subject: Re: How to identify orders closed because of 'merge' ? |
Post rating: 0
|
Posted: Wed 13 Jun, 2018, 15:30
|
|
User rating: 0
Joined: Mon 09 Oct, 2017, 06:34 Posts: 15 Location: Hong Kong,
|
in fact, you may get msg from onMessage when the order is merge, try to print those msg type, reason etc, you can get more information you want to know
|
|
|
|
|
mtnfx
|
Post subject: Re: How to identify orders closed because of 'merge' ? |
Post rating: 0
|
Posted: Sat 16 Jun, 2018, 08:07
|
|
User rating: 18
Joined: Thu 20 Apr, 2017, 22:42 Posts: 165 Location: Russian Federation,
|
API Support wrote: Hello, Unfortunately, JForex-API didn't provide this possibility "out of the box". But, depending on your task, there is some options. Merged orders have empty closeHistory list, maybe this sample will be helpful. [/code] Thanks - this seems to be workable solution. Unfortunately there is the bug in JForex where 'close history' is also empty for closed non-merged-out orders - it makes that approach not really reliable. Hopefully it will be fixed sometime ... https://www.dukascopy.com/swiss/english ... 85&t=56054https://www.dukascopy.com/swiss/english ... 85&t=56547
|
|
|
|
|
|
Pages: [
1
]
|
|
|
|
|