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

How to Detect Arrow in Chart

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

    How to Detect Arrow in Chart

    Hi

    I am using third arty indicator and it plots Up/Down Arrow for Buy/Sell signals. I want to know how to code in order to detect Up/Down Arrows being drawn and exeute the relevant strategy? thx in advance

    #2
    Hi NingNing,

    With NinjaTrader 7, you can access drawing objects with IDrawObject:


    Aside from that, there is no explicit way of accessing/detecting an arrow. Instead, you will need to copy the same condition the indicator uses, and make executions based on that.
    TimNinjaTrader Customer Service

    Comment


      #3
      is there something similar available for 6.5V?

      Comment


        #4
        Hi kevinlouie,

        Unfortunately not, in that case you would want to use the same conditions/logic the indicator uses. As an alternative, you can add a plot to the indicator, for example setting it to a value of 1 when the arrow conditions are true, and base your conditions on the plot value of the indicator.
        TimNinjaTrader Customer Service

        Comment


          #5
          do you have a sample of it to share or from other thread?

          Comment


            #6
            Hi kevinlouie,

            Unfortunately not, however, lets say the condition in the indicator, "Indicator1", for the arrow is....
            Code:
            if (Close[0] > Close[1])
            {
            DrawArrowUp(....)
            }
            you could create a plot, (with the necessary code in Initialize() and Properties), then add it to the condition...
            Code:
            if (Close[0] > Close[1])
            {
            DrawArrowUp(....)
            Plot1.Set(1);
            }
            else
            {
            Plot1.Set(0);
            }
            then access the code from your strategy...
            Code:
            if (Indicator1().Plot1[0] ==0)
            {
            EnterLong();
            }
            TimNinjaTrader Customer Service

            Comment


              #7
              Plot Detection

              So if a third party indicator plots a black line width 3 on the price panel there is no way to detect this new plot via ninjacript? I do not have access to the indicator code, but simply want to detect new drawing objects that appear on the price panel.

              Regards

              Comment


                #8
                Hi everington_f,

                It's generally recommend that developers send logic along with the drawing objects, as in my example, like a bool, or explicit plot value.

                You may be able to do something like:
                if (Indicator1().Plot1[0] >0)
                do something;
                TimNinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NingNing View Post
                  Hi

                  I am using third arty indicator and it plots Up/Down Arrow for Buy/Sell signals. I want to know how to code in order to detect Up/Down Arrows being drawn and exeute the relevant strategy? thx in advance
                  You will have to iterate through the DrawObjects collection, and act on the relevant arrow.

                  ref: http://www.ninjatrader.com/support/h...rawobjects.htm

                  Comment


                    #10
                    Originally posted by NinjaTrader_Tim View Post
                    ... You may be able to do something like:
                    if (Indicator1().Plot1[0] >0)
                    do something;
                    That only works if the developer has not set the ChartOnly property.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by joselube001, 05-10-2024, 12:17 PM
                    5 responses
                    23 views
                    0 likes
                    Last Post joselube001  
                    Started by bigc0220, 09-18-2018, 09:16 AM
                    6 responses
                    2,579 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by lorem, 04-25-2024, 09:18 AM
                    18 responses
                    77 views
                    0 likes
                    Last Post lorem
                    by lorem
                     
                    Started by DawnTreader, 05-08-2024, 05:58 PM
                    21 responses
                    81 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Started by doihaveto13, Today, 12:46 PM
                    2 responses
                    4 views
                    0 likes
                    Last Post doihaveto13  
                    Working...
                    X