Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to buy at the opening price at the instance of a new bar

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

    How to buy at the opening price at the instance of a new bar

    Hi team,

    I'm a newbie to NT8 and currently in the simulated platform.

    Would you please guide me on how i can place long/short orders at opening price instantly when a new bar forms?

    Currently i use the buy/sell limit by pointing to the new bar's opening price>right click>buy/sell limit.

    Eg: Say the green bar closes and (new)red bar forms. I would like to immediately short (sell limit) at it's opening price (11 451.5).
    My current ATM strategy is to stop loss= 24, profit= 8. (ticks)

    Click image for larger version  Name:	1.PNG Views:	0 Size:	5.8 KB ID:	1118368

    Currently, most of the time I'll miss the window for my strategy as it takes time to execute this.

    If you would be so kind to point out what options i have and how can I go about it?

    P.S : I'm new to scripting as well, so any baby steps would be greatly appreciated.

    Thank you.


    #2
    Hello Roy8888, thanks for your post.

    NinjaScript strategies can do a lot of things. Strategies can control every aspect of trading in the platform, so it's best to first understand how they work and what you want out of the strategy. Please first read through this post from our colleague Chelsea:



    A good place to start is the Strategy Builder. It can generate code for you and when you are ready to dive into how the script works on a code level, you can unlock the code. We have a few examples here in the Strategy Builder documentation:
    https://ninjatrader.com/support/help...on_builder.htm

    Protective Stop and Target orders can also be set from the "Stops and Targets" tab of the builder.

    Please let me know if I can assist any further.

    Comment


      #3
      Hi Chris,

      Thank you for the prompt reply. Just to give an idea on what I'm trying to do :

      Eg: I'm monitoring using a box bar & a chart.

      Whenever the charts shows a cross, and a (new)bar (red/green) forms :

      Click image for larger version  Name:	2.PNG Views:	0 Size:	2.4 KB ID:	1118428

      Click image for larger version  Name:	1.PNG Views:	0 Size:	5.8 KB ID:	1118427
      I would like to immediately short (sell limit) at the red bar's opening price (11 451.5).
      My current ATM strategy is to stop loss= 24, profit= 8 (ticks)

      The same applies for long scenarios.

      If possible would you mind sharing an working example on the above using the Strategy Builder (esp Conditions and Actions)?
      Any would do, as i can move on from there.

      Thank you!
      Last edited by Roy8888; 09-15-2020, 11:25 PM.

      Comment


        #4
        Hello Roy8888, thanks for your reply.

        We have existing examples of setting up a cross condition. The one linked here from the Strategy Builder tutorial is a CrossAbove condition for two EMAs of period 9 and 20, you would want to check for a CrossBelow for a short order.



        To submit a sell order at the open (we are assuming the open price is greater than the closing price), select "Submit short position by a limit order" from the Actions.

        Best regards,
        -ChrisL

        Comment


          #5
          Hi Chris,

          Thank you so much for this. I shall look into it and give it a try and get back to you.

          Cheers!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          87 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          132 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          65 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          118 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          67 views
          0 likes
          Last Post PaulMohn  
          Working...
          X