Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adopt Account Position and Trail Stop

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

    Adopt Account Position and Trail Stop

    Hello,

    Quick question... I'm working on an Adopt Position strategy.

    Basically, whatever the long position is that I have... when I enable the strategy, I just have it looking for an exit point.

    When that exit point triggers, I start a SetTrailStop(CalculationMode.Percent, .01);

    When I run the strategy, it gets the position and average position price just fine, that works great. It calculates the profit target properly so the only thing left is the SetTrailStop as above. When that SetTrailStop triggers, a real order isn't placed, I'm getting this message:

    Code:
    Entered internal SetStopTarget() method: Type=TrailStop FromEntrySignal='' Mode=Percent Value=0.01 IsSimulatedStop=False IsMarketIfTouched=False
    But, no order shows up on the chart, and no order is sent to the broker (Interactive Brokers).

    Is there a way to trigger a trailstop on an order that has been placed prior to the strategy being enabled?

    Thank you
    Jeff

    #2
    Hello Jeff, thanks for your post.

    I tested a strategy and got the same behavior. It should be possible to initiate a trailing stop from an adopted position so I will submit a report to fix the issue.

    Kind regards.

    Comment


      #3
      Hello Jeff, I spoke too soon. I tested again, waited for the next bar to close and the trailing stop is working.

      I tested a simple strategy that only submits the trailing stop on the first real time bar and the trailing stop is submitted. Can you test this strategy that I have posted and confirm it works for you? To test: Open a 10 second chart>Ppen a long position on the sim101 account>Add "teststrategy">Set Adopt Account Position> Enable> wait for the next real time bar, the trailing stop will update on each bar close. Note* the trailing stop will update based on the Calculate property, so if the script is Calculate.OnBarClose the trail stop will update once on every bar close.

      Best regards,
      -ChrisL
      Attached Files

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X