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 SalmaTrader, 07-07-2026, 10:26 PM
            0 responses
            45 views
            0 likes
            Last Post SalmaTrader  
            Started by CarlTrading, 07-05-2026, 01:16 PM
            0 responses
            22 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 06-17-2026, 10:32 AM
            0 responses
            14 views
            0 likes
            Last Post CaptainJack  
            Started by kinfxhk, 06-17-2026, 04:15 AM
            0 responses
            20 views
            0 likes
            Last Post kinfxhk
            by kinfxhk
             
            Started by kinfxhk, 06-17-2026, 04:06 AM
            0 responses
            22 views
            0 likes
            Last Post kinfxhk
            by kinfxhk
             
            Working...
            X