Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

Number of positions
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=21&t=51551
Page 1 of 1

Author:  Gereltod [ Mon 04 Aug, 2014, 10:44 ]
Post subject:  Number of positions

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

Author:  kostakis [ Thu 18 Sep, 2014, 12:28 ]
Post subject:  Re: Number of positions

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.

Author:  tcsabina [ Tue 23 Sep, 2014, 07:44 ]
Post subject:  Re: Number of positions

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.

Author:  men79 [ Fri 26 Dec, 2014, 17:12 ]
Post subject:  Re: Number of positions

can you attach a picture?

  Page 1 of 1