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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      80 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      64 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      64 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X