I'm trying to do it with files.
https://ninjatrader.com/support/help..._files_oif.htm
says that you should increment the OIF.txt file you use for each order.
Why is it adding slashes before and after my incrementing integer that I turned into a string?
private void [B]OnOrderUpdate[/B](object sender, OrderEventArgs e)
{
string folderName = @"C:\Users\ezrol\OneDrive\Documents\NinjaTrader 8\incoming\";
string fileName = @"oif";
[B]string stringIncrement = increment.ToString();[/B]
string extension = @".txt";
string pathAndFile = System.IO.Path.Combine(folderName, fileName, [B]stringIncrement[/B], extension);
string writeText = "";
//string writeText = "PLACE";"SimJons";"INSTRUMENT;ACTION;1;OR DER TYPE;LIMIT PRICE;STOP PRICE;GTC;OCO ID;ORDER ID;STRATEGY;STRATEGY ID"; // [B]not sure how to correctly write the variables on all these fields?[/B]
File.WriteAllText(pathAndFile, writeText); // Create a file and write the content of writeText to it
increment++;
}

Comment