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,
    BertrandNinjaTrader Customer Service

    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?
        BertrandNinjaTrader Customer Service

        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.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by algospoke, Yesterday, 06:40 PM
            2 responses
            23 views
            0 likes
            Last Post algospoke  
            Started by ghoul, Today, 06:02 PM
            3 responses
            14 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            45 views
            0 likes
            Last Post jeronymite  
            Started by Barry Milan, Yesterday, 10:35 PM
            7 responses
            22 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by AttiM, 02-14-2024, 05:20 PM
            10 responses
            181 views
            0 likes
            Last Post jeronymite  
            Working...
            X