Login Page - Create Account

Support Board


Date/Time: Thu, 06 Feb 2025 23:24:57 +0000



[Programming Help] - Trailing stop not closing position

View Count: 705

[2020-05-14 00:57:14]
User483581 - Posts: 2
Hello,

I replay test a simple strategy: open position when price crosses an exponential average. Close when the trailing stop attached order reaches the profit goal or stop loss.

The problem is that is closing the position when the price crosses the exponential average again, in the reversal; instead of exiting earlier when the profit target was met.

In many cases I ended up with a loss, when the maximum open profit on the trading activity log shows my goal was met and passed.

I'm clearly doing something wrong, I read a lot of documentation, tried different settings but the solution escapes me.

Can you please tell me if my settings are correct?

Can you please tell me how to fix this?


This is the code used in the spreadsheet to enter positions: =CROSSFROMBELOW(E3:E4,AI3:AI4) for longs; =CROSSFROMABOVE(E3:E4,AI3:AI4) for shorts.

I placed the trailing stop in the "Trade window for chart". I ticked the box: "use attached orders".

The trailing stop type is:"Stop triggered trail stop limit".

Stop offset: 30 ticks (this is my stop loss, correct?)

Trigger offset: 40 ticks (this is my initial profit goal, correct?)

Trail offset: 20 ticks (this is the incremental interval that will trail after the initial profit goal is reached, correct?)

Group: OCO Group 1

Quantity: 1

Move to breakeven for stop: Step 1

Type: None

TIF: Day

Thank you.

Edit: I have the same trailing stop problem while live trading too (not just on replay backtest).
Date Time Of Last Edit: 2020-05-14 01:07:24

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account