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 f.saeidi, Today, 08:01 PM
              0 responses
              2 views
              0 likes
              Last Post f.saeidi  
              Started by Rapine Heihei, Today, 07:51 PM
              0 responses
              3 views
              0 likes
              Last Post Rapine Heihei  
              Started by frslvr, 04-11-2024, 07:26 AM
              5 responses
              96 views
              1 like
              Last Post caryc123  
              Started by algospoke, 04-17-2024, 06:40 PM
              6 responses
              49 views
              0 likes
              Last Post algospoke  
              Started by arvidvanstaey, Today, 02:19 PM
              4 responses
              11 views
              0 likes
              Last Post arvidvanstaey  
              Working...
              X