Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

New to Programming Strategies in NT -- A Few Questions

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

    New to Programming Strategies in NT -- A Few Questions

    First off, I'm starting to learn C# and I've found this thread quite a helpful starting point. Thanks for all the NT user guides.

    I have a few general questions about the possibilities of coding certain things or even getting them set in the strategy wizard. Just yes or no to these 3 questions is fine, or explain further if you wish:

    1) Is there a way to submit an order if price tests your moving average?

    2) Is there a way to submit an order if price tests a trendline that an indicator creates?

    3) Can you set conditions in the strategy wizard to something along the lines of, "if this thing (for example, a rising moving average) on this particular higher timeframe chart is true, then.." So basically, if I was using the strategy on a 5k tick chart, could it have a condition on the 10k tick?

    ----

    A few other questions:

    1) How feasible is it to program ninjascripts to detect certain price patterns, such as 3 push wedges, or double tops, etc.?

    2) What about signal bars, such as the popular reversal bar (a bull reversal bar being one with a tail on the bottom that reverses price with a bull body on top, etc.)?

    3) In the wizard, is there a way to input one of your existing ATM strategies into the Stops and Targets section?

    #2
    Hello,

    Thank you for the questions.

    For #1, yes you can test if a price is equal to another pre-defined price, greater than or less than. you also can check in a period of bars if there was a cross above or cross below event, also you can check if the price is rising or falling.

    #2 would be the same as #1, there is no detection for the line its self but the data that produces the line can be checked. You can compare a price to a certain bars price to determine if a price has touched or crossed that value.

    #3. There is the ability to create multi time frame strategies. Essentially you would add additional data series to the strategy, this does change the structure and syntax that you will use slightly as you need to specify which dataseries you are getting data from. There are examples of this installed in NinjaTrader, this would be the SampleMultiTimeFrame strategy.

    For your other questions, #1 and #2 are both possible this would depend on the logic you create to detect these types of changes.

    #3, unfortunately there is no way to use the wizard for this, although you can access ATM strategies from an unlocked strategy. Unlocking a strategy removes the wizard and puts you into a manual coding environment. There is an example for this as well called SampleAtmStrategy that comes with NinjaTrader.

    Please let me know if I may be of additional assistance.

    Comment


      #3
      2) Is there a way to submit an order if price tests a trendline that an indicator creates?
      Hi Illusion

      May I suggest that you may like to look at the LineAlert indicator (available, I think, in the Forum downloads section). You can get alerts off this or even trade off it by tweaking the code.

      Also, it's possible to code up an indicator in which you'd just enter the price and bar # of the end points of a straight line and, as with line alert, you can trade or get alerts off it.

      Please let me know if you need any help with the math to do this.

      Best of luck with your forays into C#!

      Comment


        #4
        Thanks Jesse, and thanks arbuthnot! I love being around people who know way more than I do about this stuff! I may look into the trendline indicator later when I really want to get my hands dirty. Right now I am trying to make a strategy based on my price action knowledge work straight from the wizard. I am trying to create a swing trading automated strategy while I manually scalp discretionary style all day. I have been tweaking it over the past few days -- the trickiest part in my opinion is trying to avoid getting too many trades entered into overlap that destroy your swing before it gets a chance to go.

        Can someone help me understand how to look at slippage realistically in your strategy? The strategy that I have seems to go from good to bad when slippage is set from 0 to 1. Is a good strategy one that can profitably handle slippage set to 1? Any thoughts on this are appreciated.

        Here are my results so far:

        Slippage at 0


        Slippage set to 1

        Comment


          #5
          Originally posted by lllusion View Post
          Thanks Jesse, and thanks arbuthnot! I love being around people who know way more than I do about this stuff! I may look into the trendline indicator later when I really want to get my hands dirty. Right now I am trying to make a strategy based on my price action knowledge work straight from the wizard. I am trying to create a swing trading automated strategy while I manually scalp discretionary style all day. I have been tweaking it over the past few days -- the trickiest part in my opinion is trying to avoid getting too many trades entered into overlap that destroy your swing before it gets a chance to go.

          Can someone help me understand how to look at slippage realistically in your strategy? The strategy that I have seems to go from good to bad when slippage is set from 0 to 1. Is a good strategy one that can profitably handle slippage set to 1? Any thoughts on this are appreciated.

          Here are my results so far:
          A winning strategy is not +$800.

          You are not even above the curve in either situation, just break even or less.



          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          649 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          370 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          109 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          573 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          576 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X