Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bar object

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

    Bar object

    I'm trying to pass the bar object to one of my function but "Cannot implicitly convert type double to Ninjatrader.data.bar"

    here code reads
    Code:
    Bar b = Bars[0];
    I'm just trying to pass the bar info (e.g., High, Low, Close, Open)

    what am I doing wrong?

    Thanks

    #2
    No need use those unnecessary thing.

    Just use
    High[0], Low[0], Close[0]. Open[0]

    The value Zero(0) indicator that current bar.

    When it is value of 2, it means 2 bar ago.

    Comment


      #3
      Just use the default code will do

      Comment


        #4
        Can someone from NT help with this please?
        I don't wanna pass OHLC values if it's possible to pass a bar.

        Comment


          #5
          Hello Leeroy_Jenkins,

          Thank you for your reply.

          Using NinjaTrader.Data.Bar is not documented and we would recommend to pass your function the Open[0], High[0], Low[0], Close[0] and Time[0] values instead as cincai suggested.

          Please let us know if we may be of further assistance to you.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          52 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          130 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          70 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          43 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          47 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X