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 Hwop38, 05-04-2026, 07:02 PM
          0 responses
          162 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          313 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          245 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          350 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          179 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Working...
          X