Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Auto Stop Loss Set To High or Low of Enter Candle.

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

    Auto Stop Loss Set To High or Low of Enter Candle.

    Hey!

    I would like to find a way to have a stop loss set automatically at the LOW of a candle when entering a LONG position or at the HIGH of a candle when entering a SHORT position.

    I'm using an ATM strategy right now, but I have my stop set to 20 ticks or something so I usually have to manually move the stop after entering the trade and with how fast futures contracts move sometimes, I end up not getting the stop in place in time.

    I'm new to coding and NinjaTrader, so if someone could even point me in the right direction, that would be awesome.

    Thanks!


    #2
    Hello Crytomaphone,

    Thank you for your first post and welcome to the NinjaTrader forums!

    This would be possible using a custom NinjaScript strategy. Since you are new to coding and NinjaTrader, I recommend checking out the following link for some helpful information, tips, and resources related to NinjaScript and C#:


    If you choose to create this in the Strategy Builder, I recommend the following forum post that explains what is needed to set up a Stop Loss or Profit Target that is dynamic and based on data from the candle:
    Hi Ninjas, How can I create a ProfitTarget and StopLoss according to the size of each candlestick (High and Low) when I just enter (Long and Short) using Strategy Builder? I have tried this but it doesn't work: Variable: TargetStopPoints Double TargetStopTicks Double Do the following: EnterLong(DefaultQuantity,"")


    If you were to create this in an unlocked script in the NinjaScript Editor, you could use SetStopLoss() within OnBarUpdate() or you could check out the following reference sample that demonstrates how to submit protective orders using OnOrderUpdate() and OnExecutionUpdate():


    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.

    Please let us know if we may be of further assistance.

    Comment


      #3
      Awesome, thank you.

      "You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services."

      A list of consultants would be much appreciated!


      Comment


        #4
        Hello Cryptomaphone,

        Thank you for your post.

        You can search our list of NinjaScript consultants through the link below. Simply enter a consultant name or search by using our filter categories. Once you have identified your consultants of choice, please visit each consultant's site for more information or contact them directly to learn more:
        You can locate the contact information for the consultants on their direct websites for any additional questions you may have. Since these consultants are third-party services for NinjaTrader, all pricing and support information will need to be obtained through the consultant.

        The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The companies and services listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem, LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

        Let me know if I may be of further assistance.
        Thomas C.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        57 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        133 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        73 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X