Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

unexpected behaviour in Trading Hours

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

    unexpected behaviour in Trading Hours

    I am having problems with playback and Trading hours


    I have my trading hours template set up to stop trading at 3PM, when this time arrives the strategy stops and the chart halts at that point but the P and L Keeps running on ?

    I expected this to stop as the strategy is set to exit at session close set at 3PM

    The way it is behaving is making the trading hours non sensical ?

    Thanks

    #2
    Hello fredfred,

    Can you reproduce this behavior testing with Playback and Market Replay data?

    Is there a position that is left open that is opened by the strategy?
    (Does the control center show the strategy has a position?)

    Is the Exit on close checked an enabled in the strategy parameters?

    If the strategy is on a chart, do you see the chart stop updating when the trading session is closed?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea

      Q= Can you reproduce this behavior testing with Playback and Market Replay data?
      A= Haven't tested this as I do not have Market replay data loaded -just Historical

      Q=Is there a position that is left open that is opened by the strategy?
      (Does the control center show the strategy has a position?)

      A=Yes control centre/orders working and accepted

      Q Is the Exit on close checked an enabled in the strategy parameters?
      A= yes

      Q= If the strategy is on a chart, do you see the chart stop updating when the trading session is closed?

      A= Yes the chart is static, and Exit on session close recorded

      Thanks
      Last edited by fredfred; 05-10-2018, 02:05 PM.

      Comment


        #4
        Hello fredfred,

        On the Strategies tab of the Control Center, what is the Position column showing for this instance of the strategy after the close of a session?

        (The order Exit on close order on the chart would suggest that the strategy exited its position)
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi Chelsea


          Q= On the Strategies tab of the Control Center, what is the Position column showing for this instance of the strategy after the close of a session?

          The Position column is showing the amount of contracts followed by an "L"

          The order is however open in the Orders tab and the P and L is still counting as if the position has not closed.

          The Chart states Position closed, but it is still open and counting ?

          Comment


            #6
            Hello fredfred,

            May I have a screenshot of the Strategies tab of the Control Center and a screenshot of the Chart with the strategy enabled on it?

            To send a screenshot with Windows 7 or newer I would recommend using Window's Snipping Tool.
            Click here for instructions

            Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.
            Click here for detailed instruction
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Please find screen shots and also my Trading times template to see if I set it up correctly.
              Attached Files

              Comment


                #8
                Hello fredfred,

                The chart is showing that after a new session started a new position was entered.

                Is the buy order for 40,000 at the open of the new session the unexpected behavior?
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  HI Chelsea

                  Yes I think this would be the case as the open order is for 40000.

                  Thanks

                  Comment


                    #10
                    Hi Chelsea

                    supplied screen shots of orders tab
                    Attached Files

                    Comment


                      #11
                      Any progress on this Problem?

                      Comment


                        #12
                        Hello fredfred,

                        Thank you for your patience.

                        May we review the strategy code on our end? If you would like you can send the strategy attached to an email to platformsupport[at]ninjatrader[dot]com with 'ATTN: Patrick H' in the subject line and a reference to this thread in the body of the email.

                        You can export your strategy by going to Tools > Export > NinjaScript Add On > Add > select your strategy > OK > Export > name the file 'NTsupport' > Save.

                        The file will be located under Documents\NinjaTrader 8\bin\Custom\ExportNinjaScript. Please attach the file to your response.

                        I look forward to assisting you further.

                        Comment


                          #13
                          Email and attachment sent

                          Thanks

                          Comment


                            #14
                            Hello fredfred,

                            Thank you for sending in the file.

                            So the strategy while setting ExitOnSessionCloseStrategy as true and using an ExitOnSessionCloseSeconds to 30, the strategy still runs Calculate.OnEachTick. This means there is the chance that after the exit on close occurs a new entry then occurs.

                            If you want to halt a strategy during specific times please refer to our reference sample at the following link: https://ninjatrader.com/support/help...to_limit_t.htm

                            Please let me know if you have any questions.

                            Comment


                              #15
                              Hello Patrick

                              Thank you for your reply.

                              So am I correct in thinking that if the strategy was set for on bar close this would solve the problerm ?

                              I also do not understand why we have a trading hours set up in the main consul when we have to enter the code in the script for the thing to work ?

                              Surely when the script has hit end of day that is it ? what you are saying is that a new entry has occured ? sorry I am not a coder but I am using the strategy builder for the script and would have to come out of that to introduce the bespoke code. When you set this in the Trading hours why does this not write the correct code?

                              I am feeling that again not being a coder, when ExitOnSessionCloseSeconds to 30 I don't understand even if you explained it to me that the strategy still runs on each tick, why doesn't the Trading hours sort this out ? Can't see the point of having it ?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by frslvr, 04-11-2024, 07:26 AM
                              8 responses
                              111 views
                              1 like
                              Last Post NinjaTrader_BrandonH  
                              Started by stafe, 04-15-2024, 08:34 PM
                              10 responses
                              44 views
                              0 likes
                              Last Post stafe
                              by stafe
                               
                              Started by rocketman7, Today, 09:41 AM
                              3 responses
                              8 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by traderqz, Today, 09:44 AM
                              2 responses
                              5 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by rocketman7, Today, 02:12 AM
                              7 responses
                              31 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Working...
                              X