Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Targeted Stop Loss causes OnStateChange error

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

    Targeted Stop Loss causes OnStateChange error

    When using a SL & TP in the 'Stops and Targets' section of the strategy building. I encounter an error which results in my strategy refusing to enable.

    The error occurs when I try to define a specific price in the value. In this case I wanted to put the stop 1 tick below the low of the previous bar (Low[1] + (-1 * TickSize)). When doing so this throws up the following error.

    'Strategy 'BasicTrigger2': Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.'

    After this the strategy will not enable at all and I have to remove the part of the value. If I simply have the SL and TP with an arbitrary single tick value the strategy gives no errors. I don't understand what I'm doing wrong?

    #2
    ok, I found the answer. You can't pass a variable in the strategy builder with SetStopLoss etc

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    50 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    126 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    69 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X