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:	210
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 charlesugo_1, 05-26-2026, 05:03 PM
                    0 responses
                    67 views
                    0 likes
                    Last Post charlesugo_1  
                    Started by DannyP96, 05-18-2026, 02:38 PM
                    1 response
                    150 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by CarlTrading, 05-11-2026, 05:56 AM
                    0 responses
                    162 views
                    0 likes
                    Last Post CarlTrading  
                    Started by CarlTrading, 05-10-2026, 08:12 PM
                    0 responses
                    99 views
                    0 likes
                    Last Post CarlTrading  
                    Started by Hwop38, 05-04-2026, 07:02 PM
                    0 responses
                    287 views
                    0 likes
                    Last Post Hwop38
                    by Hwop38
                     
                    Working...
                    X