Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bar open close delta

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

    Bar open close delta

    Hi, I am trying to build a strategy using previous bar's (or bars) open and close delta as profit target or stop loss. Cannot find anything in the condition builder allowing me to do that. Any help is appreciated. Thanks.

    #2
    Hello dannyh,

    Thank you for your post.

    How are you intending to use Delta for the Stop Loss and Profit Target?

    If you wish to use it as an input, the Strategy Wizard does not have a native calculation available for input for Delta.
    You will need to create your own indicator that calculates this value and then use that value as the input.

    Please let me know if you have any questions.

    Comment


      #3
      Thanks for the quick response. For example, if i spot a "hammer" in a falling market and enter long in the next bar open and want to set both target and stop as the delta of the open and close of the bar before the "hammer". Do you have an example code as a start point? I imagine this is a fairly common indicator for setting profit and loss for any strategy.

      Comment


        #4
        Hello dannyh,

        Thank you for your response.

        So will you be using the difference in Delta between buy and sell volume to determine the distance from the entry price to place your Stop Loss and Profit Target?

        Will you be using Percent, Price or Ticks for the CalculationMode?

        I look forward to your response.

        Comment


          #5
          No, I won't use the volume but will use the tick in calculation mode. To be clear, when I say delta in open and close, it is basically the difference between the 2. Thanks.

          Comment


            #6
            Originally posted by dannyh View Post
            No, I won't use the volume but will use the tick in calculation mode. To be clear, when I say delta in open and close, it is basically the difference between the 2. Thanks.
            While the term delta is mathematically correct, what you describe is more usually called the range. Use the Range() indicator to do what you want in the wizard. The bar before the current bar will be Range()[1]. It will be simpler to unlock the code and manually write that in. To use the wizard will involve some convolutions to get the Range value into an input of some kind, as the wizard StopLoss interface seems to require fixed values. (Looking again, I am not sure that one can even then use the wizard).
            Last edited by koganam; 01-14-2013, 12:10 PM. Reason: Corrected capitalization.

            Comment


              #7
              Hello dannyh,

              Thank you for your response.

              As koganam mentioned the Range() indicator would give this information or you could program it into your strategy as well. Either method will require hard coding the NinjaScript Strategy outside of the Strategy Wizard.

              Please let me know if you have questions on doing this outside of the Strategy Wizard.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by adeelshahzad, Today, 03:54 AM
              5 responses
              32 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by stafe, 04-15-2024, 08:34 PM
              7 responses
              31 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by merzo, 06-25-2023, 02:19 AM
              10 responses
              823 views
              1 like
              Last Post NinjaTrader_ChristopherJ  
              Started by frankthearm, Today, 09:08 AM
              5 responses
              19 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by jeronymite, 04-12-2024, 04:26 PM
              3 responses
              43 views
              0 likes
              Last Post jeronymite  
              Working...
              X