Skip to content

Optimizer data Question #141

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

Closed
GJF1 opened this issue Sep 11, 2020 · 9 comments
Closed

Optimizer data Question #141

GJF1 opened this issue Sep 11, 2020 · 9 comments
Labels
invalid This is not a (valid) bug report

Comments

@GJF1
Copy link

GJF1 commented Sep 11, 2020

With the backtesting optimizer, can the values to be changed be arrays of different data lengths? The docs show this example where they are all the same length with 3 data elements each to be used by the optimizer:
image

@kernc
Copy link
Owner

kernc commented Sep 11, 2020

The array lengths, in fact, differ:

>>> len(range(10, 110, 10))                                                                
10
>>> len(range(20, 210, 20))                                                                
10
>>> len(range(15, 35, 5))                                                                  
4
>>> len(range(10, 25, 5))                                                                  
3

As the API reference for Backtest.optimize() says:

Additional keyword arguments represent strategy arguments with list-like collections of possible values.

I think the conundrum here revolves around the use of range(), a Python built-in. Basic Python questions like that are surely out-of-scope here, pointing to StackOverflow as the better-suited venue. 👈 😁

@kernc kernc closed this as completed Sep 11, 2020
@kernc kernc added the invalid This is not a (valid) bug report label Sep 11, 2020
@GJF1
Copy link
Author

GJF1 commented Sep 11, 2020 via email

@kernc
Copy link
Owner

kernc commented Sep 11, 2020

to act like one minute ticks

The attached image didn't get through, and I have no idea what this means. The bars granularity is up to the user: you can have 1-minute bars or you can (supposedly; untested) even have 1-tick bars (with O=H=L=C).

@GJF1
Copy link
Author

GJF1 commented Sep 11, 2020 via email

@kernc
Copy link
Owner

kernc commented Sep 11, 2020

I'm aware of indicator repainting on TradingView, the likely culprit for your strategy not performing as well on live trading.

have 60 one minute bar close prices assembled serially into a one hour bar calc

That's also my view of how the markets work. If you ensure none of your indicators look ahead of time, you should get closer to the performance you expect. 👍

@GJF1
Copy link
Author

GJF1 commented Sep 12, 2020 via email

@GJF1
Copy link
Author

GJF1 commented Sep 12, 2020 via email

@kernc
Copy link
Owner

kernc commented Sep 12, 2020

As I said, OHLC format is mandatory, but other than that:

The bars granularity is up to the user: you can have 1-minute bars or you can (supposedly; untested) even have 1-tick bars (with O=H=L=C).

@GJF1
Copy link
Author

GJF1 commented Sep 12, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This is not a (valid) bug report
Projects
None yet
Development

No branches or pull requests

2 participants