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 judysamnt7, 03-13-2023, 09:11 AM
        4 responses
        53 views
        0 likes
        Last Post DynamicTest  
        Started by ScottWalsh, Today, 06:52 PM
        4 responses
        33 views
        0 likes
        Last Post ScottWalsh  
        Started by olisav57, Today, 07:39 PM
        0 responses
        5 views
        0 likes
        Last Post olisav57  
        Started by trilliantrader, Today, 03:01 PM
        2 responses
        19 views
        0 likes
        Last Post helpwanted  
        Started by cre8able, Today, 07:24 PM
        0 responses
        6 views
        0 likes
        Last Post cre8able  
        Working...
        X