/// <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); }
public void OnPositionClosed(Position position) { PositionClosed.Raise(new PositionEventArgs(position)); }
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); }