Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

signal passed a high/low on time frame

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

    signal passed a high/low on time frame

    I wrote code that will enter after a certain time frame and a break of high/low for that timeframe. I only want to make one trade per session. How do I restrict entries per session to no more than one per session?

    #2
    You would have to create a bool variable that is set to true once you have traded once in a session. Then check for the property FirstBarOfSession to reset this variable to false.
    RayNinjaTrader Customer Service

    Comment


      #3
      I tried setting a boolean variable to true within the order entry block, however no signals were created when I did that. I would need to reset the variable after each session. How would I do that?

      Comment


        #4
        if (FirstBarOfSession)
        // Reset variable here
        RayNinjaTrader Customer Service

        Comment


          #5
          I get "Does not exist in current context." for FirstBarOfSession

          Comment


            #6
            My apologies..should be

            Bars.FirstBarOfSession
            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

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