Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Creating STOPS based on Indicators in Strategy Builder

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

    Creating STOPS based on Indicators in Strategy Builder

    How do I make the exit for a Long entry be based on an Indicator value (Say when RSI is Less than 20) or on one indicator value being less than another indicator value. Thanks.

    #2
    Hi Coreycharles100, thanks for posting. The strategy will need to use ExitLong/ShortStopMarket/ExitLong/ShortStopLimit order in one of the sets to specify an indicator value. Please reference these examples that use these order types to submit stop loss dynamically:


    These use prices to place the stop, but the concept to pay attention to here is the use of Exit orders rather than relying on the Stops and Targets section for a stop loss. Instead of a regular price value for the stop, use an indicator value instead.

    Kind regards,
    -ChrisL

    Comment


      #3
      Hey, thanks for the reply, but I am far far from a coder and am just starting out in Strategy Builder. Is there any way I can get an example via the Strategy Builder input screens.

      Comment


        #4
        Hi Corey, thanks for the follow up. The examples I linked can be imported into your platform and opened up in the builder for studying. Download them, then go to Tools>import>NinjaScript Addon, then open each one from the builder and you can see how the sets are built.

        Kind regards,
        -ChrisL

        Comment


          #5
          Hi I've downloaded and looked at the AddOns above and can't figure out how to achieve what I'm looking for. Can you offer more guidance. I'm trying to EXIT a Long position when SSTOCH-RSI<0.2 or when a Tick Target is hit, and EXIT a Short position when SSTOCH-RSI>0.2 or when a Tick Target is hit. Below are screen shots of what I've done, and I've only included those associated with BUY Positions:



          Click image for larger version

Name:	image.png
Views:	133
Size:	86.0 KB
ID:	1224129Click image for larger version

Name:	image.png
Views:	107
Size:	109.0 KB
ID:	1224130

          ​​
          Click image for larger version

Name:	image.png
Views:	104
Size:	75.1 KB
ID:	1224131Click image for larger version

Name:	image.png
Views:	113
Size:	79.4 KB
ID:	1224132


          Click image for larger version

Name:	image.png
Views:	111
Size:	80.3 KB
ID:	1224133​​​
          ​​





          ​ ​

          Comment


            #6
            Hi Corey, thanks for the follow up. Unfortunately, I will not be able to help with debugging custom scripts. Other members of the forum would need to volunteer. We have a short guide here that describes how you can start out with debugging scripts:



            Now, this guide is for working with the C# code in the editor, but the concept of using Prints is the same and Print can be found in the Misc folder of the actions. Print lets you print out data from the script and you can strategically place these printouts in each set to see the processing flow and data from the script. You can view the output from New>NinjaScript Output.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            45 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            21 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            31 views
            1 like
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            50 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            42 views
            0 likes
            Last Post CarlTrading  
            Working...
            X