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.

Use order management to count winners, losers
 Post subject: Use order management to count winners, losers Post rating: 0   New post Posted: Thu 25 Sep, 2014, 09:53 

User rating: 0
Joined: Mon 14 Nov, 2011, 05:16
Posts: 33
Location: PhilippinesPhilippines
Hi

I am working with order management to create a logic which counts the number of winning and loosing trades in the last 20 deals.

Can anyone (support?) help point me in the right direction for the code required?

thanks in advance


 
 Post subject: Re: Use order management to count winners, losers Post rating: 0   New post Posted: Thu 25 Sep, 2014, 10:28 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
When position is closed, you will receive a message with type ORDER_CLOSE_OK in onMessage method of your strategy. Then you can determine if closed position was profitable and save this info to appropriate counter or any data structure of yours.

Look at onMessage implementation of "Detect close by Stop Loss" example: https://www.dukascopy.com/wiki/#Set_Stop ... _Stop_Loss
Also take a look at Order State diagram to find more about messages: https://www.dukascopy.com/wiki/#Order_state


 
 Post subject: Re: Use order management to count winners, losers Post rating: 0   New post Posted: Fri 26 Sep, 2014, 12:50 

User rating: 0
Joined: Mon 14 Nov, 2011, 05:16
Posts: 33
Location: PhilippinesPhilippines
Thanks - works perfect!


 

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