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 yertle, Today, 08:38 AM
    6 responses
    24 views
    0 likes
    Last Post ryjoga
    by ryjoga
     
    Started by algospoke, Yesterday, 06:40 PM
    2 responses
    24 views
    0 likes
    Last Post algospoke  
    Started by ghoul, Today, 06:02 PM
    3 responses
    16 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by jeronymite, 04-12-2024, 04:26 PM
    3 responses
    46 views
    0 likes
    Last Post jeronymite  
    Started by Barry Milan, Yesterday, 10:35 PM
    7 responses
    23 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Working...
    X