Skip to content

StopTrail is based on the candle high, not close#2

Open
nuno84 wants to merge 2 commits into
smalinin:masterfrom
nuno84:master
Open

StopTrail is based on the candle high, not close#2
nuno84 wants to merge 2 commits into
smalinin:masterfrom
nuno84:master

Conversation

@nuno84

@nuno84 nuno84 commented Jun 3, 2026

Copy link
Copy Markdown

Hi,
I would like to propose the following change.
By doing some developing, I noticed that the trail stop was based on the candle Close, but I think it is incorrect and should be done on the candle high:
I did a trailing stop of 5%

Before it was 99.9 - 5% = 94.905:
image

After it is 102.23 - 5% = 97.11 as we can see in the sell:
image

Tks

@smalinin

smalinin commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Simply change to on High is not a good idea:

  1. it work properly only for Buy, not for Sell orders
  2. BackBroker is just a simulation, if you use High price, we must to add some slip value, because High price could be with Volume==1(for example), when you have order size=500. So Close give more adequate/real results.

Therefore it could be added, but it must be configurable, with default on Close and more properly work for both Buy/Sell orders.
I will look it later.

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

Successfully merging this pull request may close these issues.

2 participants