• 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

Can someone help me create a simple candle stick patter indicator?

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

    Can someone help me create a simple candle stick patter indicator?

    I have it done in think or swim, but I don't know how to make one through ninja trader if someone can help.

    I'd like to have it notice a red , red, then green bar, where the green bar will be greater then the last red bar.
    Last edited by papayax999; 06-30-2020, 12:04 PM.

    #2
    Hello papayax999,

    Thank you for your note.

    Since bar colors are determined by whether the close is higher or lower than the open of the bar, this would be very simple to do in an indicator. I've put together a quick example of how this could be accomplished in an indicator that you can then modify as you wish. This indicator will simply print a dot over any up bar (green) that is preceeded by two down bars (red).

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

    Comment


      #3
      Originally posted by NinjaTrader_Kate View Post
      Hello papayax999,

      Thank you for your note.

      Since bar colors are determined by whether the close is higher or lower than the open of the bar, this would be very simple to do in an indicator. I've put together a quick example of how this could be accomplished in an indicator that you can then modify as you wish. This indicator will simply print a dot over any up bar (green) that is preceeded by two down bars (red).

      Please let us know if we may be of further assistance to you.
      Appreciate it! that helped a lot. How could i make this a strategy and say, whenever i have this arrow shown, purchase 1 tick above, and place a BRACKET order of 1 point profit, 2 point stop loss? and that order will only last for the next bar, after that, the order closes if it doesnt long or short.
      I attached a word with a photo for an example.
      Attached Files
      Last edited by papayax999; 06-30-2020, 08:48 PM.

      Comment


        #4
        Hello papayax999,

        Thank you for your note.

        To clarify, you're looking to enter one tick above the high of the green bar? You could certainly use the basic logic from the example indicator and put your entry logic inside that. Limit orders will be cancelled if they are not filled and the conditions for entry are no longer true, so it would be cancelled on the next bar if it hadn't filled and the original conditions aren't true anymore.

        So, you could do something like this in the OnBarUpdate in a strategy (I used a long limit since in the original indicator you enter if the last 2 bars were down bars and then there's an up bar:

        Code:
                protected override void OnBarUpdate()
                {
                    // check to make sure we have enough bars on the chart to check, if not, don't process
                    if (CurrentBar < 3)
                        return;
                    // if the open is greater than the close of the preceding two bars and the open is less than the close of the current bar
                    if (Open[2] > Close[2] && Open[1] > Close[1] && Open[0] < Close[0])
                    {
                        //this will draw a dot above the green up bar.
                        Draw.Dot(this, "Dot "+CurrentBar, true, 0, High[0] + (2*TickSize), Brushes.Goldenrod);
                        //this will place a limit order 1 tick above the high of the current bar
                        EnterLongLimit(High[0] + (1 * TickSize));
                    }
                }
        I would suggest trying the Strategy Builder to set up the code for you if you're not sure how to do so.

        Here's a link to our publicly available YouTube channel that goes over using the Strategy Builder to create simple strategies:

        Strategy Builder 301

        Also, here is a set of specific tutorials for creating conditions in the NinjaTrader 8 Strategy Builder in the NinjaTrader 8 help guide.

        Condition Builder

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

        Comment


          #5
          Originally posted by NinjaTrader_Kate View Post
          Hello papayax999,

          Thank you for your note.

          To clarify, you're looking to enter one tick above the high of the green bar? You could certainly use the basic logic from the example indicator and put your entry logic inside that. Limit orders will be cancelled if they are not filled and the conditions for entry are no longer true, so it would be cancelled on the next bar if it hadn't filled and the original conditions aren't true anymore.

          So, you could do something like this in the OnBarUpdate in a strategy (I used a long limit since in the original indicator you enter if the last 2 bars were down bars and then there's an up bar:

          Code:
           protected override void OnBarUpdate()
          {
          // check to make sure we have enough bars on the chart to check, if not, don't process
          if (CurrentBar < 3)
          return;
          // if the open is greater than the close of the preceding two bars and the open is less than the close of the current bar
          if (Open[2] > Close[2] && Open[1] > Close[1] && Open[0] < Close[0])
          {
          //this will draw a dot above the green up bar.
          Draw.Dot(this, "Dot "+CurrentBar, true, 0, High[0] + (2*TickSize), Brushes.Goldenrod);
          //this will place a limit order 1 tick above the high of the current bar
          EnterLongLimit(High[0] + (1 * TickSize));
          }
          }
          I would suggest trying the Strategy Builder to set up the code for you if you're not sure how to do so.

          Here's a link to our publicly available YouTube channel that goes over using the Strategy Builder to create simple strategies:

          Strategy Builder 301

          Also, here is a set of specific tutorials for creating conditions in the NinjaTrader 8 Strategy Builder in the NinjaTrader 8 help guide.

          Condition Builder

          Please let us know if we may be of further assistance to you.
          No, id look at entering 1 tick below the red bar, where the red arrow is pointing downward. I would place a short order 1 tick from the red bars low. I will take a look at this , appreciate it!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by digibob, Today, 03:45 AM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Jim  
          Started by waldoalvarez, Yesterday, 04:59 PM
          1 response
          15 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by jayfutures23, Today, 07:06 AM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Melissa  
          Started by MojoJojo, Today, 05:59 AM
          2 responses
          8 views
          0 likes
          Last Post MojoJojo  
          Started by Spark68, Yesterday, 07:48 PM
          1 response
          19 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Working...
          X