Login Page - Create Account

Support Board


Date/Time: Sun, 05 May 2024 16:29:06 +0000



[Programming Help] - Auto trading with a trailing stop

View Count: 633

[2020-05-14 18:01:02]
Matt NL - Posts: 91
Hi guys
I'm struggling to find a way to do this.
How can I place an order on alert condition and also include an automatic stop-loss and profit-taking bracket order?
I can only find the study which places an order without an attached bracket order.
My goal is to automate it completely so I can backtest and get performance results
Thanks
Matt
[2020-05-14 21:53:53]
Matt NL - Posts: 91
So I've figured out how to add targets/stops using sc.UseGUIAttachedOrderSetting = true;
However, when I'm backtesting all my target limit orders are immediately filled at the current (live time) price, not the price at the time of backtesting.

How can we prevent the current (real-time/live) price being used for market orders or target limit orders when backtesting?

Thanks
Matt
[2020-05-14 22:20:42]
Matt NL - Posts: 91
Screenshot attached
image2020-05-15_00-17-44.png / V - Attached On 2020-05-14 22:19:50 UTC - Size: 76.46 KB - 258 views
Attachment Deleted.
[2020-05-14 23:17:28]
Matt NL - Posts: 91
Fixed! Reply limit (profit) orders and market orders do not work when you use a different symbol for trades (like MES instead of ES).
Removed and it's fine now.

Thanks
Matt

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

Login

Login Page - Create Account