Skip to content

Commit 36915e8

Browse files
Add link orders as OCO example
1 parent dd96688 commit 36915e8

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Common/LinkOrdersAsOCOExample.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System.Collections.Generic;
2+
using System.Linq;
3+
using System.Threading.Tasks;
4+
using TradingPlatform.BusinessLayer;
5+
6+
namespace ApiExamples
7+
{
8+
public class LinkOrdersAsOCOExample
9+
{
10+
public void LinkOCO(List<IOrder> orders)
11+
{
12+
Task.Run(() =>
13+
{
14+
if (!orders.Any())
15+
return;
16+
17+
Core.Instance.SendCustomRequest(orders.First().ConnectionId, new LinkOCORequestParameters
18+
{
19+
OrdersToLink = orders
20+
});
21+
});
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)