Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using ATR for StopLoss

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

    Using ATR for StopLoss

    I'm following the directions from this previous post. Unfortunately, it does not seem to work. The following images show 1) the directions i was using to set it up. 2) how it was set up. & 3) the error messages I'm getting. The two different error messages reflect the difference between using a "Bars ago" value of 0 versus 1 for the Stop Loss Value calculation. Using "0" the error was "Object reference not set" When set to "1" the error changed to "out-of-range" Regardless of the "Bars ago" setting the strategy turns off immediately when trying to enable it and produces the error messages mentioned.

    It did work briefly until i tried to set the Offset to "*" and used a value of 1.5 rather than a whole integer.

    Click image for larger version

Name:	Screenshot 2023-06-06 081354.png
Views:	193
Size:	47.1 KB
ID:	1254795

    Click image for larger version

Name:	Screenshot 2023-06-06 081618.png
Views:	166
Size:	12.3 KB
ID:	1254796

    Click image for larger version

Name:	Screenshot 2023-06-06 081557.png
Views:	191
Size:	15.7 KB
ID:	1254797

    #2
    Hello, thanks for writing in. There can be no use of Indicator data from the Stops and Targets section. This is because the stops and targets are set up during the launch of the script rather than be placed in real time. You will need to use Exit orders instead. We have a related example here:

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    64 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    139 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    75 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