Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to automate a breakout of a candle

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

    How to automate a breakout of a candle

    Hi to everyone,

    I am completely new at this forum and completely new with the programming of ninjascript.

    In advance thank you very much for your help and support.

    I am looking for a solution to automate the following strategy:

    Setup:
    - I want to trade the breakout of a specific candle (9.00 am) every day in the instrument KC
    - only 1 trade per day
    - 1 tick above the high or 1 tick below the low I want to create a OCO order (long and short)
    - once the trade (long or short) is triggered I want to have a fixed Stopp of 40 ticks
    - the trade will be closed automatically 5 minutes before the market closes

    Would you please be so kind and give me some advice how to start and what kind of code is needed to create this strategy in NT7.

    Thank you very much and best regards,


    Jan

    #2
    Hello Jan,

    Thank you for your post.

    Instead of using OCO you could just use a condition that looks for the last price to exceed the High of the 9 AM bar by one tick and then enter long via a market order, and of course the opposite for the short entry.

    Using ExitOnClose and ExitOnCloseSeconds you can set when to exit the trade before the close of the day.

    I would recommend beginning with our Automated Strategy Development webinar recording at the following link: https://youtu.be/MaaqCBoqYxI

    Then review our documentation on developing strategies: http://www.ninjatrader.com/support/h...strategies.htm

    Please let me know if you have any questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    558 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    545 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X