• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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.
    https://ninjatrader.com/support/help.../calculate.htm

    As well as a public link to a video that describes this behavior.
    https://youtu.be/HCyt90GAs9k?t=6m35s

    As well as a link to a forum post with helpful information about getting started with NinjaScript.
    http://ninjatrader.com/support/forum...609#post503609
    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.
        https://ninjatrader.com/support/foru...php?linkid=697
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by superg3, Today, 12:33 AM
        0 responses
        3 views
        0 likes
        Last Post superg3
        by superg3
         
        Started by vppzepuq, Yesterday, 11:28 PM
        0 responses
        1 view
        0 likes
        Last Post vppzepuq  
        Started by Steve L, 05-25-2019, 10:04 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by mestril, 05-25-2019, 10:22 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by hir04068, 05-25-2019, 09:29 PM
        7 responses
        21 views
        0 likes
        Last Post hir04068  
        Working...
        X