Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Finding close price of previous entry

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

    Finding close price of previous entry

    Essentially, I am trying to make a condition where close [0] > close [previous entry]

    I've searched all throughout the NT help guide, but I can't find anything. And I'm used to MT4, so this is all new to me. My guess is that I could somehow use BarsSinceEntry [0] and then using that value to build the condition.

    #2
    Hello Jeddy197,

    Welcome to the NinjaTrader Support Forums!

    Yes, that would be correct that you may use the BarsSinceEntry() method to be able to get the Close price of the bar when you entered.

    You could also save the "CurrentBar" value to a variable to so that you can get the bar value as well.

    Happy to be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Thank you. I hate to be spoon fed, but how would that look in syntax?

      Again, I'm very new to this, but trying to learn!

      Comment


        #4
        Hello Jeddy197,

        You may use something like:

        Code:
        if (Close[0] > Close[BarsSinceEntry()] ) 
        {
            // Do something.
        }


        Happy to be of further assistance.
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        22 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        121 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        176 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        92 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        134 views
        0 likes
        Last Post cmoran13  
        Working...
        X