I think the text created has a space at the end. How can I prevent ninjatrader from "reading" that space as well?
This is my script:
Dim oWSH
Dim oArgs
Dim oFSO
Dim oFile
Dim i
Dim iResult
Dim sText
Const cstPathForAlertFile = "C:\Program Files\NinjaTrader 5\incoming\oif.txt"
Const cstScriptName = "orderscript"
Set oWSH = WScript.CreateObject("WScript.Shell")
Set oArgs = WScript.Arguments
If oArgs.Count > 0 Then
For i = 0 To oArgs.Count - 1
sText = sText & oArgs.Item(i) & " "
Next
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFile= oFSO.CreateTextFile(cstPathForAlertFile, True)
oFile.WriteLine sText
oFile.Close
iResult = oWSH.popup("oif.txt file created", 3, cstScriptName, 64)
Else
iResult = oWSH.popup("No Command Line Params Passed!" & vbCrlf & "Alert File NOT Created",,cstScriptName, 16)
End If
set oFile = Nothing
Set oFSO = Nothing
Set oArgs = Nothing
Set oWSH = Nothing
This is the text file for ninjatrader:
PLACE;SIM101;FDAX 12-05;Sell;1;MARKET;0;0;Day;;;;
(there is as space at the end of this textfile)
Comment