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

Take Profit / Stop Loss question #160

Open
tsunamilx opened this issue Dec 4, 2024 · 0 comments
Open

Take Profit / Stop Loss question #160

tsunamilx opened this issue Dec 4, 2024 · 0 comments

Comments

@tsunamilx
Copy link

Hi

I am trying the take profit / stop loss method, I set stop loss to 3%, and take profit to 10%, and I see some records that are stopped at the price way lower/higher than expected. I am trading on a crypto asset so there should be no gap between bars.

For example:

this is 1h chart
image

My entry signal appears at b1 (time is 07:00) close (value is 1.11) (the worst entry signal ever LOL), I set fill price to be b1 close, the trade executes at b2 (08:00), to my understanding it should stop at some where near 1.07 on b2, but the actual stop is 0.78, at first I didn't understand why 0.78 until I realize that is the high of b3, it looks like when the trade is executed at b2, does it assume that b2 is already closed so it goes to b3 to exit the trade?

Same thing happens to take profit, some stop price is way higher than expected.

I also tried to explicitly set stop_limit_price and stop_exit_price, but it's the same result.

Trade record:

    type    symbol          entry_date           exit_date  entry  exit      shares    pnl  return_pct  agg_pnl  bars  pnl_per_bar    stop 
7   long  POWRUSDT 2024-01-07 08:00:00 2024-01-07 09:00:00   1.11  0.78   89.950471 -29.69      -29.71   -34.70     1       -29.69    loss

How does it work exactly? And how can I make it work like what I expected (that it stops at 1.07 on b2)?

Thanks.

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

1 participant