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 CarlTrading, Yesterday, 09:41 PM
            1 response
            14 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, Today, 02:41 AM
            0 responses
            6 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, Yesterday, 11:44 PM
            0 responses
            11 views
            0 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            32 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            30 views
            0 likes
            Last Post CarlTrading  
            Working...
            X