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 Christopher_R, Today, 12:29 AM
            0 responses
            8 views
            0 likes
            Last Post Christopher_R  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            166 responses
            2,235 views
            0 likes
            Last Post sidlercom80  
            Started by thread, Yesterday, 11:58 PM
            0 responses
            3 views
            0 likes
            Last Post thread
            by thread
             
            Started by jclose, Yesterday, 09:37 PM
            0 responses
            7 views
            0 likes
            Last Post jclose
            by jclose
             
            Started by WeyldFalcon, 08-07-2020, 06:13 AM
            10 responses
            1,415 views
            0 likes
            Last Post Traderontheroad  
            Working...
            X