Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Building using Hammers and Shooters

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

    Strategy Building using Hammers and Shooters

    Hey All-

    I am new to NT8 and wanted to create an automated trading strategy using the Strategy Builder. For starters I want to to go long on the candlestick following a hammer if/when the price goes one tick (trading MES) above the hammer's high.

    Can anyone help me please? I have been using the Conditions and Actions page but can't get it to work.

    Thank you!

    Nick

    #2
    Hello njmeyer713,

    Thanks for your post.

    In the screenshot you shared I see that you are checking if there was NOT a hammer on the previous bar.

    The CandleStickPattern indicator will return a 1 if the pattern is found and you are currently checking if the CandleStickPattern indicator is returning 0, meaning no pattern is found.

    You could instead create a condition that checks if the CandleStickPattern indicator is equal to 1 to determine if a pattern is found. You would also create a condition in the same set that compares the High price with a 1 Tick offset against the current Close price. Then, you would call an action to enter a position, such as EnterLong().

    See the help guide documentation below for more information.
    Strategy Builder Conditions: https://ninjatrader.com/support/help...on_builder.htm
    Strategy Builder Actions: https://ninjatrader.com/support/help...t8/actions.htm
    CandleStickPattern: https://ninjatrader.com/support/help...ickpattern.htm

    Let us know if we 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


      #3
      Brandon,

      Thank you for the response. I'm still having some trouble. Please see the attachments.

      First, have I got the Hammer Candlestick pattern correct?
      Second, I am not quite sure how to get the High Price with a 1 tick offset condition you suggested in your previous reply. See attachment on what I have tried.
      Third, when I enable the strategy, the chart only identifies 5 Hammer patterns. While all of the hammers it identifies are hammers, there are quite a few that aren't identified that I would consider hammers. I am guessing that Ninjatrader might have a different strict definition of what a hammer is.
      Fourth, no trades are being made when I run the strategy. Probably has to do with the 2 conditions not being right.

      Thank you for the help,

      Nick

      Comment


        #4
        Hello njmeyer713,

        Thanks for your note.

        Yes, your current condition check for the CandleStickPattern is correct. Currently, you have this condition set up to check if the CandleStickPattern Hammer occurs on the bar prior to the currently forming bar.

        For the second condition check, you are checking if the current High price + 1 Tick is greater than or equal to the previous High price. If you would like to compare the current High price + 1 Tick against the current Close price, you would need to reference the current Close price (Close[0[) instead of the previous High price (High[1]).

        I am guessing that Ninjatrader might have a different strict definition of what a hammer is.

        This could certainly be the case. You could view the CandleStickPattern indicator's code to see how the CandleStickPattern indicator detects Hammer patterns. To view the script, open a New > NinjaScript Editor window, open the Indicators folder, and select the CandleStickPattern indicator.

        Ultimately, if the expected trade(s) are not appearing, this would indicate that the condition to place the order is not evaluating as true or the order is being ignored for other reasons.

        To understand why the script is behaving as it is, such as placing orders or not placing orders or drawing objects when expected, it is necessary to add prints to the script that print the values used for the logic of the script to understand how the script is evaluating.

        In the strategy add prints (outside of any conditions) that print the values of every variable used in every condition that places an order along with the time of that bar. Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).

        Also, enable TraceOrders which will let us know if any orders are being ignored and not being submitted when the condition to place the orders is evaluating as true.

        Below is a link to a forum post that demonstrates how to use prints to understand behavior.
        https://ninjatrader.com/support/foru...121#post791121

        Let us know if we 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
        56 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        133 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        73 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
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X