Dukascopy
 
 
Wiki JStore Search Login

JFOREX-2792 order comments returned with asterisk‏
 Post subject: JFOREX-2792 order comments returned with asterisk‏ Post rating: 0   New post Posted: Sat 26 Feb, 2011, 00:23 

User rating: 0
Joined: Wed 13 Jul, 2011, 01:19
Posts: 8
Location: DE
Hello,

I have the following problem.
I'm submitting my orders with a number as comment:
String goodTillTime = Long.toString(1298664000000L);
engine.submitOrder(..., goodTillTime);

later on I read the comment and get the number with an asterisk appended:
IOrder.getComment() -> "1298664000000*"

Where does the asterisk come from?
I've only experienced this problem running the strategy live. Using the Historical Tester I couldn't reproduce this behaviour.


 
 Post subject: Re: JFOREX-2792 order comments returned with asterisk‏ Post rating: 0   New post Posted: Wed 02 Mar, 2011, 13:43 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We cannot reproduce the problem regarding the order comment. After order submitting, the IOrder.getComment() (console.getOut().println("Order comment: " + order.getComment());) method returns the expected result without asterisk : 13:31:51 Order comment: 1298664000000

If problem persist, please reply with a screenshot.


 
 Post subject: Re: JFOREX-2792 order comments returned with asterisk‏ Post rating: 0   New post Posted: Thu 03 Mar, 2011, 00:55 

User rating: 0
Joined: Wed 13 Jul, 2011, 01:19
Posts: 8
Location: DE
A few times it worked, but 90% of the time I get the comment with an asterisk appended. I'm running on Linux.

This is my code:
for (IOrder order : engine.getOrders(instrument)) {
    try {
        if ((order.getState() == IOrder.State.OPENED || order.getState() == IOrder.State.CREATED) && Long.parseLong(order.getComment()) - multipliedPeriod.GetBar(0).getTime() <= 0)
            order.close();
    } catch (Exception ex) {
        console.getErr().println("Could not cancel order " + order.getLabel() + " (comment: " + order.getComment() + ")");
    }
}


And here is a screenshot of the messages log:
Image


 
 Post subject: Re: JFOREX-2792 order comments returned with asterisk‏ Post rating: 0   New post Posted: Thu 10 Mar, 2011, 14:27 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We have launched the following code on linux and windows:
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
        if ((period == Period.ONE_MIN) && (instrument.equals(Instrument.EURUSD))) {
           for (IOrder order : engine.getOrders(instrument)) {
               try {
                   if ((order.getState() == IOrder.State.OPENED || order.getState() == IOrder.State.CREATED) && (Long.parseLong(order.getComment()) - askBar.getTime() <= 0 ))
                      console.getOut().println("Closing order:  " + order.getComment());
                      order.close();
               } catch (Exception ex) {
                   console.getErr().println("Could not cancel order " + order.getLabel() + " (comment: " + order.getComment() + ")");
               }
           }           
           
        }
    }

And problem with asterisk does not occur.
What version of JDK do you have?


 
 Post subject: Re: JFOREX-2792 order comments returned with asterisk‏ Post rating: 0   New post Posted: Sat 12 Mar, 2011, 22:21 

User rating: 0
Joined: Wed 13 Jul, 2011, 01:19
Posts: 8
Location: DE
I'm running Java SE Runtime Environment build 1.6.0_22-b04

Could it have something to do with the Long.toString method?

Currently I'm catching the exception and removing the asterisk. So it's no big deal for me.
As long as I'm the only one experiencing the problem, it seems to be a problem on my side. Even though I don't have any idea what it could be..


 
 Post subject: Re: JFOREX-2792 order comments returned with asterisk‏ Post rating: 0   New post Posted: Tue 15 Mar, 2011, 16:24 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Different behavior could be if non oracle java is installed on the pc.


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com