My call to exit used to be like this:
exitOrder = ExitLong(1, DefaultQuantity, "Exit Long Position", LONG_POSITION);
I have noticed that there is an ExitLong message without the quantity and have attempted to use that one. However, it's closing it one by one. Here is an example with 5 positions opened and then closed five times by 1 position size:
Local time: 6/7/2013 3:59:00 PM
New York: 6/7/2013 3:59:00 PM Eastern Daylight Time
New York session is active.
London: 6/7/2013 8:59:00 PM GMT Daylight Time
London session is inactive.
Tokyo: 6/8/2013 4:59:00 AM Tokyo Standard Time
Tokyo session is inactive.
Instrument: $EURUSD Default
Close: 1.32165
Theoretical Entry Price: 1.32165
*Current Bid*: 1.32165
Current Ask: 1.32165
B/A Spread: 0 ticks.
Short entry order has been submitted: Order='NT-00017/Sim101' Name='Short Position' State=PendingSubmit Instrument='$EURUSD' Action=SellShort Limit price=0 Stop price=0 Quantity=5 Strategy='CrazyIvan' Type=Market Tif=Gtc Oco='' Filled=0 Fill price=0 Token='23f50da514284977baa3cbb50f47e716' Gtd='12/1/2099 12:00:00 AM'
Resetting triggers...
##################################
Order: SellShort was filled
EXECUTED at BarNumberOfFill (adjusted): 223
CurrentBars: 222
Time on 0 series: 6/7/2013 3:30:00 PM
Appending order update to message buffer: SIGNALS: FH-S.
TRADE: SellShort at 1.32165.
Global buffer in onOrderUpdate(): SIGNALS: FH-S.
TRADE: SellShort at 1.32165.
Order has been filled - adding stop.
6/7/2013 3:59:00 PM Entered internal PlaceOrder() method at 6/7/2013 3:59:00 PM: BarsInProgress=1 Action=BuyToCover OrderType=Stop Quantity=5 LimitPrice=0 StopPrice=1.3224'5 SignalName='Stop loss' FromEntrySignal='Short Position'
###### Short Stop: 1.32245 #########
Local time: 6/7/2013 3:59:00 PM
New York: 6/7/2013 3:59:00 PM Eastern Daylight Time
New York session is active.
London: 6/7/2013 8:59:00 PM GMT Daylight Time
London session is inactive.
Tokyo: 6/8/2013 4:59:00 AM Tokyo Standard Time
Tokyo session is inactive.
Instrument: $EURUSD Default
Close: 1.32165
Average Fill Price: 1.32165
Theoretical Entry Price: 1.32165
ISL in full ticks: 8
Real stop loss in handles: 0.0008
Setting short stop to 1.32245
Execution: Execution='NT-00015' Instrument='$EURUSD' Account='Sim101' Name='Short Position' Exchange=Default Price=1.32165 Quantity=5 Market position=Short Commission=0 Order='NT-00017' Time='6/7/2013 3:59:00 PM' Multiplier=1E-05
Short stop: 1.32245
Stop order: Order='NT-00018/Sim101' Name='Stop loss' State=PendingSubmit Instrument='$EURUSD' Action=BuyToCover Limit price=0 Stop price=1.32245 Quantity=5 Strategy='CrazyIvan' Type=Stop Tif=Gtc Oco='' Filled=0 Fill price=0 Token='61534281f635486d921dca0b64f463a7' Gtd='12/1/2099 12:00:00 AM'
Stop order Action: BuyToCover
Stop order Price: 1.32245
Current Bid: 1.32165
*Current Ask*: 1.32165
B/A Spread: 0 ticks.
##################################
Buffer inside onExecution:
STOP: BuyToCover at 1.32245.
RISK: 8 pips.
Stop has been set
FRIDAY EOW CLOSING TIME
Date: Friday, 6/7/2013 3:59:00 PM
Time: 155900
New York: 6/7/2013 3:59:00 PM Eastern Daylight Time
6/7/2013 3:59:00 PM Entered internal PlaceOrder() method at 6/7/2013 3:59:00 PM: BarsInProgress=1 Action=BuyToCover OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Exit Short Position' FromEntrySignal='Short Position'
Order: BuyToCover was filled
EXECUTED at BarNumberOfFill (adjusted): 223
CurrentBars: 222
Time on 0 series: 6/7/2013 3:30:00 PM
6/7/2013 3:59:00 PM
Close: 1.32165
Current Bid: 1.32165
Current Ask: 1.32165
B/A Spread: 0 ticks.
Appending order update to message buffer: EXIT REMINDER: BuyToCover at 1.32165 and clear all stops.
Global buffer in onOrderUpdate(): EXIT REMINDER: BuyToCover at 1.32165 and clear all stops.
FRIDAY EOW CLOSING TIME
Date: Friday, 6/7/2013 3:59:00 PM
Time: 155900
New York: 6/7/2013 3:59:00 PM Eastern Daylight Time
6/7/2013 3:59:00 PM Entered internal PlaceOrder() method at 6/7/2013 3:59:00 PM: BarsInProgress=1 Action=BuyToCover OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Exit Short Position' FromEntrySignal='Short Position'
Order: BuyToCover was filled
EXECUTED at BarNumberOfFill (adjusted): 223
CurrentBars: 222
Time on 0 series: 6/7/2013 3:30:00 PM
6/7/2013 3:59:00 PM
Close: 1.32165
Current Bid: 1.32165
Current Ask: 1.32165
B/A Spread: 0 ticks.
Appending order update to message buffer: EXIT REMINDER: BuyToCover at 1.32165 and clear all stops.
Global buffer in onOrderUpdate(): EXIT REMINDER: BuyToCover at 1.32165 and clear all stops.
FRIDAY EOW CLOSING TIME
Date: Friday, 6/7/2013 3:59:00 PM
Time: 155900
New York: 6/7/2013 3:59:00 PM Eastern Daylight Time
6/7/2013 3:59:00 PM Entered internal PlaceOrder() method at 6/7/2013 3:59:00 PM: BarsInProgress=1 Action=BuyToCover OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Exit Short Position' FromEntrySignal='Short Position'
Order: BuyToCover was filled
EXECUTED at BarNumberOfFill (adjusted): 223
CurrentBars: 222
Time on 0 series: 6/7/2013 3:30:00 PM
6/7/2013 3:59:00 PM
Close: 1.32165
Current Bid: 1.32165
Current Ask: 1.32165
B/A Spread: 0 ticks.
Appending order update to message buffer: EXIT REMINDER: BuyToCover at 1.32165 and clear all stops.
Global buffer in onOrderUpdate(): EXIT REMINDER: BuyToCover at 1.32165 and clear all stops.
FRIDAY EOW CLOSING TIME
Date: Friday, 6/7/2013 3:59:00 PM
Time: 155900
New York: 6/7/2013 3:59:00 PM Eastern Daylight Time
6/7/2013 3:59:00 PM Entered internal PlaceOrder() method at 6/7/2013 3:59:00 PM: BarsInProgress=1 Action=BuyToCover OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Exit Short Position' FromEntrySignal='Short Position'
Order: BuyToCover was filled
EXECUTED at BarNumberOfFill (adjusted): 223
CurrentBars: 222
Time on 0 series: 6/7/2013 3:30:00 PM
6/7/2013 3:59:00 PM
Close: 1.32165
Current Bid: 1.32165
Current Ask: 1.32165
B/A Spread: 0 ticks.
Appending order update to message buffer: EXIT REMINDER: BuyToCover at 1.32165 and clear all stops.
Global buffer in onOrderUpdate(): EXIT REMINDER: BuyToCover at 1.32165 and clear all stops.
FRIDAY EOW CLOSING TIME
Date: Friday, 6/7/2013 3:59:01 PM
Time: 155901
New York: 6/7/2013 3:59:01 PM Eastern Daylight Time
6/7/2013 3:59:01 PM Entered internal PlaceOrder() method at 6/7/2013 3:59:01 PM: BarsInProgress=1 Action=BuyToCover OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Exit Short Position' FromEntrySignal='Short Position'
6/7/2013 3:59:01 PM Cancelled pending exit order, since associated position is closed: Order='NT-00018/Sim101' Name='Stop loss' State=Working Instrument='$EURUSD' Action=BuyToCover Limit price=0 Stop price=1.32245 Quantity=5 Strategy='CrazyIvan' Type=Stop Tif=Gtc Oco='' Filled=0 Fill price=0 Token='61534281f635486d921dca0b64f463a7' Gtd='12/1/2099 12:00:00 AM'
Order: BuyToCover was filled
EXECUTED at BarNumberOfFill (adjusted): 223
CurrentBars: 222
Time on 0 series: 6/7/2013 3:30:00 PM
6/7/2013 3:59:01 PM
Close: 1.32165
Current Bid: 1.32165
Current Ask: 1.32165
B/A Spread: 0 ticks.
Appending order update to message buffer: EXIT REMINDER: BuyToCover at 1.32165 and clear all stops.
Global buffer in onOrderUpdate(): EXIT REMINDER: BuyToCover at 1.32165 and clear all stops.

Comment