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

Script for entry on Next bar Open

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

    Script for entry on Next bar Open

    Hello Ninja Traders. I was curious if anyone has or knows how to create a script where you can enter a position once the current bar closes and the next opens. I will like the order to be executed on the opening price of this next bar.

    If anyone has an idea how to create this in the strategy builder or has sample code it would really be appreciated. Thank you!!!!!

    #2
    Hello hsnyc,

    By default this is how a script will work.

    Calculate by default is set to 'On bar close'.

    Below is a public link to the help guide on Calculate.


    As well as a public link to a video that describes this behavior.


    As well as a link to a forum post with helpful information about getting started with NinjaScript.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you Chelsea. I am new to the platform and my goal is to program a button, that when pressed it will execute a buy order if the following conditions are met.
      1. Wait until the current bar closes.
      2. Once the current bar closes, check if the close price of that bar is greater than the open.
      3. If it is greater than the open, then buy the open price of the next candle.

      I am using a Renko chart. Ideally I will like to program that script into a UI button so that it is activated upon a click.


      I am a really new trader with NT8. So, if you can provide a link to a resource where this is shown in a step by step manner (if it exist) if not then any extra details on this would be greatly appreciated.

      Thank you so much for your help.

      Comment


        #4
        Hello hsnyc,

        I recommend starting with the training videos linked in the 'getting started with NinjaScript' link.

        Adding buttons is advanced and cannot be done with the Strategy Builder.
        Below is a public link to an example of adding a button.

        Your button could set a bool to true. Then when OnBarUpdate updates if the bool is true the order is placed and the bool is set back to false.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        3 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        18 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        1 view
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        9 views
        0 likes
        Last Post Javierw.ok  
        Started by timmbbo, Today, 08:59 AM
        2 responses
        10 views
        0 likes
        Last Post bltdavid  
        Working...
        X