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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    87 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    128 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    65 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    117 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X