Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time Settings Question

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

    Time Settings Question

    Here is what I am trying to accomplish:

    Instead of having my positions close at the end of the day, I would like my stop loss routine to continue during the globex session, but not enter any new trades during this session. I first tried inserting a routine in my code that checked for the time and not enter any trades before 6:30 am and after 1pm. However, my moving avg. indicators in my script are now using the globex session and not just the cash session causing my buy / sell signals to get messed up (entering 3x as many trades). Is there a better way?

    Thanks,

    Rich

    #2
    Hello,

    Thank you for your note.

    Do you need to adjust your stops after hours?

    I look forward to assisting you further.
    BrettNinjaTrader Product Management

    Comment


      #3
      Yes, that is what I'm trying to do. Keep any current trades going after hours but adjusting my stops using my automated strategy. I don't want to enter any new trades after hours, and I need my moving avg indicators to be calculated off of the day session chart and not the 24 hour chart.

      Comment


        #4
        Hello,

        Thanks for that information.

        No need to adjust the session template or anything like that then. As the stops will still be active even though the market is in after hours mode.If it was me I would just run it as you had it.

        Let me know if I can be of further assistance.
        BrettNinjaTrader Product Management

        Comment


          #5
          I know that my stop will be active from when the session ended, but would it continue to update during the AH session?

          Comment


            #6
            Hello,

            Oh ok I read the answer yes and was tieing it to the opposite question.

            In this case you are correct you need OnBarUpdate() to be called to adjust a stop, however since OnBarUpdate is only called during the session hours and the stop needs to be updates you will need to user a longer time frame chart.

            All calculations for the chart are done through the master chart session template and there is no way to specify a different one for a specific indicator.

            I will discuss this with a colleague here in the office and see what the best route is to proceed here.


            I look forward to assisting you further.
            BrettNinjaTrader Product Management

            Comment


              #7
              Hello,

              Unfortunately there would be no way to do this currently. The only way to do it would be to modify SMA() to only calc off the open market hours and this would take messing with arrays to get this to work which is Unfortunately not supported.

              The only other idea to do this would be to run on a regular market hours chart and then use SetStopLoss() in OnMarketData() instead of OnBarUpdate(), this would be an unsupported use on SetStopLoss but should work.

              Quick question though what are you wanting to use to change your stops?

              Let me know if I can be of further assistance.
              BrettNinjaTrader Product Management

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Today, 05:17 AM
              0 responses
              44 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              124 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              65 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              42 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              46 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X