Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Execute order when price retraces

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

    Execute order when price retraces

    Hello everybody,

    I'm sorry for my English, if you don't understand something tell me and I'll try to explain myself better.

    The thing is that I am trying to create a strategy with the Strategy Builder, and I am not able to do it. What I am trying to do is that when there is a VOL "X" in a candle and this is below an EMA "Y", when the price retraces and crosses the EMA I make a SHORT entry, and vice versa when it is above the EMA I make a long.

    Any help? Thank you.

    #2
    Hello PEPSAM,

    Thanks for writing in.

    To clarify, are you wanting to check if there is a certain number of Volume in the script?

    If so, you could create a condition that compares the Volume (Price folder > Volume) to a numerical value (Misc folder > Numerical value). Or, you could create a condition that compares the VOL indicator (Indicators folder > VOL) to a numerical value (Misc > Numerical value).

    Are you also you wanting to detect if the current price crosses above/below the EMA indicator plot and place an order?

    If so, you could create a crossover condition that compares the current Close price (Price folder > Close) to the EMA indicator plot (Indicator folder > EMA). Then, you could call something like EnterLong or EnterShort to enter a long or short position.

    See this help guide documentation below for more information about creating crossover conditions: https://ninjatrader.com/support/help...sOverCondition

    Also, see the help guide documentation below.
    Conditions: https://ninjatrader.com/support/help...on_builder.htm
    Actions: https://ninjatrader.com/support/help...t8/actions.htm

    Here is a link to our publicly available training video, 'Strategy Builder 301', for you to view at your own convenience.

    Strategy Builder 301 — https://www.youtube.com/watch?v=_KQF2Sv27oE&t=13s

    I am also linking you to the Educational Resources section of the Help Guide to help you get started with NinjaScript:
    https://ninjatrader.com/support/help..._resources.htm

    Note that in the support department at NinjaTrader it is against our policy to create, debug, or modify, code or logic for our clients. Further, we do not provide C# programming education services in our support. This is so that we can maintain a high level of service for all of our clients as well as our partners.

    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. If you would like our NinjaTrader Ecosystem team follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request, please write into vendorsupport[AT]ninjatrader.com.

    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
      Hello and thank you very much for the reply.

      What you are telling me is how far I have gone, i.e. can I set the input conditions; volume level, ema crossover, etc. What I can't get it to run separately, and I explain.

      Suppose that at 15:00 a candle is created with a volume of 10, which is optimal for me, but the price is below the EMA of 10, then I want that when the price crosses the EMA of 10, let's say at 15:15, a sale is executed, and in the case of being above the EMA a long is executed.

      I think I have explained myself better now.

      Comment


        #4
        Can you provide me with a list of affiliated consultants?

        Comment


          #5
          Hello PEPSAM,

          Thanks for your note.

          Something you could consider is creating a bool (initially set to false). Create a condition that compares the Volume to a numerical value and checks if the price is less than the EMA and flip the bool to true. Then, you could create another condition for your order entry that checks if the current Close price crosses above the EMA and checks if the bool is true and calls an action such as EnterLong to place an order.

          In the NinjaScript Support / Platform Support department we are not able to provide a list of affiliated consultants. For a list of affiliated consultants, please contact VendorSupport[AT]ninjatrader.com.

          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


            #6
            Thanks, I'll try it and let you know.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            55 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            132 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