Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Not plotting

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

    Not plotting

    I can print in output window what should be plotting, but nothing is potting in the chart window .. any ideas?

    Here is a portion of the code.
    protected override void Initialize()
    {
    Add(PeriodType.Minute,1);
    Add(StrategyPlot(0));
    StrategyPlot(0).PanelUI = 2;
    StrategyPlot(0).Name ="PNL Today Plot ";




    }

    protected override void OnBarUpdate()
    {
    if (BarsInProgress == 0)
    return;

    Print (ToTime(Time[0])+ " PNL "+Position.GetProfitLoss(Close[0], PerformanceUnit.Currency)); // prints to output window

    StrategyPlot(0).Value.Set( Position.GetProfitLoss(Close[0], PerformanceUnit.Currency));
    }
    Attached Files
    Last edited by gg80108; 05-09-2011, 09:26 AM.

    #2
    gg80108, was this generated realtime going forward or in backtesting? Is the StrategyPlot sample plotting as expected or would it also give you an issue?

    Thanks,

    Comment


      #3
      Yes the sample plots ok,, wonder if has something to do with the

      if (BarsInProgress == 0)
      return;

      I have at the top of my code to only execute on the secondary bars (1 minute bars)...

      Comment


        #4
        Yes, that could be it - as the plots would be tied to the primary series. Have you tried commenting this for example out and recheck?

        Comment


          #5
          I moved my
          StrategyPlot(0).Value.Set( Position.GetProfitLoss(Close[0], PerformanceUnit.Currency));

          to before the

          if (BarsInProgress == 0)
          return;

          and now plots ok, don't know if this is a real fix or there was something I could of added to the .Set to make this work .....

          Comment


            #6
            That good to hear, no - the plots would need to come from the primary series.

            Comment

            Latest Posts

            Collapse

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