Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Session Halt Bid/Ask Difference impacting my logic for exit upon session open

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

    Session Halt Bid/Ask Difference impacting my logic for exit upon session open

    Hello,

    I have been using a strategy for ZS where I have come across an issue. When we have the session halt the bid/ask can obviously be much higher or lower than the actual trading price This causes the bid and ask to take a look at how far the trade has moved against or for me and then executing logic on bar update when the session opens back up and I have been kicked out twice the last two days this way. I guess I can't be mad since I still made money on both trades but when I start scaling this one, this would be the only issue hindering the trades.

    Is there a way to block this easily and make sure that bid or ask price has actually been traded in my exit logic? I know the other way around could be to put in time variables for my exit that won't register 8:30am to 9:30am est in the logic but I feel like that could cause a different issue. Any suggestions would be appreciated!

    #2
    Hello durdcash,

    Thanks for your post.

    Once the session is closed then your strategy wouldn't be calculating logic.

    So I may accurately assist, please provide details on what specific error message or rejection are you seeing.

    If possible, please share a screenshot of the error message or rejection so I may see what you are seeing.
    • To send a screenshot with Windows 10 or newer I would recommend using the Windows Snipping Tool.
    • Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save it as a jpeg file and send the file as an attachment.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      NinjaTrader_BrandonH So I am not getting any error codes or rejections since I am using all internal logic for on bar update and then it is using that to just submit enterlong/exitlong and vice versa for short. I built a target chase thatfunctions properly for all my other systems, but this is the only system I have allowed to hold through that session close.

      I drew some lines that has all my functioning internal stops and targets that never have issues for over 6 months with any other automated systems of mine. So during the session break the ask price was at L1 even though the actual price was right around the yellow entry line which can always happen. Now I wasn't looking at the bid/ask right at 9:30 to see if even for a second it showed that when it first started processing data again. Now my system did not exit immediately. It exited right around 10am.

      Where it exited is where my target chase sells for profit after I had a move go too far against me. Has worked on ES just recently. Now essentially with my code I built it so that when I get around that same area of L1, I will just try to sell out for the price I got. I only have that target chase activate when I get a move that is over 40 ticks against me and then it will sell out for 12 ticks give or take depending on the volatility.

      It essentially made this condition true to then sell me out when we reached that level. I do not have other exit conditions that could have triggered in its place. If this is not something you are familiar with, I'm guessing the best course of action would just be some extra time constraints and I already have these for other purposes and I could add an extra where it makes sure its not between 8:29-9:31. I was just wondering if there's an easier way to go about it without needing to add this new time constraint everywhere and then making sure I change it on other codes in the future

      Comment


        #4
        Hello durdcash,

        Thanks for your notes.

        I am not aware of an easier workaround for managing your exits when the session is closed/halted during that time.

        I would agree that the best course of action would be to add the time constraints you mentioned to make sure the time is not between 8:29-9:31 when the session is closed/halted to handle your orders.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          NinjaTrader_BrandonH if for this type of code I changed to close[0] instead of getcurrent bid/ask could that be work around? I also just thought too of maybe adding a line of code where currentask needs to be greater than current bid as one of those conditions for that one? With how ninja trader code works, is there any issues you could foresee doing something like that? I know there's a chance it doesn't help or do anything but just want to make sure it wouldn't be code breaking and only find out when in a trade.

          Comment


            #6
            NinjaTrader_BrandonH the reason I also ask this is today I am seeing while session closed for ZS, bid is 1320 and ask is 1314. so today the bid is in my favor for the code and I don't think that will impact the logic. Hopefully!

            Comment


              #7
              Hello durdcash,

              Thanks for your notes.

              Checking for GetCurrentBid()/GetCurrentAsk() would be a good idea if you are wanting to compare the current bid or ask price instead of the Close price. This could possibly be a workaround but I could not say for certain without seeing the entirety of your strategy's code to know how it works.

              You could certainly give it a try and test it to see how the strategy behaves and if it suits your specific goals.
              <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Today, 05:17 AM
              0 responses
              51 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              127 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              69 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