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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      62 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      134 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      75 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      50 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X