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

How to trade at Open /High/ Low / Close of the next candle #105

Closed
sangramht opened this issue Jul 13, 2020 · 4 comments
Closed

How to trade at Open /High/ Low / Close of the next candle #105

sangramht opened this issue Jul 13, 2020 · 4 comments
Labels
duplicate This issue or pull request already exists

Comments

@sangramht
Copy link

How to add Alteration of Entry/Exit Points.(Instead of Entry at close I want entry be based on next candle's Open/High/Low/Close)

@kernc
Copy link
Owner

kernc commented Jul 13, 2020

By default, the trade is entered on next candlebar's open price (think of it as placing a trade during the night when the exchange is closed). If you run Backtest(..., trade_on_close=True), the trade will be entered on the current bar's closing price (think of it as placing the order a few seconds before the exchange closes).

If you place a limit order, the order will be executed when the price eventually reaches the exact set price level (e.g. when it dives to its next day's low price).

Does that answer your question?

@sangramht
Copy link
Author

sangramht commented Jul 14, 2020

Yes it somewhat does, but what if I want to enter on next bars High ?

@kernc
Copy link
Owner

kernc commented Jul 14, 2020

Then you have to wait for or checkout #47 and set stop= price there. 😅

@kernc
Copy link
Owner

kernc commented Jul 15, 2020

With #47 merged and v0.2.0 released, you can use Strategy.buy(..., stop=stop_price) to issue a stop-market order, entering trade on "next bar's High". 👍

@kernc kernc closed this as completed Jul 15, 2020
@kernc kernc added the duplicate This issue or pull request already exists label Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants