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

Length of a candle

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

    Length of a candle

    hi, i'm making a strategy and i want the entry to be made when the length of the candle is defined by the user. How do I measure the length of the previous candle and know if it could be a market entry candle? Thank you

    #2
    Hello jerryblack,

    Thanks for the post.

    By length of the candle do you mean Time it took to complete or the Difference between high and low?

    The user input part is very easy, that can be created by the strategy builder in the user inputs section. Depending on the condition you are looking for would determine what Type the user input is.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks for answering

      I want to choose the type of candle, which is a large candle and with intention

      Comment


        #4
        Hello jerryblack,

        What makes the candle large? Are you referring to the difference in prices between the low and high? For example this candle was large because it had X amount of difference between low and high?

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          yes exactly, I want to measure it and put it in a variable to tell the strategy if it is the correct candle to enter or not

          Comment


            #6
            Hello jerryblack,

            You could calculate that by using the following syntax:

            Code:
            double length = High[1] - Low[1];
            This would give you the price difference whihch you could then use in a condition. Assuming you have a user input called InputPrice it would look like the following:

            Code:
            if(InputPrice > length)
            {
            
            }
            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              thanks a lot

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by FrazMann, Today, 11:21 AM
              0 responses
              3 views
              0 likes
              Last Post FrazMann  
              Started by geddyisodin, Yesterday, 05:20 AM
              8 responses
              51 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by cmtjoancolmenero, Yesterday, 03:58 PM
              10 responses
              36 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by DayTradingDEMON, Today, 09:28 AM
              4 responses
              24 views
              0 likes
              Last Post DayTradingDEMON  
              Started by George21, Today, 10:07 AM
              1 response
              19 views
              0 likes
              Last Post NinjaTrader_ChristopherJ  
              Working...
              X