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 Mindset, 04-21-2026, 06:46 AM
            0 responses
            102 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            144 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            71 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by cmoran13, 04-16-2026, 01:02 PM
            0 responses
            125 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            79 views
            0 likes
            Last Post PaulMohn  
            Working...
            X