ta-oliver / infertrade

Open source trading and investment strategy library designed for accessibility and compatibility
Apache License 2.0
34 stars 20 forks source link

Modified decorator branch #137

Closed bi-kash closed 3 years ago

bi-kash commented 3 years ago

Looks good.

@fernando-az-infertrade has done good work. It's well-written and well-tested code.

ta-oliver commented 3 years ago

@fernando-az-infertrade has done good work. It's well-written and well-tested code.

Agree...!

ta-oliver commented 3 years ago

@bi-kash - if you look at the version of code in 42226e22a2add05ea113cba1f4145521d74728a5 you can see a different format of decorator, one where you do not supply the limits to the decorator, but add them as keyword arguments to the decorated functions. I think we could add that format of decorator as @apply_restrictions and include within it the limit_allocations as an option.

So user could call my_first_infertrade_rule(lower_limt = -0.1, upper_limit = 0.5) or similar once my_first_infertrade_rule was decorated by@apply_restrictions`

ta-oliver commented 3 years ago

This format would allow us to extend @apply_restrictions to include other limits (e.g. a stop loss) as additional keyword arguments.