Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

One Entry per signal bar

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

    One Entry per signal bar

    Hello, I have searched through the forums seeing if I can find a solution without having to make a new thread. Though many of the problems i saw posted were about multiple entries within the same bar. I have created a signal bar and want to enter when the current candle closes below the low of the signal bar. Now no problems there, as it takes the trade and exits. The problem is it keeps using that same signal bar to take multiple trade entries instaed of just stopping until a new signal bar shows up.


    Example: Signal Bar shows up--> Current candle closes below signal bar---->Trade executes and reaches TP/SL.(as expected) --> Trade keeps executing using the same signal bar until a new one shows up.(Don't want)

    I would think the logic would be something like" Only one trade per signal bar"

    I am using strategy builder but not opposed to unlocking the code if need be.


    Thank you for your help and taking the time to read this.




    #2
    Hello jordanq2,

    Thanks for your post.

    Trades would be placed by the strategy if the condition to place the trade in your logic becomes true. If you are using Calculate mode of Calculate.OnPriceChange or Calculate.OnEachTick, it is possible that the condition to place the order could become true multiple times per bar.

    You could consider using Calculate.OnBarClose so that logic in your script processes only at the close of each bar.

    Calculate: https://ninjatrader.com/support/help.../calculate.htm

    Further, a bool variable could be used to control when trades are placed by the script. For example, you could create a bool variable on the Inputs and Variables screen of the Strategy Builder (initially set to true). You could create a condition that checks if the Position.MarketPosition (Strategy folder > Current market position) is equal to MarketPosition.Flat (Strategy folder > Market position > Flat) and set the bool to true. Then, in your condition to place the Entry order, add a condition that checks if the bool (Misc folder > User variables > <variable name>) is equal to true (Misc folder > true). After calling the Entry order method, create an action to set the bool to false.

    By doing so, the Entry order would only be placed when the bool is true and the bool would only be true when you are in a flat market position.

    See the help guide documentation below for more information.

    Builder Screens: https://ninjatrader.com/support/help...er_screens.htm
    Conditions: https://ninjatrader.com/support/help...on_builder.htm
    Actions: https://ninjatrader.com/support/help...t8/actions.htm

    <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, Today, 05:17 AM
    0 responses
    25 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    120 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    63 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    41 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X