Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

simple coding question

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

    simple coding question

    Hi

    I wish to code with reference to the high of my entry bar. May I know how this is coded?

    #2
    ggcow,

    So you are trying to reference the High of the bar where you entered a trade at?

    You can either store this value when you enter a trade, or you can use BarsSinceEntry and the High[] dataseries.





    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Hi Adam,

      Actually, I am trying to code:

      Enter short limit at the high of the 2 bar ago from the entry bar. Do you know how it is done?

      Comment


        #4
        Hi ggcow,

        You can use High[ ] and BarsSinceEntry for this.

        double myOrderPrice = High[BarsSinceEntry() + 2];
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by ggcow View Post
          Hi Adam,

          Actually, I am trying to code:

          Enter short limit at the high of the 2 bar ago from the entry bar. Do you know how it is done?
          Code:
          if (entryConditionsMet) 
          {
          orderPrice = High[CurrentBar + 2];
          //...
          }

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          649 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          370 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          109 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          574 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          576 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X