Client myClient = new Client();
int connect = myClient.Connected(1);
Decimal StockPrice = (Decimal)getPrice;
Decimal TakeProfit = StockPrice + (1.40M * ADR); ;
Decimal StopLoss = StockPrice - ADR;
DateTime foo = DateTime.Now;
long unixTime = ((DateTimeOffset)foo).ToUnixTimeSeconds(); //Ensures that an original OCOID is always generated
//Original Price
int mainPosition = myClient.Command("PLACE", "Sim101", "MNQ 03-22", "BUY", 1, "MARKET", 0, 0, "GTC", unixTime.ToString(), "", "", "");
//Take Profit Order
int takeProfitPosition = myClient.Command("PLACE", "Sim101", "MNQ 03-22", "SELL", 1, "LIMIT", (double)TakeProfit, 0, "GTC", unixTime.ToString(), "", "", "");
//Stop Loss Order
int stopLossPosition = myClient.Command("PLACE", "Sim101", "MNQ 03-22", "SELL", 1, "STOPMARKET", 0, (double)StopLoss, "GTC", unixTime.ToString(), "", "", "");
Comment