예제 #1
0
        /// <summary>
        /// Close an existing position
        /// </summary>
        /// <param name="instrument">instrument instrument</param>
        /// <returns></returns>
        public async Task <PositionClosed> ClosePosition(string instrument)
        {
            Dictionary <string, string> routeParams = new Dictionary <string, string>();

            routeParams.Add("accountId", _accountId.ToString());
            routeParams.Add("instrument", instrument);

            PositionClosed positionClosed = await Delete <PositionClosed>(routeParams, _positionRoute);

            return(positionClosed);
        }
예제 #2
0
 public void OnPositionClosed(Position position)
 {
     PositionClosed.Raise(new PositionEventArgs(position));
 }
예제 #3
0
 private void OnPositionClosed(Position position, DateTime AsOf)
 {
     PositionClosed?.Invoke(this, new PositionDataEventArgs(position, AsOf));
 }
        public async Task ClosePositionTest()
        {
            PositionClosed position = await _positionEndpoints.ClosePosition("EUR_USD");

            Assert.IsNotNull(position);
        }