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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      72 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      39 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X