Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Chris L.NinjaTrader Customer Service

    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
        Chris L.NinjaTrader Customer Service

        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 mjairg, 07-20-2023, 11:57 PM
          3 responses
          213 views
          1 like
          Last Post PaulMohn  
          Started by TheWhiteDragon, 01-21-2019, 12:44 PM
          4 responses
          544 views
          0 likes
          Last Post PaulMohn  
          Started by GLFX005, Today, 03:23 AM
          0 responses
          3 views
          0 likes
          Last Post GLFX005
          by GLFX005
           
          Started by XXtrader, Yesterday, 11:30 PM
          2 responses
          12 views
          0 likes
          Last Post XXtrader  
          Started by Waxavi, Today, 02:10 AM
          0 responses
          7 views
          0 likes
          Last Post Waxavi
          by Waxavi
           
          Working...
          X