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

Strategy Builder using high/low of 1 candle

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

    Strategy Builder using high/low of 1 candle

    Hi I'm looking to develop a strategy in the builder, I'm not familiar with coding.

    I want a strategy that uses the 8:30am 1 min candles high and low (including wick), with individual entries one long above the wick high, and a short below the wick low.
    I need help setting a profit target and stop loss that adjusts to those values.
    And only trading from 8:31am-9:01am.

    Any help would be appreciated.

    Thank you

    #2
    Hello kevo93,

    Is there any significance to the 8:30am time for example is that the open of the trading session for the instrument being used? If so you can use Misc -> IsFirstBarOfSession property to know its that bar. If not you can make a time condition checking for 8:30.

    There is an example of creating a time condition here: https://ninjatrader.com/support/help...imeComparisons

    To get the value from the 8:30 bar you could make a time condition checking for that time and then as the action set variables to the prices of the high and low. Those variables can later be used in other sets.

    To make a window of time for trading you would need to add two conditions to a set checking in the first condition if the time is greater or equal to 8:31am and then in the second condition checking if the time is less than or equal to 9:01.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you for your quick answer.

      8:30am is the candle that I use to determine my entry & exit when manual trading. I used the time condition as suggested, my only issue being the entry is going off the close value, not the low or high of the wick. Am I doing something wrong?

      Comment


        #4
        Hello kevo93,

        What type of order are you using for the entry? If you use a market order that fills based on the current market price.

        JesseNinjaTrader Customer Service

        Comment


          #5
          I use a buy/sell stop a few ticks (different amounts for different instruments) above the high and below the low.

          Comment


            #6
            Hello kevo93,

            I am not sure I understand what you mean by

            my only issue being the entry is going off the close value, not the low or high of the wick
            An order should fill based on the last/close price series. If you wanted to place an order at a certain price you would need to use a limit or stop limit depending on the use case. If you used a Stop Market that won't guarantee a fill price because its converted to a market order when the stop price is hit.
            JesseNinjaTrader Customer Service

            Comment


              #7
              Yes you're right I understand that. I'm using limit/stop limits to enter my trades in manual trading, with a 6 tick offset above the high of the candlestick wick, and vice versa below the wick.

              Is there a way to identify the wick high & low. Also since I'm just using the high/low values of 1 particular candle, is there a condition that lets me select the 8:30am candle for example?

              Comment


                #8
                Hello kevo93,

                Are you still having difficulty finding the prices that you wanted? If so that is likely the problem surrounding the order. To make an order that is offset 6 ticks from the High you need to calculate that price and give it to the order.

                If you use the builder for limit type orders you would also need to use variables and a final set to hold the order open till filled with the price that you calculated. You can find an example of doing that in the following link: https://ninjatrader.com/support/foru...rategy-builder

                The break even sample would be the easiest to look at, you can ignore the break even set and focus on how the variables are using to control submitting the target. Also how the variables are used to store a calculated price. You would be doing the same concept in your script if you found a price at 8:30am, it would need to be stored to a variable so that your entry limit order can use it.

                JesseNinjaTrader Customer Service

                Comment


                  #9
                  Thanks, that helps a lot.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by techgetgame, Today, 11:42 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post techgetgame  
                  Started by sephichapdson, Today, 11:36 PM
                  0 responses
                  1 view
                  0 likes
                  Last Post sephichapdson  
                  Started by bortz, 11-06-2023, 08:04 AM
                  47 responses
                  1,612 views
                  0 likes
                  Last Post aligator  
                  Started by jaybedreamin, Today, 05:56 PM
                  0 responses
                  9 views
                  0 likes
                  Last Post jaybedreamin  
                  Started by DJ888, 04-16-2024, 06:09 PM
                  6 responses
                  19 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Working...
                  X