Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to short when Previous Close < Open and vice versa

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

    How to short when Previous Close < Open and vice versa

    Hi there,

    I am really new to designing strategies with the Strategy Wizard.


    I am trying to have a condition that sends a short with a limit order at the open at 9h30 if Yesterdays close was less than the open at 9h30.




    and vice versa if Yesterdays close was higher than the morning open then initiate a long position on with a limit


    I do not know how to code unfortunately.


    Thank You!

    #2
    Hello,

    Thank you for the question.

    I would like to ask if you had seen the video on the strategy wizard yet?

    We have one on our youtube channel that outlines a good amount of the features and shows how to use them.

    Here is a link: https://www.youtube.com/watch?v=Maaq...DD7105&index=1

    For what you are trying to do you would need to do a condition in a set so set1 for example. this condition checks if the current bars time is equal to or greater than the time. It depends on your calculateOnBarClose setting and chart type on how often this would get checked so you would want to check in a valid time range around the time you are aiming for.

    After checking the time you would need to check if the PriorDayOHLC indicators close was greater or less than the CurrentDayOHL indicators open.

    if so enter your limit order.

    Please let me know if I may be of additional assistance.

    Comment


      #3
      Thank You for your answer.

      Yes, I have watched the introductory video on automated strategies, which I find is useful for very basic conditions.


      However, I am attempting to 'Go Long' when the close on the ES at 17h15 is higher than the open at 9h30. Thats what I am really trying to do.

      This condition is not meant to place an order, but to determine bias for placing an order (ie go long go short).


      I am not looking for a time range but more for a comparison of previous bar's close, to current bar's open, which is tricky since the model is based on the 1min chart.


      Perhaps we could have a join me session sometime.


      Thanks.

      Comment


        #4
        It depends on your calculateOnBarClose setting and chart type on how often this would get checked so you would want to check in a valid time range around the time you are aiming for.
        Yes I have this checked off under the "description" box.





        After checking the time you would need to check if the PriorDayOHLC indicators close was greater or less than the CurrentDayOHL indicators open.
        How do I check this? I need to set a condition for this?

        if so enter your limit order.

        Please let me know if I may be of additional assistance.

        Comment


          #5
          Hello,

          Thank you for the questions.

          However, I am attempting to 'Go Long' when the close on the ES at 17h15 is higher than the open at 9h30. Thats what I am really trying to do.
          For this there is a condition, if the market open is 9:30 defined by the instruments session template you can check the CurrentDayOHL indicators open value. If this time is not the session open but rather a time after the open you have determined that you want to get the value of that would work differently.

          Assuming this is the session market open price you can check the CurrentDayOHL indicator value.

          For example in Set1 as a condition,
          Select Time -> TimeSeries on the left and a bars ago to 0, == in the middle and Time -> TimeValue on the right. For the TimeValue enter the target close time you want to check the open.

          This will set in action the events at the specified time, but you also wanted to compare if the current bars close is higher than the open.

          Add another condition, this time add the following:
          On the left select Indicators -> CurrentDayOHL
          Make sure the Plot is set to CurrentOpen
          in the middle select greater than
          on the right select Price Data -> Close with a bars ago of 0 for the current bar.

          This would check if the closing time is reached and if the closing price is greater than the open of the current day do whatever you want.


          I am not looking for a time range but more for a comparison of previous bar's close, to current bar's open, which is tricky since the model is based on the 1min chart.
          If you are looking for the previous bars close simply use Price Data -> Close -> Bars ago set to 1.


          If you would like remote assistance please contact platformsupport @ ninjatrader.com

          Please let me know if I may be of additional assistance.

          Comment


            #6
            If you are looking for the previous bars close simply use Price Data -> Close -> Bars ago set to 1.
            Ok if I am comparing the open at 9h30 to the close at 17h15 (remember there is an overnight session), I would set 'Bars ago' to 975?


            Which means 975 mins elapsed from 17h15 to 9h30?


            Thanks for the great detailed answer.

            Comment


              #7
              Hello,

              I just want to check and make sure I am on the same page. The Close you are referring to is yesterdays close at 17:15 and the open is the current days open at 9:30am correct?

              If you want to calculate the amount of bars in-between the two times you could, If you are trying to compare the prior days close to the current days open you could instead use the indicators that do this for you.

              You would need to compare the CurrentDayOHL's currentOpen against the PriorDayOHLC priorClose price.

              This would compare Today's open price with yesterdays close and go by the session that is defined by the instrument that way you don't have to specify an exact minute count in between the two.

              doing things by the instruments session prevents you from having to modify time variables in the case that you were to use this on a different symbol that opens and closes at different times.


              Please let me know if I may be of additional assistance.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              71 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              43 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              25 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              28 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              56 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X