Dukascopy
 
 
Wiki JStore Search Login

Number of positions
 Post subject: Number of positions Post rating: 0   New post Posted: Mon 04 Aug, 2014, 10:44 
User avatar

User rating: 0
Joined: Thu 05 Jan, 2012, 14:46
Posts: 1
Location: Mongolia, Ulaanbaatar
Hello, Dukas Community
I am planning to participate in the strategy contest.
But the strategies i compose starts making multiple positions and keeps stacking more orders. How can I limit the number orders at any given time to 1, according to strategy contest rules.
Thank


 
 Post subject: Re: Number of positions Post rating: 0   New post Posted: Thu 18 Sep, 2014, 12:28 
User avatar

User rating: 1
Joined: Wed 30 Jul, 2014, 14:33
Posts: 95
Location: Lithuania, Vilnius
I am facing the same problem. My be anybody from the STAFF could help us with this? Please just give us the code which should be used in case to limit positions to 1 at the same time.


 
 Post subject: Re: Number of positions Post rating: 0   New post Posted: Tue 23 Sep, 2014, 07:44 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
One way to do this:
Use private booleans in the strategy (one for the long and another one for the short orders). Set the boolean to true when you submit the order, and set it to false when the order is closed (order closing can be catch in the onMessage() function). And allow a new order only if the boolean is false.


 
 Post subject: Re: Number of positions Post rating: 0   New post Posted: Fri 26 Dec, 2014, 17:12 
User avatar

User rating: 0
Joined: Wed 20 Jul, 2011, 05:45
Posts: 20
Location: BulgariaBulgaria
can you attach a picture?


 

Jump to:  

  © 1998-2024 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