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

Palce sell order on the Next bar after condition has been met

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

    Palce sell order on the Next bar after condition has been met

    Hello,

    My strategy so far has the following logic listed below. The stop loss and profit target aren't important at this point.
    When RSI goes above 80 place a sell order.

    It's working as expected, but the problem is I don't want it to place the order immediately when the condition has been met.

    My observation has been the price will continue to rise during the following bar. So, I'd like the strategy to place the sell order on the next bar after the condition's been met.

    Thanks for the help,
    Tom

    #2
    Hello tommartin321,

    This is certainly possible, can you tell me are you manually coding this or using the Builder?

    In manual coding, you could use a boolean variable. When your condition is true, set the variable to true. On the next OnbarUpdate, another condition could check for that variable being true and submit the order.

    If you are using the builder, the steps would be similar.
    In one set check if a boolean user variable is set to true and if so submit the order and set it back to false.
    In another set, check your original condition and set the boolean user variable to true.

    The order of the sets is important, you want to check if the variable is true in one set before you actually set it in any of the other sets that follow. This would ensure that you wait for a bar after it gets set to check it again.

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

    Comment


      #3
      Thanks Jesse. I'm using the Strategy Builder. Fist let me make sure I have the correct Default Properties set for Calculate.

      For Calculate, I have it set to "On bar close". Is this correct?

      Comment


        #4
        Hello,

        Yes, that would be correct in respect to my previous post, but the setting would need to reflect your overall trading goal and concept. If your concept works with OnBarClose, then yes this would be correct.

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Touch-Ups, Today, 10:36 AM
        0 responses
        5 views
        0 likes
        Last Post Touch-Ups  
        Started by geddyisodin, 04-25-2024, 05:20 AM
        8 responses
        61 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by jxs_xrj, 01-12-2020, 09:49 AM
        4 responses
        3,289 views
        1 like
        Last Post jgualdronc  
        Started by Option Whisperer, Today, 09:55 AM
        0 responses
        5 views
        0 likes
        Last Post Option Whisperer  
        Started by halgo_boulder, 04-20-2024, 08:44 AM
        2 responses
        24 views
        0 likes
        Last Post halgo_boulder  
        Working...
        X