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.

    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.

        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.

            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.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by yertle, Yesterday, 08:38 AM
              7 responses
              28 views
              0 likes
              Last Post yertle
              by yertle
               
              Started by bmartz, 03-12-2024, 06:12 AM
              2 responses
              21 views
              0 likes
              Last Post bmartz
              by bmartz
               
              Started by funk10101, Today, 12:02 AM
              0 responses
              6 views
              0 likes
              Last Post funk10101  
              Started by gravdigaz6, Yesterday, 11:40 PM
              1 response
              9 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by MarianApalaghiei, Yesterday, 10:49 PM
              3 responses
              11 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X