Dukascopy
 
 
Wiki JStore Search Login

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.

Listening to "Sending orders"
 Post subject: Listening to "Sending orders" Post rating: 0   New post Posted: Thu 09 Sep, 2010, 16:20 
User avatar

User rating: 5
Joined: Fri 02 Sep, 2011, 10:08
Posts: 157
Location: FranceFrance
Hello,

I'm trying to write orders to a txt file to execute trades on an other platform to.
For this, I need to print my "sending orders".
I tried this :
public void onMessage(IMessage message) throws JFException {
        //
        console.getOut().println("engine.getOrders() : "+engine.getOrders());
        console.getOut().println("message.getOrder() : "+message.getOrder());
}
Here is what I get in the console for a pending order with Entry, SL and TP...

As you can see the output from onMessage comes out at last.
What I need is to catch the order at the first place (at "sending order").

I don't want to wait until the order has been "ACCEPTED" because of slippage.

Is there a listener that catches buy and sell actions before they are sent to the server ?
2010-09-09 15:05:17   message.getOrder() : [jf1ck3bm1]-OPENED / EUR/USD / 1.27415 / 0.05 / 0.05
2010-09-09 15:05:17   engine.getOrders() : [[jf1ck3bm1]-OPENED / EUR/USD / 1.27415 / 0.05 / 0.05]

2010-09-09 15:05:08   Order ACCEPTED: #49062186 TAKE PROFIT SELL 0.05 mil. EUR/USD @ LIMIT 1.27615 IF BID => 1.27615 - Position #10134455
2010-09-09 15:05:08   Order ACCEPTED: #49062185 STOP LOSS SELL 0.05 mil. EUR/USD @ MKT IF BID <= 1.27315 - Position #10134455
2010-09-09 15:05:08   Order ACCEPTED: #49062184 ENTRY BUY 0.05 mil. EUR/USD @ MKT IF ASK  => 1.27415 - Position #10134455
2010-09-09 15:05:08   Order sent: TAKE PROFIT SELL 0.05 mil. EUR/USD @ LIMIT 1.27615 IF BID => 1.27615
2010-09-09 15:05:08   Order sent: STOP LOSS SELL 0.05 mil. EUR/USD @ MKT IF BID <= 1.27315
2010-09-09 15:05:08   Order sent: ENTRY BUY 0.05 mil. EUR/USD @ MKT IF ASK  => 1.27415
2010-09-09 15:05:08   Sending order: TAKE PROFIT SELL 0.05 mil. EUR/USD @ LIMIT 1.27615 IF BID => 1.27615
2010-09-09 15:05:08   Sending order: STOP LOSS SELL 0.05 mil. EUR/USD @ MKT IF BID <= 1.27315
2010-09-09 15:05:08   Sending order: ENTRY BUY 0.05 mil. EUR/USD @ MKT IF ASK  => 1.27415

Thanks


 
 Post subject: Re: Listening to "Sending orders" Post rating: 0   New post Posted: Mon 13 Sep, 2010, 12:02 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
hi,
Quote:
I don't want to wait until the order has been "ACCEPTED" because of slippage.
Is there a listener that catches buy and sell actions before they are sent to the server ?

Unfortunately at the moment, you could catch an IMessage.Type.ORDER_SUBMIT_OK message and then save your data. This message arrives to a platform as soon as the server had been accepted the order submit (normally it happens immediately - less then a half second).
Hoverer, thank you for new ideas, we will improve our API with such functionality.


 

Jump to:  

cron
  © 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