Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

using alerts in Strategy Builder

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

    using alerts in Strategy Builder

    Hello,

    Is it possible to call alerts that you have made into Strategy Builder?

    Or, is it possible in Strategy Builder to have a prebuilt strategy execute off a drawn line on chart?

    --------------------------------
    -the point is to be able to draw a ray on chart
    -if price touches ray, strategy builder script executes
    -strategy builder confirms if other parameters are correct like...
    -It should reset as soon as round trip on order is completed
    -it should not open a position if if there is open posiiton

    because of the needs I have, I can't simply execute a trade off the alert only

    #2
    Hello George21,

    Thanks for your post.

    Yes, it is possible to call an Alert action in the Actions section of the Strategy Builder. This will be a new alert you need to create in the Strategy Builder and you cannot select an alert made outside of the Strategy Builder. Also, note that Alerts in the Strategy Builder are only able to be used in the Actions section. You would not be able to use this alert for Conditions in your strategy.

    Yes, it is also possible to draw a line on the chart using the Strategy Builder. Note that you cannot detect manually drawn lines on the chart using the Strategy Builder. This would require you to unlock the strategy from the Strategy Builder window and manually code this yourself. See the attached sample that demonstrates detecting manually drawn objects on a chart.

    You could use a boolean in the logic of your strategy to control when trades are placed. You could create a bool named something like OkToTrade (initially set to false). You would create your order entry condition and set the bool to true. Then you would check if the bool is true and call your entry order method and set the bool to false.

    By doing this, the order entry method will only be called to place an order when the bool is true. When the bool is false, the order entry condition will not be called so the strategy will stop placing trades until the bool becomes true. See the attached example script demonstrating using a bool to control trades made by a strategy.

    If you would like the strategy to only place an order when you are in a flat position, you could include a Position.MarketPosition check in the order entry conditions of your strategy. For example, if you would like to place a long order when in a flat position, you could create a condition that checks if Position.MarketPosition == MarketPosition.Flat and call an action of EnterLong().

    See the help guide documentation below for more information.
    Conditions: https://ninjatrader.com/support/help...on_builder.htm
    Actions: https://ninjatrader.com/support/help...t8/actions.htm
    Alert: https://ninjatrader.com/support/help.../nt8/alert.htm
    DrawObjects Collection: https://ninjatrader.com/support/help...rawobjects.htm
    Position.MarketPosition: https://ninjatrader.com/support/help...etposition.htm


    Let us know if we may assist further.
    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


      #3
      Thanks for the informative reply.

      I have a question about this part that you said...
      "Yes, it is also possible to draw a line on the chart using the Strategy Builder. Note that you cannot detect manually drawn lines on the chart using the Strategy Builder. This would require you to unlock the strategy from the Strategy Builder window and manually code this yourself. See the attached sample that demonstrates detecting manually drawn objects on a chart.".

      When you say unlock Strategy Builder, do you mean manually coding the strategy to look for input variables from the drawn ray because Strategy Builder can't do that?

      Comment


        #4
        Hello George21,

        Thanks for your note.

        That is correct. The Strategy Builder would be able to draw objects on a chart. However, a limitation of the Strategy Builder is that it cannot detect manually drawn objects on a chart, and drawing objects cannot be used for Conditions in the Strategy Builder.

        You would need to unlock the strategy from the Builder and manually program the strategy in a NinjaScript Editor window.

        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, Today, 05:17 AM
        0 responses
        44 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        124 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        65 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 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