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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    59 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    143 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    161 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    97 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    283 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X