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 CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    52 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    29 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    194 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    355 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    274 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X