• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

strategy id ' ' does not exist

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • highflyer
    started a topic strategy id ' ' does not exist

    strategy id ' ' does not exist

    After generating a text file with Amibroker I get this message. What is wrong?

    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)




  • highflyer
    replied
    imported post

    Solved the problem with RTrim:

    oFile.WriteLine RTrim(sText)

    And now it works.Thanks

    Leave a comment:


  • NinjaTrader_Ray
    replied
    imported post

    Can you not write something that trims sText last space character? I am not familiar with what language Amibroker is based on but in .NET I could do something like:

    sText.Remove(sText.Length - 1, 1)


    Leave a comment:


  • highflyer
    replied
    imported post

    Dierk,



    I can write : sText = sText & oArgs.Item(i) & " "


    as: sText = sText & oArgs.Item(i) & "" (<note: no space)

    but than also FDAX 12-05 is written as FDAX12-05 (also with no space)

    I don't understand.Think I need a new script for Amibroker...(maybe)

    greetz from Amsterdam

    Leave a comment:


  • NinjaTrader_Dierk
    replied
    imported post

    You need to write out the text without (!) the trailing blank. Although I'm not familiar with AmiBroker I suggest the problem lies somewhere in

    For i = 0 To oArgs.Count - 1
    sText = sText & oArgs.Item(i) & " "
    Next

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by PLeary, Today, 06:25 AM
0 responses
3 views
0 likes
Last Post PLeary
by PLeary
 
Started by sergey_z, Today, 06:17 AM
0 responses
1 view
0 likes
Last Post sergey_z  
Started by nikkk, Today, 06:14 AM
1 response
2 views
0 likes
Last Post NinjaTrader_PatrickG  
Started by chazyang, Today, 02:01 AM
2 responses
10 views
0 likes
Last Post NinjaTrader_PatrickG  
Started by tonynt, Today, 01:20 AM
1 response
22 views
0 likes
Last Post NinjaTrader_PaulH  
Working...
X