Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsSinceEntry()

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

    BarsSinceEntry()

    Hello,

    I'm not able to figure this out, so maybe someone can help me. Please have a look at the attached picture.

    Now in my opinion the following values should be printed to the output window.

    18.00
    Bars since entry = 0
    Lowest bar since entering trade = 0
    Lowest price since entering trade = 1,0968

    19.00
    Bars since entry = 1
    Lowest bar since entering trade = 1
    Lowest price since entering trade = 1,0968

    20.00
    Bars since entry = 2
    Lowest bar since entering trade = 2
    Lowest price since entering trade = 1,0968

    21.00
    Etc.

    However, the output window print the following:

    25-7-2016 18:00:00 BarsSinceEntry() = 0
    25-7-2016 18:00:00 LowestBar(Low,BarsSinceEntry() = 0
    25-7-2016 18:00:00 Low[LowestBar(Low,BarsSinceEntry()] = 1,0968
    25-7-2016 19:00:00 BarsSinceEntry() = 1
    25-7-2016 19:00:00 LowestBar(Low,BarsSinceEntry() = 0
    25-7-2016 19:00:00 Low[LowestBar(Low,BarsSinceEntry()] = 1,0977
    25-7-2016 20:00:00 BarsSinceEntry() = 2
    25-7-2016 20:00:00 LowestBar(Low,BarsSinceEntry() = 1
    25-7-2016 20:00:00 Low[LowestBar(Low,BarsSinceEntry()] = 1,0977

    Where the LowestBar seems to be one lower than supposed to. Does anyone now why this is?

    Thanks in advance.

    Regards,

    Gunnar
    Attached Files

    #2
    Hello Bruin813,

    Thank you for writing in.

    I wouldn't expect the Low value to go up.

    Can you please provide your script so I may test it on my end?

    If it is an indicator, it can be found within the Documents\NinjaTrader 7\bin\Custom\Indicator folder on your computer. If it is a strategy, it can be found within the Documents\NinjaTrader 7\bin\Custom\Strategy folder.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Dear Zachary,

      I think I found out. The LowestBar function does not see zero as a valid value while BarsSinceEntry() does.

      Thanks for replying, though.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      77 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      45 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      27 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      32 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      63 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X