backtesting.py icon indicating copy to clipboard operation
backtesting.py copied to clipboard

BUG: Allow multiple names for vector indicators (#382)

Open ivaigult opened this issue 1 year ago • 5 comments

Fixes https://github.com/kernc/backtesting.py/pull/382 Closes https://github.com/kernc/backtesting.py/pull/385

Previously we only allowed one name per vector indicator:

def _my_indicator(open, close):
    return tuple(
        _my_indicator_one(open, close),
         _my_indicator_two(open, close),
    )

self.I(
    _my_indicator,
    # One name is used to describe two values
    name="My Indicator",
    self.data.Open,
    self.data.Close
)

Now, the user can supply two (or more) names to annotate each value individually. The names will be shown in the plot legend. The following is now valid:

self.I(
    _my_indicator,
    name=["My Indicator One", "My Indicator Two"],
    self.data.Open,
    self.data.Close
)

ivaigult avatar May 08 '23 17:05 ivaigult

Hi @kernc,

Thank you for the feedback! I think I addressed everything. Could you, please, resolve all conversations if it looks okay to you.

Thank you:slightly_smiling_face:

ivaigult avatar May 09 '23 21:05 ivaigult

Hi @kernc,

I think it's all addressed, hope it's gtg now:crossed_fingers:

PS: similarly to #975, you need to approve workflow runs for me otherwise github won't run pylint and friends:slightly_smiling_face:

ivaigult avatar May 14 '23 19:05 ivaigult

gtg

It is. The checks won't finish near green, though. Project docs build hinges on scikit-optimize being presently unmaintained and in a defunct state wrt other Python/numpy/sklearn stack. I'm not yet certain what to do about that.

kernc avatar May 14 '23 23:05 kernc

include the scikit-optimize, you actually need just a few files as far as I remember.

romanbsd avatar Sep 02 '23 19:09 romanbsd

Are there any obstacles that preventing merge of this?

scikit-optimize being presently unmaintained and in a defunct state

I understand it's an issue, but I appreciate this will be addressed separately in another PR?

ivaigult avatar Nov 20 '23 11:11 ivaigult