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.

Selective closure of transaction
 Post subject: Selective closure of transaction Post rating: 0   New post Posted: Fri 02 Nov, 2012, 15:34 

User rating: 0
Joined: Mon 14 Nov, 2011, 05:16
Posts: 33
Location: PhilippinesPhilippines
Dear Dukas & community,

I run two strategies, which both both / sell on predefined times,
e.g.

strategy 1 buys at 13:00 and sells at 15:00;
strategy 2 buys at 00.01 and sells at 23:59

I use the following code to open positions

                        if ((Hour ==0 && Minute ==0 && MonthDay == 3))
                    {             
                    buy (instrument, engine, profitLimit, lossLimit, volume); 
                            }


and this to close positions

  if (Hour ==23 && Minute == 59) order.close();  


Both strategies trade EURUSD.

At the moment, I run the strategies on two separate accounts so that the closing of positions on strategy 1 does not close the Strategy 2 positions.

I would like to combine the strategies and run on one account. How do I close positions selectively (I am thinking using the label)?

Thanks


 
 Post subject: Re: Selective closure of transaction Post rating: 0   New post Posted: Fri 02 Nov, 2012, 15:36 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See:
https://www.dukascopy.com/wiki/#Order_Management/Maintain_order_list


 

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