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 sjsj2732, Yesterday, 04:31 AM
    0 responses
    30 views
    0 likes
    Last Post sjsj2732  
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    286 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    282 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    132 views
    1 like
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    90 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Working...
    X