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 cmoran13, 04-16-2026, 01:02 PM
      0 responses
      42 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      25 views
      0 likes
      Last Post PaulMohn  
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      162 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      98 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      157 views
      2 likes
      Last Post CaptainJack  
      Working...
      X