TuringTrader icon indicating copy to clipboard operation
TuringTrader copied to clipboard

Trailing stop order?

Open mw66 opened this issue 1 year ago • 1 comments

Did a quick grep, but didn't find Trailing stop orders.

Just wondering can this be added?

Thanks.

mw66 avatar May 09 '24 04:05 mw66

Hello @mw66 ,

The way things stand, TuringTrader does not have trailing stop orders. TuringTrader's orders are only valid for a single bar, so you could mimic the behavior by issuing a new and adjusted stop order on each bar.

This is not exactly the same as a trailing stop that adjusts intra bar. Because TuringTrader mainly operates on daily OHLCV bars, one would need to make a lot of assumptions regarding the path the stock price took over the course of the day. It is unclear to me which assumptions we could make that would satisfy the majority of users.

You can find the relevant code for order execution here: https://github.com/fbertram/TuringTrader/blob/b0d5310a4644292aa2219c6a69d34f62b8836811/TuringTrader.Simulator/Simulator/v2/Core/Account_Default.cs#L106

Thank you, Best regards

Felix

fbertram avatar May 09 '24 15:05 fbertram