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

Doji Alert Indicator

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

    Doji Alert Indicator

    Hi, Is possible to create new to spot specific Doji. I dont know how to write a code, but may be someone can create new out of existing one and twick the code . So for bullish doji : Low of this Doji candle has to be lower than previous candle low. This doji should have long wick on bottom open and close are the same unchanged and these open and close have to happen in highest quarter of the candle and there shoud be small nose on top of that Doji. For bearrish vice versa. If you can help it would be great. Please let me know. Thanks

    Bullish Doji



    ​Bearish Doji

    #2
    Hello viklen,

    Thank you for your post.

    A doji forms when the open and close of a candle are equal (Open[0] == Close[0]).

    Open - https://ninjatrader.com/support/helpGuides/nt8/open.htm
    Close - https://ninjatrader.com/support/help.../nt8/close.htm

    You can use the Alert() method in your indicator to generate a visual or audible alert when your indicator's conditions are met.

    Alert() - https://ninjatrader.com/support/help.../nt8/alert.htm

    This thread will remain open for any community members who may want to assist in your request.

    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or 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 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 services.
    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      Hi Gaby, how can I code make sure it spots open =close only in the lowest quarter of the bar for bearish doji and in the highest quarter of candle for bullish doji ?Thanks

      Comment


        #4
        Hello viklen,

        By "highest quarter of the candle", do you mean checking if the high is 3 ticks greater than the close?

        Code:
        if (Close[0] == Open[0] && Close[0] <= High[0] - 3 * TickSize)
        If this not what you mean, please clarify what "lowest quarter" and "highest quarter" of the candle means.
        Gaby V.NinjaTrader Customer Service

        Comment


          #5
          Hi Gaby, thanks for your responce.If you divide candle in 4 pieces, the open and close(unchanged) should happened in top 25% of the candle like this oneClick image for larger version

Name:	image.png
Views:	63
Size:	327 Bytes
ID:	1288955or in​ bottom 25% of the candleClick image for larger version

Name:	image.png
Views:	59
Size:	328 Bytes
ID:	1288956​ . And want create alert every time these type of Doji appear.

          Comment


            #6
            Hello viklen,

            You would need to do some math to calculate this. You can use something like (Close - Low) / (High - Low).

            Close - https://ninjatrader.com/support/help.../nt8/close.htm
            Low - https://ninjatrader.com/support/helpGuides/nt8/low.htm
            High - https://ninjatrader.com/support/helpGuides/nt8/high.htm

            Please let us know if you have any other questions.
            Gaby V.NinjaTrader Customer Service

            Comment


              #7
              Try something like this:

              if(Open[0] == Close[0])
              {
              double OneQtrBarSize = (High[0] - Low[0]) / 4;

              if(Close[0] > High[0] - OneQtrBarSize)
              //Do something here

              if(Close[0] < Low[0] + OneQtrBarSize)
              //Do something else here
              }

              Note: the 1/4 of bar size will not always be on the tick size.
              Last edited by eDanny; 01-31-2024, 12:14 PM.
              eDanny
              NinjaTrader Ecosystem Vendor - Integrity Traders

              Comment


                #8
                Thank you eDanny thats what I need.I converted this script trough chatgpt for tradingview it works very well. Since I new to coding I tried samething for ninjatrader and its creating indicator with programming errors. Is there a way you can create indicator out of your script for ninjatrader and send to my email: [email protected] I would greatly appreciate it.

                Comment


                  #9
                  Check your mail.
                  eDanny
                  NinjaTrader Ecosystem Vendor - Integrity Traders

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Jimmyk, 01-26-2018, 05:19 AM
                  6 responses
                  834 views
                  0 likes
                  Last Post emuns
                  by emuns
                   
                  Started by jxs_xrj, 01-12-2020, 09:49 AM
                  6 responses
                  3,290 views
                  1 like
                  Last Post jgualdronc  
                  Started by Touch-Ups, Today, 10:36 AM
                  0 responses
                  9 views
                  0 likes
                  Last Post Touch-Ups  
                  Started by geddyisodin, 04-25-2024, 05:20 AM
                  11 responses
                  62 views
                  0 likes
                  Last Post halgo_boulder  
                  Started by Option Whisperer, Today, 09:55 AM
                  0 responses
                  8 views
                  0 likes
                  Last Post Option Whisperer  
                  Working...
                  X