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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      153 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      305 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      244 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      345 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      176 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X