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.

Accessing Already-Created-Order Information
 Post subject: Accessing Already-Created-Order Information Post rating: 0   New post Posted: Mon 21 Sep, 2009, 13:58 

User rating: 0
Joined: Sat 08 Mar, 2008, 03:10
Posts: 18
I would like to be able to track a trade that has been opened manually. I invoke an instance of a strategy which will manage this trade for me, either before or after I have opened it, making sure that I have one instance (with a particular parameter set) for each position open (or about to be opened). This is easy to do if all my trades use different FX pairs, but if not then I have a problem: there is no obvious way of setting order information once the order has been sent, like a 'UserData' field for example. So one instance of my strategy cannot know if this order is already being tracked by another instance. Is there a way around this?

On a related note, is there any way of hooking the manual BUY/SELL commands so that when a BUY signal is issued with SL/TP settings, some code is invoked which could set the order information itself, including the order label?

Thanks


 
 Post subject: Re: Accessing Already-Created-Order Information Post rating: 0   New post Posted: Mon 21 Sep, 2009, 15:37 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
kralowsky wrote:
So one instance of my strategy cannot know if this order is already being tracked by another instance. Is there a way around this?

You can pass order label as a parameter to the strategy. For manually created orders it looks like "jf<some symbols>"
kralowsky wrote:
On a related note, is there any way of hooking the manual BUY/SELL commands so that when a BUY signal is issued with SL/TP settings, some code is invoked which could set the order information itself, including the order label?

Inside strategy you can do that by looking at the order label. In onMessage method catch ORDER_SUBMIT_OK and ORDER_FILL_OK and if label doesn't look like created by the strategy, then it's likely created manually.


 

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