Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Find this type of Candles

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

    Find this type of Candles

    Hello, I´d like to program a strategy that triggers when this candle is forming.

    How can I limit the pips between the close and the open ?

    So as example when close is greater then open (but only if its less then 1 pip) , then condition xy.

    I´d like to find this cross candle types.
    Attached Files

    #2
    Hello Uregon,

    What you described would require using math. Your condition would be if the close is greater than open and then if (Close[0] - Open[0]) > 0 && (Close[0] - Open[0]) < (2 * TickSize) for example. That would check that its a positive amount and that the amount is less than 2 ticks.

    Comment


      #3
      NinjaTrader_Jesse Thank you. This is what I made:

      // set 1
      if (HeikenAshi81.HAClose[0] >= (HeikenAshi81.HAOpen[0] + (1 * TickSize)) )
      {
      CandleOutlineBrush = Brushes.Yellow;
      }​

      and this happens:
      Click image for larger version

Name:	grafik.png
Views:	159
Size:	4.7 KB
ID:	1334310

      As you can see I made a cross form candle highlighted yellow but also the big ones and thats the issue

      Comment


        #4
        What do I need to setup ?

        Comment


          #5
          Hello Uregon,

          You would need to use a Print and see what the calculated values are and then compare that to the manually calculated values you made. That would let you know what part of the condition you need to adjust.

          Comment


            #6
            NinjaTrader_Jesse

            Hello Jesse, please tell me more about what to print ? Do you mean to print a text to see the output ?

            Comment


              #7
              Hello Uregon,

              In the code you provided that would be the two values you are using in the condition.

              Print(HeikenAshi81.HAClose[0] + " >= " + (HeikenAshi81.HAOpen[0] + (1 * TickSize)));

              That would let you see what values you are comparing to know why the condition was true.




              ​​​​​​​

              Comment


                #8
                NinjaTrader_PaulH

                You are the creator of this script HeikenAshi8

                I hope you can help me.

                I just like to filter out Doji candles in XAU/USD

                So make every candle yellow where the price is maximum 0,10 greater or lower then the close price

                I´m very confused with the offset settings actually.

                I work with strategy builder only, can you send me a finished strategy from your side ?

                Comment


                  #9
                  Information:
                  Attached Files

                  Comment


                    #10
                    Hello Uregon,

                    While we cannot make items for you you can create it yourself or hire someone to make it for you.

                    You can contact a professional NinjaScript Consultant who would be eager to assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our NinjaTrader Ecosystem team to follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request or provide one-on-one educational/debugging services.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by argusthome, 03-08-2026, 10:06 AM
                    0 responses
                    55 views
                    0 likes
                    Last Post argusthome  
                    Started by NabilKhattabi, 03-06-2026, 11:18 AM
                    0 responses
                    37 views
                    0 likes
                    Last Post NabilKhattabi  
                    Started by Deep42, 03-06-2026, 12:28 AM
                    0 responses
                    17 views
                    0 likes
                    Last Post Deep42
                    by Deep42
                     
                    Started by TheRealMorford, 03-05-2026, 06:15 PM
                    0 responses
                    19 views
                    0 likes
                    Last Post TheRealMorford  
                    Started by Mindset, 02-28-2026, 06:16 AM
                    0 responses
                    49 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Working...
                    X