Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simple Breakout Strategy build - help required

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

    Simple Breakout Strategy build - help required

    Hello there, I am trying hard to make it by myself through the Wizard Strategy builder but I am failing in it, and I really need to make this simple strategy to work because my emotions are failing me so hard but the manual back-test data is so encouraging for this strategy.
    So, I have an Open Range indicator that automatically plots the High and the Low lines for the first hour of trading between 9:30 and 10:30 AM New York Time. I want to 2 entries per DAY long or short 2 contracts in total with separate Take profits but same level of Stop Loss (which is the 50% of the Range). Take profit 1 is always + 50% of the Range from entry, and Take profit 2 is always +100% Range from entry. When Take profit 1 is hit for the 1st contract, the second contract has to go to Break even and then either it hit my TP2 or it goes back to BE.
    I managed to make the strategy place the trade at the correct time and price level, but after it close the first entry it re-enter again and I don't want that....I hope someone will help me with this simple strategy....

    #2
    Hello MrZ_007,

    Thanks for your post.

    You could consider incrementing an int variable to use as a counter when a trade is placed and using a bool to control when trades should be placed. For example, you could increment the counter by 1 when 1 trade is placed and increment the counter by 1 again when the second trade is placed. In your conditions to place the trade, you could check if your bool is true. Once the counter equals a value of 2, you could set the bool to false. This means trades would only be placed when the bool is true and the bool will be set to false when the counter is equal to 2, preventing further trades from being placed.

    Note that implementing a counter in your script would be considered C# education since it is not NinjaScript specific code. You could do a Google search for something like 'Use counter C#' to find more information about this topic.

    It would be up to you to implement custom logic/math in your script to calculate the profit target and stop loss levels that you mentioned.

    An example of implementing a breakeven feature in a strategy could be found on the forum page linked below.
    https://ninjatrader.com/support/foru...der#post806596

    If the strategy is re-entering a trade, this means the condition to place the trade is true. A bool could be used to control when trades are placed, similar to the explanation above.

    This forum thread will be open for other community members to share their insights on this topic as well.

    Let me know if I may assist further.

    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    64 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    139 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    75 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X