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 charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          60 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          145 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          161 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          97 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          283 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Working...
          X