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 bortz, 11-06-2023, 08:04 AM
      47 responses
      1,610 views
      0 likes
      Last Post aligator  
      Started by jaybedreamin, Today, 05:56 PM
      0 responses
      9 views
      0 likes
      Last Post jaybedreamin  
      Started by DJ888, 04-16-2024, 06:09 PM
      6 responses
      19 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Jon17, Today, 04:33 PM
      0 responses
      6 views
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      16 views
      0 likes
      Last Post Javierw.ok  
      Working...
      X