Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trouble Setting Trail Stop

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

    Trouble Setting Trail Stop

    I have a strategy where:
    - I EnterLong/EnterShort using quantity and a signal name (which I call "signalName"). signalName is a global variable.

    - In OnOrderUpdate (where OrderState == OrderState.Filled and order.Name equals signalName), I call a function to set a trail stop

    - In this function, I attempt to set a trail stop using the format: SetTrailStop(signalName, CalculationMode.Price, target, true)


    Unfortunately, the trail stop doesn't get set. I never see an order generated for it.

    If I SetTrailStop without the signal name (for example, with CalculationMode.Ticks and a value), it works.

    Am I doing something wrong? Is SetTrailStop position level -- e.g., can I set it at an order level? I don't get an error message -- it just fails quietly. Thanks in advance.

    #2
    Hello micprice,

    Thank you for your post.

    You should be able to call SetTrailStop() in OnOrderUpdate() when the order is filled.

    Would you mind if we reviewed the full strategy? Or a version that results in the same behavior?

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    85 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    47 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    29 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    32 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    67 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X