Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy not taking live trades but showing historical trades

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

    #46
    Hello Chelsea,

    I just thought about something: My condition statement will always be false because if Times[0][0].TimeOfDay <= new TimeSpan(08,30, 00) and if the time is 2300, then the condition will evaluate false because 2300 is greater than 0830, not less than 0830.

    Comment


      #47
      Hello AdeptistJune,

      Is this the test script I have provided you without being modified? Because this is not the condition or the print in the exported file I have posted?

      Did you test the test script I have provided without modifying it?

      With the condition in your last post, you are expecting a time that is greater than 17:00 and less than 8:30 at the same time? What time would be after 17:00 and before 8:30?
      Chelsea B.NinjaTrader Customer Service

      Comment


        #48
        Hello, Chelsea,

        I did test the script you provided and it works perfectly for plotting RTH level. I'm just doing my best to calculate the overnight levels and use those plots during the RTH without any issues. When I an overnight trading hour template in an AddDataSeries, it will show historical trades only, but not take live trades because something about not being in session.
        Last edited by AdeptistJune; 12-27-2021, 08:48 AM.

        Comment


          #49
          Hello AdeptistJune,

          Use or in the logic with two vertical lines instead of and.

          In C#: thisCondition || thisCondition

          There is no time of the day that is greater than 17:00 and less than 8:30.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #50
            Hello, Chelsea,

            I can't believe I was overthinking that. The "Or" condition worked. I did learn how to use prints to check conditions, though. Thanks for toughing it out with me.

            Comment


              #51
              Hello, Chelsea,

              Now the only problem I'm having is that the when I test a simple condition statement, "if during RTH, and the high cross above overnight high do something." For the oddest reason, the trade fires at 0830 no matter if the high crossed above the overnight high or not.

              But I will use print statements to see if I can figure it out on my own.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Yesterday, 05:17 AM
              0 responses
              64 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              139 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              75 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              45 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              50 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X