Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Printing a string variable to the output window

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

    Printing a string variable to the output window

    Hi all,

    I know I'm doing something really shortsighted, but I need help trying to fix this.

    I've initialized a string variable called "LongEntry_EvalScore_Status" as a string data type. I assign a thread of text to it (something like "Situation 1"). When it comes time to print it in the output window with the following code....

    Print("LongEntry_EvalScore_Status: " + LongEntry_EvalScore_Status);

    Nothing appears to the right of the title. Am I missing a toString() somewhere, or does the output window handle string variables differently?

    Thanks in advance to anyone that can help.

    Yours,
    Spider

    #2
    Spider, what happens if you only print the LongEntry_EvalScore_Status variable upon hitting your print condition, with the title in front? Would you see a different outcome?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Bertrand,

      I went one step further and wiped out the title part of the print statement. So, it just reads:
      Print(LongEntry_EvalScore_Status);

      ... but it still prints out a blank line in the Output window.

      Now, it could be what I'm attempting to save as a string. Take a look at these and see if you think I'm attempting and weird character saves with these statements:

      LongEntry_EvalScore_Status = "LE Scenario 2 - One hit now, one hit earlier";
      LongEntry_EvalScore_Status = "LE Scenario 3 - No hit, but previous double hit";

      Another possibility is that my conditions for these scenarios are not being hit, hence nothing's being printed. Still looking into it.

      Comment


        #4
        It actually ended up being the last possibility (i.e. the conditions were never hit). Thanks for the reply earlier all the same!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by techgetgame, Yesterday, 11:42 PM
        0 responses
        8 views
        0 likes
        Last Post techgetgame  
        Started by sephichapdson, Yesterday, 11:36 PM
        0 responses
        2 views
        0 likes
        Last Post sephichapdson  
        Started by bortz, 11-06-2023, 08:04 AM
        47 responses
        1,613 views
        0 likes
        Last Post aligator  
        Started by jaybedreamin, Yesterday, 05:56 PM
        0 responses
        10 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        20 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Working...
        X