Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Output window display repeats

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

    Output window display repeats

    I deleted 'clearoutputwindow' statements from my indicator and strategy. Then I deleted all print statements from the strategy [ie] so that only the indicator sends messages to the output window instead of both the indicator and the strategy sending print messages. The output window is now well behaved and makes sense.........except that the output goes from start date to end date as expected but then inexplicably repeats the output?
    Any thoughts or suggestions will be much appreciated.

    #2
    Joe, from which methods do you add prints in? Initialize() could be called multiple times.

    Is this a Single or MultiSeries script?

    Comment


      #3
      The only print statement is in Indicator OnBarUpdate. No prints anywhere else.
      I don't know the difference between single and multiseries but I'm guessing it must be single. I am running it for only the forex eurusd.

      Comment


        #4
        So there's only one series that the indicator script printing would work with, you don't Add() another market / series in it's Initialize() method?

        If you only run the strategy and not apply the indicator manually again - you would only see one set of prints, correct?

        If so I would expect that outcome, since you call the indicator in the strategy, the prints will show up double.

        Comment


          #5
          The only 'adds' are [both in the initialize region]:

          for the strategy
          Add(joeXXOindicator(
          1)); in the strategy region

          and for the indicator
          Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "PlotXXO"));

          I don't fully understand what you are trying to tell me in your 2nd and 3rd sentences?

          Comment


            #6
            Right, then you add the duplication basically in - one instance of the indicator is coming from the strategy, the other from your manual add of the indicator. Then I would expect the 'doubled' print outcome you get.

            Comment


              #7
              The following works [ie] the output window behaves.

              For the strategy, I left untouched the ‘Add(joeXXOindicator(1));’ because when I removed it the line did not plot.
              For the indicator, I deleted the ‘Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "PlotXXO"));’
              and the line color is now orange [defaults to that I guess].

              I would like to make the line color red instead of orange but so far have not been able to do so. I cannot do it in the indicator as I was doing it because it messes up the output window. Please tell me how to formulate the instruction to do so in the strategy.


              The following is the initialize region of the strategy:
              protected override void Initialize()
              {
              ClearOutputWindow();
              CalculateOnBarClose = false; //false forces last day display [of indicators?]
              Add(joeXXOindicator(1));
              joeXXOindicator(1).Plots[0].Pen.Width = 3;
              ExitOnClose=false;//do not go flat at bar close [ie] want to remain in position
              Print(" ");
              Print("//////////////// INITIALIZE STRATEGY /////////////////////");
              Print(" ");
              }
              Last edited by joemiller; 07-24-2013, 07:19 AM.

              Comment


                #8
                You can change the plot pen color for the added indicator as well -

                joeXXOindicator(1).Plots[0].Pen.Color = Color.Red

                Comment


                  #9
                  Everything in the output window now works almost 100% as expected for day bars.
                  However I don’t understand the following:
                  At the beginning of every run, debug trace messages show that the following sequence of events occurs:
                  INITIALIZE INDICATOR
                  INITIALIZE STRATEGY
                  INITIALIZE INDICATOR
                  INITIALIZE INDICATOR
                  INITIALIZE INDICATOR
                  INITIALIZE STRATEGY
                  Should all those initializations be occurring?

                  Basically the output window for non-day bars work well enough, but with a little more complicated mystery than that for the day bars described above.

                  Comment


                    #10
                    Yes, the Initialize() method will be called multiple times. If you want to print something only once before OnBarUpdate(), you could use OnStartUp().

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by argusthome, 03-08-2026, 10:06 AM
                    0 responses
                    71 views
                    0 likes
                    Last Post argusthome  
                    Started by NabilKhattabi, 03-06-2026, 11:18 AM
                    0 responses
                    43 views
                    0 likes
                    Last Post NabilKhattabi  
                    Started by Deep42, 03-06-2026, 12:28 AM
                    0 responses
                    25 views
                    0 likes
                    Last Post Deep42
                    by Deep42
                     
                    Started by TheRealMorford, 03-05-2026, 06:15 PM
                    0 responses
                    28 views
                    0 likes
                    Last Post TheRealMorford  
                    Started by Mindset, 02-28-2026, 06:16 AM
                    0 responses
                    56 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Working...
                    X