public static LoginResponse ExecuteLoginCommand(SyncAPIConnector connector, Credentials credentials, bool prettyPrint = false) { LoginCommand loginCommand = CreateLoginCommand(credentials, prettyPrint); LoginResponse loginResponse = new LoginResponse(connector.ExecuteCommand(loginCommand).ToString()); redirectCounter = 0; while (loginResponse.RedirectRecord != null) { if (redirectCounter >= SyncAPIConnector.MAX_REDIRECTS) { throw new APICommunicationException("too many redirects"); } Server newServer = new Server(loginResponse.RedirectRecord.Address, loginResponse.RedirectRecord.MainPort, loginResponse.RedirectRecord.StreamingPort, true, "Redirected to: " + loginResponse.RedirectRecord.Address + ":" + loginResponse.RedirectRecord.MainPort + "/" + loginResponse.RedirectRecord.StreamingPort); connector.Redirect(newServer); redirectCounter++; loginResponse = new LoginResponse(connector.ExecuteCommand(loginCommand).ToString()); } if (loginResponse.StreamSessionId != null) { connector.Streaming.StreamSessionId = loginResponse.StreamSessionId; } return(loginResponse); }
public static TradeTransactionResponse ExecuteTradeTransactionCommand(SyncAPIConnector connector, TradeTransInfoRecord tradeTransInfo, bool prettyPrint = false) { return(new TradeTransactionResponse(connector.ExecuteCommand(CreateTradeTransactionCommand(tradeTransInfo, prettyPrint)).ToString())); }
public static TradeRecordsResponse ExecuteTradeRecordsCommand(SyncAPIConnector connector, LinkedList <long?> orders, bool prettyPrint = false) { return(new TradeRecordsResponse(connector.ExecuteCommand(CreateTradeRecordsCommand(orders, prettyPrint)).ToString())); }
public static TickPricesResponse ExecuteTickPricesCommand(SyncAPIConnector connector, List <string> symbols, long?timestamp, bool prettyPrint = false) { return(new TickPricesResponse(connector.ExecuteCommand(CreateTickPricesCommand(symbols, timestamp, prettyPrint)).ToString())); }
public static SymbolResponse ExecuteSymbolCommand(SyncAPIConnector connector, string symbol, bool prettyPrint = false) { return(new SymbolResponse(connector.ExecuteCommand(CreateSymbolCommand(symbol, prettyPrint)).ToString())); }
public static CalendarResponse ExecuteCalendarCommand(SyncAPIConnector connector, bool prettyPrint = false) { return(new CalendarResponse(connector.ExecuteCommand(CreateCalendarCommand(prettyPrint)).ToString())); }
public static TradingHoursResponse ExecuteTradingHoursCommand(SyncAPIConnector connector, List <string> symbols, bool prettyPrint = false) { return(new TradingHoursResponse(connector.ExecuteCommand(CreateTradingHoursCommand(symbols, prettyPrint)).ToString())); }
public static TradesResponse ExecuteTradesCommand(SyncAPIConnector connector, bool openedOnly, bool prettyPrint = false) { return(new TradesResponse(connector.ExecuteCommand(CreateTradesCommand(openedOnly, prettyPrint)).ToString())); }
public static MarginTradeResponse ExecuteMarginTradeCommand(SyncAPIConnector connector, string symbol, double?volume, bool prettyPrint) { return(new MarginTradeResponse(connector.ExecuteCommand(CreateMarginTradeCommand(symbol, volume, prettyPrint)).ToString())); }
public static MarginLevelResponse ExecuteMarginLevelCommand(SyncAPIConnector connector, bool prettyPrint = false) { return(new MarginLevelResponse(connector.ExecuteCommand(CreateMarginLevelCommand(prettyPrint)).ToString())); }
public static LogoutResponse ExecuteLogoutCommand(SyncAPIConnector connector) { return(new LogoutResponse(connector.ExecuteCommand(CreateLogoutCommand()).ToString())); }
public static CommissionDefResponse ExecuteCommissionDefCommand(SyncAPIConnector connector, string symbol, double?volume, bool prettyPrint = false) { return(new CommissionDefResponse(connector.ExecuteCommand(CreateCommissionDefCommand(symbol, volume, prettyPrint)).ToString())); }
public static ChartRangeResponse ExecuteChartRangeCommand(SyncAPIConnector connector, string symbol, PERIOD_CODE period, long?start, long?end, long?ticks, bool prettyPrint = false) { return(new ChartRangeResponse(connector.ExecuteCommand(CreateChartRangeCommand(symbol, period, start, end, ticks, prettyPrint)).ToString())); }
public static ChartRangeResponse ExecuteChartRangeCommand(SyncAPIConnector connector, ChartRangeInfoRecord info, bool prettyPrint = false) { return(new ChartRangeResponse(connector.ExecuteCommand(CreateChartRangeCommand(info, prettyPrint)).ToString())); }
public static TradeTransactionResponse ExecuteTradeTransactionCommand(SyncAPIConnector connector, TRADE_OPERATION_CODE cmd, TRADE_TRANSACTION_TYPE type, double?price, double?sl, double?tp, string symbol, double?volume, long?ie_deviation, long?order, string comment, long?expiration, bool prettyPrint = false) { return(new TradeTransactionResponse(connector.ExecuteCommand(CreateTradeTransactionCommand(cmd, type, price, sl, tp, symbol, volume, order, "", expiration, prettyPrint)).ToString())); }
public static CurrentUserDataResponse ExecuteCurrentUserDataCommand(SyncAPIConnector connector, bool prettyPrint = false) { return(new CurrentUserDataResponse(connector.ExecuteCommand(CreateCurrentUserDataCommand(prettyPrint)).ToString())); }
public static TradeTransactionStatusResponse ExecuteTradeTransactionStatusCommand(SyncAPIConnector connector, long?order, bool prettyPrint = false) { return(new TradeTransactionStatusResponse(connector.ExecuteCommand(CreateTradeTransactionStatusCommand(order, prettyPrint)).ToString())); }
public static ProfitCalculationResponse ExecuteProfitCalculationCommand(SyncAPIConnector connector, string symbol, double?volume, TRADE_OPERATION_CODE cmd, double?openPrice, double?closePrice, bool prettyPrint = false) { return(new ProfitCalculationResponse(connector.ExecuteCommand(CreateProfitCalculationCommand(symbol, volume, cmd, openPrice, closePrice, prettyPrint)).ToString())); }
public static TradesHistoryResponse ExecuteTradesHistoryCommand(SyncAPIConnector connector, long?start, long?end, bool prettyPrint = false) { return(new TradesHistoryResponse(connector.ExecuteCommand(CreateTradesHistoryCommand(start, end, prettyPrint)).ToString())); }
public static StepRulesResponse ExecuteStepRulesCommand(SyncAPIConnector connector, bool prettyPrint = false) { return(new StepRulesResponse(connector.ExecuteCommand(CreateStepRulesCommand(prettyPrint)).ToString())); }
public static VersionResponse ExecuteVersionCommand(SyncAPIConnector connector, bool prettyPrint = false) { return(new VersionResponse(connector.ExecuteCommand(CreateVersionCommand(prettyPrint)).ToString())); }
public static AllSymbolsResponse ExecuteAllSymbolsCommand(SyncAPIConnector connector, bool prettyPrint = false) { return(new AllSymbolsResponse(connector.ExecuteCommand(CreateAllSymbolsCommand(prettyPrint)).ToString())); }