Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pnf Help

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

    Pnf Help

    Hi Guys need a little help,

    I have a piece of code which works with time bars and its as follow:

    Code:
                
    else if (State == State.Configure)
                {
                    AddDataSeries(Inst1, BarsPeriodType.Minute, timeframe);/// Leg1   BarsInProgress 1
                    AddDataSeries(Inst2, BarsPeriodType.Minute, timeframe);/// Leg2   BarsInProgress 2
    
                    Leg1 = new Series<double>(this);
                       Leg2 = new Series<double>(this);
                }
            }​
    where timeframe is simply declare above int timeframe = 30;


    Want to change this code to work with PnF chart:
    Code:
    else if (State == State.Configure)
    {
    AddDataSeries(Inst1, BarsPeriodType.PointAndFigure, timeframe);/// Leg1 BarsInProgress 1
    AddDataSeries(Inst2, BarsPeriodType.PointAndFigure, timeframe);/// Leg2 BarsInProgress 2
    
    Leg1 = new Series<double>(this);
    Leg2 = new Series<double>(this);
    }
    }
    ​
    but how do I reference timeframe above now?

    #2
    Hello LakeViewCap,

    To add point and figure charts you can use AddPointAndFigure:

    https://ninjatrader.com/support/help...int+and+figure

    As a side note I see you are using variables for the instrument name and other parameters, keep in mind that will fail in certain use cases. This is documented in all of the Add data pages:

    Arguments supplied to AddDataSeries() should be hardcoded and NOT dependent on run-time variables which cannot be reliably obtained during State.Configure (e.g., Instrument, Bars, or user input). Attempting to add a data series dynamically is NOT guaranteed and therefore should be avoided.
    Arguments supplied to AddPointAndFigure() should be hardcoded and NOT dependent on run-time variables which cannot be reliably obtained during State.Configure (e.g., Instrument, Bars, or user input). Attempting to add a data series dynamically is NOT guaranteed and therefore should be avoided.

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello LakeViewCap,

      To add point and figure charts you can use AddPointAndFigure:

      https://ninjatrader.com/support/help...int+and+figure

      As a side note I see you are using variables for the instrument name and other parameters, keep in mind that will fail in certain use cases. This is documented in all of the Add data pages:

      yeah my question is on the "timeframe" variable....


      those vars are hardcoded:

      string Inst1= "NQ MAR24";
      string Inst2= "ES MAR24";​

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      574 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      332 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      553 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X