nateemma / strategies

Custom trading strategies using the freqtrade framework
329 stars 88 forks source link

Futures #45

Closed maledicente closed 8 months ago

maledicente commented 8 months ago

Have you been using futures like this?

can_short = True leverage = 5.0

I have two errors:

TypeError: 'float' object is not callable Unexpected error 'float' object is not callable calling 5.0 Traceback (most recent call last): File "/freqtrade/freqtrade/strategy/strategy_wrapper.py", line 27, in wrapper return f(*args, **kwargs)

and

FileNotFoundError: [Errno 2] No such file or directory: 'test_data.npy'

Are you using leverage_num?

nateemma commented 8 months ago

I don’t have access to a computer right now, but if you turn on leverage, I think there’s a callback you have to implement (check freqtrade docs). Also, the custom exit logic will be wrong for shorts. I’ve been meaning to add support, just haven’t had time.

The missing file error is for test programs in the utils dir, not sure why you’re seeing that. I guess I didn’t add that to git

Cheers

Phil

On Thu, Jan 25, 2024 at 9:12 PM Luiz Paulo Nievola @.***> wrote:

Have you been using futures like this?

can_short = True leverage = 5.0

I have two errors:

TypeError: 'float' object is not callable Unexpected error 'float' object is not callable calling 5.0 Traceback (most recent call last): File "/freqtrade/freqtrade/strategy/strategy_wrapper.py", line 27, in wrapper return f(*args, **kwargs)

and

FileNotFoundError: [Errno 2] No such file or directory: 'test_data.npy'

Are you using leverage_num?

— Reply to this email directly, view it on GitHub https://github.com/nateemma/strategies/issues/45, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABD4X56NV6H362WC6LUHA3LYQMGHRAVCNFSM6AAAAABCLPI5M2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGEYDCNBWGAZTEMQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

tomjrtsmith commented 8 months ago

I've done all the custom exit and short logic somewhere I'll make a PR

On Sat, Jan 27, 2024 at 3:41 AM Nateemma @.***> wrote:

I don’t have access to a computer right now, but if you turn on leverage, I think there’s a callback you have to implement (check freqtrade docs). Also, the custom exit logic will be wrong for shorts. I’ve been meaning to add support, just haven’t had time.

The missing file error is for test programs in the utils dir, not sure why you’re seeing that. I guess I didn’t add that to git

Cheers

Phil

On Thu, Jan 25, 2024 at 9:12 PM Luiz Paulo Nievola @.***> wrote:

Have you been using futures like this?

can_short = True leverage = 5.0

I have two errors:

TypeError: 'float' object is not callable Unexpected error 'float' object is not callable calling 5.0 Traceback (most recent call last): File "/freqtrade/freqtrade/strategy/strategy_wrapper.py", line 27, in wrapper return f(*args, **kwargs)

and

FileNotFoundError: [Errno 2] No such file or directory: 'test_data.npy'

Are you using leverage_num?

— Reply to this email directly, view it on GitHub https://github.com/nateemma/strategies/issues/45, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABD4X56NV6H362WC6LUHA3LYQMGHRAVCNFSM6AAAAABCLPI5M2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGEYDCNBWGAZTEMQ>

. You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/nateemma/strategies/issues/45#issuecomment-1912174934, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXXUNNNCL62LEDBPHH7N7E3YQO6BXAVCNFSM6AAAAABCLPI5M2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJSGE3TIOJTGQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

maledicente commented 8 months ago

@tomjrtsmith I wanted to implement it, but I'm traveling.

tomjrtsmith commented 8 months ago

I've done it for an old version of TS_Wavelet and TS_Predict so I'll move it all over to TSPredict and make a PR but it will need testing.

On Mon, Jan 29, 2024 at 4:02 AM Luiz Paulo Nievola @.***> wrote:

@tomjrtsmith https://github.com/tomjrtsmith I wanted to implement it, but I'm traveling.

— Reply to this email directly, view it on GitHub https://github.com/nateemma/strategies/issues/45#issuecomment-1913625801, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXXUNNPDSGSMRZC6JK46GMDYQZR7NAVCNFSM6AAAAABCLPI5M2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJTGYZDKOBQGE . You are receiving this because you were mentioned.Message ID: @.***>

tomjrtsmith commented 8 months ago

Phil I've done some work on TSPredict in my repo if you want to have a look. I've done long and short conditions and custom exit, I've put the leverage callback in but it needs to integrate with the custom exit settings I think. I can't seem to make a PR from that particular branch but it's there if you want to use anything.

On Mon, Jan 29, 2024 at 6:33 AM Tom Smith @.***> wrote:

I've done it for an old version of TS_Wavelet and TS_Predict so I'll move it all over to TSPredict and make a PR but it will need testing.

