Support Board
Date/Time: Sun, 23 Feb 2025 08:45:27 +0000
[Programming Help] - How to automatically modify trailing stop distance?
View Count: 1418
[2021-02-15 06:04:17] |
homestar - Posts: 21 |
I'd like to modify the distance of my trailing stop automatically, preferably via spreadsheets or ACSIL. For example, suppose my attached order is configured to trail at an offset of 10 ticks. I want to change the trailing offset to 20 ticks (based on market conditions), without necessarily changing the current stop price. To make the example more concrete, if the S&P is trading at $3000 and my trailing stop order is currently 10 ticks away at $2997.5, I would like to change the stop so that it can trail up to 20 ticks away, without changing the stop's current position at $2997.5. In SC's Order Types webpage, I've read that "If you manually modify the Trailing Stop order, then the Trail Offset will be recalculated by taking the difference between the new Stop price and the current market price." How to do this automatically? Many thanks for any assistance or ideas!!! Date Time Of Last Edit: 2021-02-15 06:04:53
|
[2021-02-15 13:48:39] |
Sawtooth - Posts: 4174 |
You might be able to modify a Trade Window config of an Attached Order trailing stop offset with a custom ACSIL study. A spreadsheet study cannot do this. However, you can move an Attached Order non-trailing stop by using the Trade Management by Study study that references a calculated price in a spreadsheet column. You'd need to use the Spreadsheet System for Trading study for this. Attached Orders: Study Controlled Targets and Stops |
[2021-02-15 16:40:56] |
norvik_ - Posts: 106 |
Use sc.ModifyOrder function with ACSIL. There is an example in the online docs how to do it.
|
[2021-02-15 16:58:06] |
Sawtooth - Posts: 4174 |
Another option would be to use the Trade Management by Study study and have it trail a 1 period SMA of the Last price.
|
[2021-02-15 17:48:34] |
homestar - Posts: 21 |
Awesome, thanks for the ideas! Very much appreciated. The Trade Management by Study / Spreadsheet System for Trading idea is compelling. Though one drawback would be that the "trailing" would be performed on the client-side, not on the server-side (i.e. Sierra Chart / CME servers would not know that the order is supposed to be "trailing", they would just see that my client is frequently adjusting the position of the stop order). Seems like a very good way to get started though. Date Time Of Last Edit: 2021-02-15 17:58:05
|
[2021-02-15 17:56:38] |
homestar - Posts: 21 |
As far as using ACSIL to modify trailing offset for a "server-side" trailing order, I'll have to look into it sc.ModifyOrder. Thanks for the tip, norvik_.
|
[2021-02-15 18:18:57] |
homestar - Posts: 21 |
Update: I was mistaken about server-side management of trailing stops -- it seems that all Sierra Chart trailing stops are managed by the client.
|
To post a message in this thread, you need to log in with your Sierra Chart account: