Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Print (to console) in OnStartUp()

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

    Print (to console) in OnStartUp()

    Hi guys,

    I'm trying to run a print command in the OnStartUp() to print something to the output window only once, when a Strategy starts. For example:

    PrintWithTimeStamp("Strategy XYZ has started");

    I've tried a few different things and I'm not having any luck.

    Am I overlooking something?

    Thanks!

    #2
    Hmm, worked for me in a quick test here - is the strategy enabled as you apply it to the charts?

    Comment


      #3
      Thanks Bertrand,

      I can't even get it to compile...


      Initialize()
      ...............

      OnStartUp()
      {
      //Insert future code here
      }

      PrintWithTimeStamp("My Test");

      OnBarUpdate()
      ..............

      Can you show me the quick test code you used?

      Thanks!

      Comment


        #4
        You're Print is outside the OnStartUp() -

        Code:
        OnStartUp()
        {
        PrintWithTimeStamp("My Test");
        }

        Comment


          #5
          Doh!

          I tried everything but that including if statements...

          Thank you.

          Looks like it TimeStamps at the first bar loaded in the strategy, but I can use that.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          599 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          345 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          558 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          558 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X