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:	131
Size:	86.0 KB
ID:	1224129Click image for larger version

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

          ​​
          Click image for larger version

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

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


          Click image for larger version

Name:	image.png
Views:	107
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 NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            54 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            130 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            72 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            44 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            49 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X