On Mon, Jan 29, 2024 at 4:02 AM Luiz Paulo Nievola < @.***> wrote:

@tomjrtsmith https://github.com/tomjrtsmith I wanted to implement it, but I'm traveling.

— Reply to this email directly, view it on GitHub https://github.com/nateemma/strategies/issues/45#issuecomment-1913625801, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXXUNNPDSGSMRZC6JK46GMDYQZR7NAVCNFSM6AAAAABCLPI5M2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJTGYZDKOBQGE . You are receiving this because you were mentioned.Message ID: @.***>

maledicente commented 8 months ago

@nateemma Can you pull the missing file?

"The missing file error is for test programs in the utils dir, not sure why you’re seeing that. I guess I didn’t add that to git"

User interrupted.. 2024-02-14 18:41:26,864 - freqtrade - ERROR - Fatal exception! Traceback (most recent call last): File "/freqtrade/freqtrade/main.py", line 42, in main return_code = args['func'](args) ^^^^^^^^^^^^^^^^^^ File "/freqtrade/freqtrade/commands/optimize_commands.py", line 107, in start_hyperopt hyperopt.start() File "/freqtrade/freqtrade/optimize/hyperopt.py", line 633, in start HyperoptTools.try_export_params( File "/freqtrade/freqtrade/optimize/hyperopt_tools.py", line 98, in try_export_params fn = HyperoptTools.get_strategy_filename(config, strategy_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/freqtrade/freqtrade/optimize/hyperopt_tools.py", line 56, in get_strategy_filename strategy_objs = StrategyResolver.search_all_objects( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/freqtrade/freqtrade/resolvers/iresolver.py", line 206, in search_all_objects result.extend(cls._search_all_objects(path, enum_failed, recursive)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/freqtrade/freqtrade/resolvers/iresolver.py", line 247, in _search_all_objects for obj in cls._get_valid_object(module_path, object_name=None, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/freqtrade/freqtrade/resolvers/iresolver.py", line 91, in _get_valid_object spec.loader.exec_module(module) # type: ignore # importlib does not use typehints ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap_external>", line 940, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/freqtrade/user_data/strategies/test_wavelets.py", line 52, in <module> test_data = np.load('test_data.npy') ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ftuser/.local/lib/python3.11/site-packages/numpy/lib/npyio.py", line 427, in load fid = stack.enter_context(open(os_fspath(file), "rb")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'test_data.npy'

nateemma commented 8 months ago

it's in the utils/ dir. You'll need to copy it to your root freqtrade directory though (that's why it didn't get checked in).

If you are using the test_*.py scripts, you should uncomment the types that you want to test then just run it. If you enable too many the output is difficult to interpret.

Cheers,

Phil

On Wed, Feb 14, 2024 at 10:42 AM Luiz Paulo Nievola < @.***> wrote:

@nateemma https://github.com/nateemma Can you pull the missing file?

"The missing file error is for test programs in the utils dir, not sure why you’re seeing that. I guess I didn’t add that to git"

User interrupted.. 2024-02-14 18:41:26,864 - freqtrade - ERROR - Fatal exception! Traceback (most recent call last): File "/freqtrade/freqtrade/main.py", line 42, in main return_code = args'func' ^^^^^^^^^^^^^^^^^^ File "/freqtrade/freqtrade/commands/optimize_commands.py", line 107, in start_hyperopt hyperopt.start() File "/freqtrade/freqtrade/optimize/hyperopt.py", line 633, in start HyperoptTools.try_export_params( File "/freqtrade/freqtrade/optimize/hyperopt_tools.py", line 98, in try_export_params fn = HyperoptTools.get_strategy_filename(config, strategy_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/freqtrade/freqtrade/optimize/hyperopt_tools.py", line 56, in get_strategy_filename strategy_objs = StrategyResolver.search_all_objects( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/freqtrade/freqtrade/resolvers/iresolver.py", line 206, in search_all_objects result.extend(cls._search_all_objects(path, enum_failed, recursive)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/freqtrade/freqtrade/resolvers/iresolver.py", line 247, in _search_all_objects for obj in cls._get_valid_object(module_path, object_name=None, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/freqtrade/freqtrade/resolvers/iresolver.py", line 91, in _get_valid_object spec.loader.exec_module(module) # type: ignore # importlib does not use typehints ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/freqtrade/user_data/strategies/test_wavelets.py", line 52, in

test_data = np.load('test_data.npy') ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ftuser/.local/lib/python3.11/site-packages/numpy/lib/npyio.py", line 427, in load fid = stack.enter_context(open(os_fspath(file), "rb")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'test_data.npy' — Reply to this email directly, view it on GitHub , or unsubscribe . You are receiving this because you were mentioned.Message ID: ***@***.***>