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

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 techgetgame, Yesterday, 11:42 PM
    0 responses
    8 views
    0 likes
    Last Post techgetgame  
    Started by sephichapdson, Yesterday, 11:36 PM
    0 responses
    2 views
    0 likes
    Last Post sephichapdson  
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,613 views
    0 likes
    Last Post aligator  
    Started by jaybedreamin, Yesterday, 05:56 PM
    0 responses
    9 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    20 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Working...
    X