Exemplo n.º 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);
        }
Exemplo n.º 2
0
 public void OnPositionClosed(Position position)
 {
     PositionClosed.Raise(new PositionEventArgs(position));
 }
Exemplo n.º 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);
        }