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

Print several variables in one line

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

    Print several variables in one line

    Hello, just a quick question: Is there a possibility to print several variables in one line in the output windows?

    e.g.

    2014/08/18 smaSlow 154,55 smafast 156,77
    2014/08/19 smaSlow 156,55 smafast 154,77
    ...

    Thanks

    #2
    Originally posted by phadreus View Post
    Hello, just a quick question: Is there a possibility to print several variables in one line in the output windows?

    e.g.

    2014/08/18 smaSlow 154,55 smafast 156,77
    2014/08/19 smaSlow 156,55 smafast 154,77
    ...

    Thanks
    Yes, use +

    Print ( "Hello World! " + ToDay (Time[0]) + "," + ToTime(Time[0]) + ",Entered Short at:" + BarsArray[0].LastPrice );

    Comment


      #3
      Hello phadreus,

      Thank you for your note.

      This is correct. You would need to use the + here to add the different values and strings together.
      Cal H.NinjaTrader Customer Service

      Comment


        #4
        Red marks in the script editor

        Thanks to all of you. It works fine. Just another printing question. The scripting editor marks some words of my coding in red but I get no failure during the compiling process and my strategy works fine as well. Could you give me a hint, what that means. Thanks

        PS: here an example

        Attached Files

        Comment


          #5
          Originally posted by phadreus View Post
          Thanks to all of you. It works fine. Just another printing question. The scripting editor marks some words of my coding in red but I get no failure during the compiling process and my strategy works fine as well. Could you give me a hint, what that means. Thanks

          PS: here an example
          That is standard color coding from the editor. That particular color is used for literal strings.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Rapine Heihei, Today, 07:51 PM
          0 responses
          2 views
          0 likes
          Last Post Rapine Heihei  
          Started by frslvr, 04-11-2024, 07:26 AM
          5 responses
          96 views
          1 like
          Last Post caryc123  
          Started by algospoke, 04-17-2024, 06:40 PM
          6 responses
          49 views
          0 likes
          Last Post algospoke  
          Started by arvidvanstaey, Today, 02:19 PM
          4 responses
          11 views
          0 likes
          Last Post arvidvanstaey  
          Started by samish18, 04-17-2024, 08:57 AM
          16 responses
          61 views
          0 likes
          Last Post samish18  
          Working...
          X