Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 bmartz, 03-12-2024, 06:12 AM
          4 responses
          31 views
          0 likes
          Last Post bmartz
          by bmartz
           
          Started by Aviram Y, Today, 05:29 AM
          4 responses
          11 views
          0 likes
          Last Post Aviram Y  
          Started by algospoke, 04-17-2024, 06:40 PM
          3 responses
          28 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by gentlebenthebear, Today, 01:30 AM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by cls71, Today, 04:45 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X