• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy condition to enter a trade when an indicator changes direction

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

    Strategy condition to enter a trade when an indicator changes direction

    Perhaps it's already answered, but I didn't see it, but I am looking to code a strategy builder with a condition to enter long when an indicator changes direction from down to up, and vice versa for a short. So if the indicator's current value > prior value , and the prior value < prior value two bars ago, this is a change in direction from negative to positive. Does something exist to call this out and how is this best applied to the strategy builder? Thank you

    #2
    Hello Binarytrader,

    Thank you for your post.

    Yes, that is a fairly simple thing to create in the Strategy Builder. You will need two sets of conditions, one to trigger the short trades, and one to trigger the long. I've put together a simple example strategy using the SMA indicator, however, you could modify this to use the indicator of your choice.

    Here is a basic guideline of how to import and view this strategy in NinjaTrader 8:

    To Import:
    1. Download the attached file to your desktop, keep it in the compressed .zip file.
    2. From the Control Center window select the menu Tools &gt; Import &gt; NinjaScript Add-on...
    3. Select the downloaded .zip file
    4. NinjaTrader will then confirm if the import has been successful.
    Critical - It will prompt that you are running newer versions of @ SMA and ask if you want to replace, press 'No'

    Once complete, you can view the strategy in the Strategy Builder by opening a new Strategy Builder window and selecting the ExampleChangeDirection strategy from the dropdown.

    Here's a link to our help guide regarding building conditions in the Strategy Builder:
    https://ninjatrader.com/support/help...on_builder.htm

    Please let us know if we may be of further assistance to you.
    Attached Files
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Thank you Kate. This is perfect!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Johnny Santiago, Today, 07:06 AM
      0 responses
      1 view
      0 likes
      Last Post Johnny Santiago  
      Started by HiddenPhilosopher, Today, 04:37 AM
      1 response
      20 views
      0 likes
      Last Post NinjaTrader_ChristopherS  
      Started by aprendiz, Today, 06:44 AM
      0 responses
      2 views
      0 likes
      Last Post aprendiz  
      Started by frankduc, Today, 06:35 AM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Jim  
      Started by Trexxx, Today, 06:34 AM
      0 responses
      2 views
      0 likes
      Last Post Trexxx
      by Trexxx
       
      Working...
      X