|
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 use IMessage.Reason |
aspirator
|
Post subject: How to use IMessage.Reason |
Post rating: 0
|
Posted: Mon 17 Sep, 2012, 14:17
|
|
User rating: 0
Joined: Mon 17 Sep, 2012, 14:05 Posts: 25
|
I'd like to check onMessage whether a position was closed by this reason: ORDER_CLOSED_BY_TP.
Thus far, I programmed this using the onMessage method:
public void onMessage(IMessage message) throws JFException { ... Set reasons = message.getReasons();
if (reasons.contains(IMessage.Reason.ORDER_CLOSED_BY_TP)){ console.getOut().println("Reason is correct!"); } ... }
Unfortunately, it doesn't work.
How do I check on the reason properly?
Please advise.
Thanks in advance.
Daniel
|
|
|
|
 |
API Support
|
Post subject: Re: How to use IMessage.Reason |
Post rating: 0
|
Posted: Mon 17 Sep, 2012, 14:54
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
|
|
|
 |
aspirator
|
Post subject: Re: How to use IMessage.Reason |
Post rating: 0
|
Posted: Thu 11 Oct, 2012, 08:26
|
|
User rating: 0
Joined: Mon 17 Sep, 2012, 14:05 Posts: 25
|
If anyone else has problems with this, I solved it with this here:
if (message.getReasons().contains(IMessage.Reason.ORDER_CLOSED_BY_TP))
In the onMessage method, part: switch(message.getType()), case ORDER_CLOSE_OK :
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|