Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing Stop Loss Thresholds #10

Closed
desoss opened this issue Oct 21, 2024 · 2 comments
Closed

Trailing Stop Loss Thresholds #10

desoss opened this issue Oct 21, 2024 · 2 comments

Comments

@desoss
Copy link

desoss commented Oct 21, 2024

Hello,
I am trying to configure a trailing stop loss in MetaAPI such that when the price moves to my target direction, the stop loss moves to breakeven and remains there.

However, based on the current configuration, it seems that the stop loss is adjusting multiple times.

Here is my current configuration for the trailing stop loss:

{
	threshold: {
		thresholds: [
			{
				threshold: 1,
				stopLoss: 1
			}
		],
		units: Units.RELATIVE_PRICE,
		stopPriceBase: StopPriceBases.CURRENT_PRICE
	}
}

My expectation is for the stop loss to move to breakeven only after the price moves 1 "relative price" in my target direction and to stay at breakeven. However, it seems that the stop loss is being adjusted multiple times, not just when it's moved to breakeven.

Could you please confirm if this is the intended behaviour and if there’s a way to configure it so that the stop loss only moves to breakeven after a 1 "relative price" move, without further adjustments?

Thank you for your help!

@jwelmac
Copy link

jwelmac commented Oct 24, 2024

I have noticed a similar issue. I ended up writing my own price monitor to adjust the stops reliably. However, it would be great if the core implementation is as expected.

@metaapi
Copy link
Owner

metaapi commented Apr 11, 2025

We've updated our documentation related to trailing stop loss and conducted extra testing. We think that likelihood of bugs in our trailing stops loss implementation should be low at this point.

It is available both in SDK in-code docs and html docs https://metaapi.cloud/docs/client/models/trailingStopLoss/

Thus we'll be closing this issue now. If you still need assistance on this ticket feel free to reopen it.

@metaapi metaapi closed this as completed Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants