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

Tripple-Barrier extension suggestion #451

Open
Jackal08 opened this issue Sep 1, 2020 · 4 comments
Open

Tripple-Barrier extension suggestion #451

Jackal08 opened this issue Sep 1, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@Jackal08
Copy link
Member

Jackal08 commented Sep 1, 2020

Tripple-Barrier extension suggestion:

Add magnitude move barriers not determined by percentage moves, for example, a 10 cent move.

Say you are interested in some spread between two or more instruments. This spread can be positive, negative or even zero. The percentage moves don't make sense here.

A quick fix would be to convert your spread to the dollar value invested since inception, a la etf trick. However, sometimes the absolute magnitude of the move is of interest.

Another practical example in the futures space would be something like a limits up/down filter for events.

@Jackal08 Jackal08 added the enhancement New feature or request label Sep 1, 2020
@davilramos
Copy link

There is a minor error on the labeling function get_events() of the triple barrier:

Line 148:

# 3) Form events object, apply stop loss on vertical barrier
if side_prediction is None:
    side_ = pd.Series(1.0, index=target.index)
    pt_sl_ = [pt_sl[0], pt_sl[0]]
else:
    side_ = side_prediction.reindex(target.index)  # Subset side_prediction on target index.
    pt_sl_ = pt_sl[:2]

it should be 1 instead of 0:

# 3) Form events object, apply stop loss on vertical barrier
if side_prediction is None:
    side_ = pd.Series(1.0, index=target.index)
    pt_sl_ = [pt_sl[0], pt_sl[1]] <<<<<<<<<<<<<<<-----------------------------
else:
    side_ = side_prediction.reindex(target.index)  # Subset side_prediction on target index.
    pt_sl_ = pt_sl[:2]

@Jackal08
Copy link
Member Author

Jackal08 commented Sep 3, 2020

@davilramos, well spotted.

@PanPip will you please do a fix for this in the morning? Then we can do a hotfix into master.

@PanPip PanPip self-assigned this Sep 4, 2020
@PanPip
Copy link
Contributor

PanPip commented Sep 4, 2020

@davilramos Thank you for noticing!

This issue is now fixed.

@mauritzvdworm
Copy link

Any progress on the extension? Should be simple, like adding a bool to identify whether to use returns or actual differences.

@PanPip PanPip removed their assignment Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants