Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to use a Moving Average as a Stop with the Strategy Builder

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

    How to use a Moving Average as a Stop with the Strategy Builder

    Hello. I am using a basic moving average crossover system with the Strategy Builder.

    Can someone please help me with creating a Stop for this system when price touches a Moving Average?

    I would like to use the Strategy Builder vs. unlocking the code.

    So, upon entry, it will stay in the trade as long as price is above the Moving Average. Once it touches it, then stops out.

    Thank you!!!!!​​
    Last edited by geotrades1; 04-03-2024, 10:44 AM.

    #2
    Hello geotrades1,

    To submit a stop at a custom price you would need to use logic similar to the breakeven sample in the following link. You would need a variable to hold the stop price that you calculate and a set to submit the order on each bar until it is filled.



    Alternatively you would need to just use an exit order in your condition checking if the price touches the moving average, that would only require 1 condition set and the exit order.

    Comment


      #3
      Hi Jesse. Thanks for getting back!

      Since, I am not that familiar with coding, I like your 2nd example.

      Can you tell me how I would do that?

      Thanks!

      Comment


        #4
        Hello geotrades1,

        To do that you would need to make a new set with a condition checking if the Price -> Close is less than or equal to the indicator plot and as the action in that set you would select Exit Long. You can additionally add a condition checking if the current market position is flat to avoid trying to exit when there is no position. You can see how to make a market position condition here: https://ninjatrader.com/support/help...ionComparisons


        Comment


          #5
          Hi Jesse. That worked great. Thank you!!!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          48 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          126 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          66 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