Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Condition Check for Squeeze

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

    Condition Check for Squeeze

    I need help in coding the conditions in a squeeze indicator.
    I'm able to add the indicator using State.DataLoaded. I want to check for the following conditions:
    For long entry, the positive histogram must be 5 or higher, and for short entry, the negative histogram must be -5 or lower.
    Can you please help?
    Thanks.

    Click image for larger version

Name:	image.png
Views:	136
Size:	3.4 KB
ID:	1274408​

    #2
    Hello givemefood,

    Thanks for your post.

    Is the indicator one that you created yourself or is it from a third-party developer?

    Or, did you get the indicator from the Ecosystem User App Share? If so, please share the link to the indicator with me so I may look at it's code.

    Are the bars in the screenshot you shared made by a plot that is added to the indicator script using the AddPlot() method?

    If so, you could create a condition that checks if the indicator plot value is greater than or equal to 5 or if the indicator plot value is less than or equal to -5.

    If the indicator calls the AddPlot() method, you could set up your conditions in the Strategy Builder and click the 'View code' button to see the generated syntax for how the conditions are coded.

    Strategy Builder Conditions: https://ninjatrader.com/support/help...on_builder.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


      #3
      Hi,

      I downloaded the indicator from https://ninjatraderecosystem.com/use...tum-indicator/
      The bars are from the indicator.
      If I can generate the code from strategy builder, I want to know what to pick in Conditions under the left column and right column. That's what I am struggling with.
      Appreciate the help.
      Thanks.

      Comment


        #4
        Hello givemefood,

        Thanks for your notes.

        The 'SqueezeDef' plot in the indicator are the bar plots that you see on the chart when then indicator is running.

        You could create a condition that checks if the 'SqueezeDef' plot of the indicator is greater than or equal to 5 and call EnterLong() to place a Long entry order.

        To place a short entry order, you could create a condition that checks if the 'SqueezeDef' plot of the indicator is less than or equal to -5 and call EnterLong().

        Attached is a screenshot of what the long entry condition might look like in the Strategy Builder.

        See the 'How to make indicator to value comparisons' section of this help guide page for more information: https://ninjatrader.com/support/help...on_builder.htm
        Attached Files
        <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
        20 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        119 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
        45 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X