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:	197
Size:	47.1 KB
ID:	1254795

    Click image for larger version

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

    Click image for larger version

Name:	Screenshot 2023-06-06 081557.png
Views:	197
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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    81 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    66 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X