Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Some strategies do not poll the latest trading price in trade command (Binance) #1609

Open
mattopolitan opened this issue Jun 5, 2018 · 7 comments

Comments

@mattopolitan
Copy link

System information

  • Have I written custom code (as opposed to using zenbot vanilla): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS High Sierra
  • Zenbot version (commit ref, or version): 4.1.0
  • Zenbot branch: idk
  • NodeJS version: 8.11.2
  • Python version (when using a python script): 2.7.15 & 3.6.4
  • Exact command to reproduce (include everything):
    zenbot trade binance.ONT-BNB --strategy momentum --momentum_size 4 --period_length 30s
  • Did I make any changes to conf-sample.js?: No

Describe the problem

Some trading strategies, e.g. Momentum & Bollinger, are found malfunction in trade command. When I run the trade command, it doesn't keep polling the latest trade of the trading pair. Instead, it just keep retrieving the same trade with the same price & time for all day long.

That turns my bot into useless, as it cannot make any decisions & deems the trading pair's price as remain the same.

Yet it performs pretty well in simulation mode (not paper mode), and some trading strategies, like trend_bollinger, just work fine.

I wonder if I've input any invalid / wrong parameters. Please let me know.

Source code / Error logs

No error logs are found.

@JohnnyVicious
Copy link

They don't work under 1m period length, it is in the code at the bottom of each strategy.js

@mattopolitan
Copy link
Author

Thanks for your correction. I didn't know that there are parameter ranges under the bottom of each strategy, my mistake.

Sadly though, the issue stays the same.

@Shawn8901
Copy link
Contributor

The parameters at the bottom are just for darwin.js, no releatiob to "real" trading or strategy limits.

As the OHLC values are comming from engine i dont really understand the problem. Could you please explain a bit more and give reference to the current price feed of binance (to compare values).
Thanks

@pdelbeato
Copy link

I think I'm encountering the very same problem.

System information
Have I written custom code (as opposed to using zenbot vanilla): No
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 18.04LTS
Zenbot version (commit ref, or version): latest
Zenbot branch: master
NodeJS version: latest
Python version (when using a python script): NN
Exact command to reproduce (include everything):
./zenbot.sh trade gdax.BTC-EUR --paper --currency_capital 5000 --period 1m --debug
Did I make any changes to conf-sample.js?: No

Here it is a screenshot of the results:

unbenannt

If you have any idea of where to look so as to fix it, I really appreciate...

@pdelbeato
Copy link

After some troubleshooting...

The problem is inside the strategies.js.
I don't know why, but you have to insert this line:
this.option('min_periods', 'min. number of history periods', Number, 52)

(Obviously, the value could be whatever)

Someone can explain me why?

Thanks.

@Shawn8901
Copy link
Contributor

--min_periods or c.min_periods is one of really important value. Some Strategys set it to a decent values. As they miss-use it as length_definition for indicators.
The value defines the minimum amount of history periods to fetch before entering live tradeing.
Without a value here, the bot will hang.
There was a nice discussion about that value on discord before the server was deleted.

@pdelbeato
Copy link

Good to know. I have to say that my strategy.js file (bollinger folder) was exactly the default. So it was quite impossible for a dummy like me to understand where the problem could be in a short time.
Quite a hard work commenting/uncommenting lines to find out what to do! :-D

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants