Closed alir95202 closed 3 years ago
Hey man, thanks for using pyjuque!
Please format your code properly next time, by placing it within 3 single quotes followed by py or js, depending on the language
# it will look like this
x = 1 + 4
The complete error message should show the line where the problem is, without seeing that I think the problem is at the lines that have three elements compared by a ‘<‘ sign
This
df["open"][i] < df["lbb"][i] < df["close"][i]
Should be
df["open"][i] < df["lbb"][i] and df["lbb"][i] < df["close"][i]
Hello Tudor, thanks for the answer but that doesn't work and the error is shown like this for example: INFO:pyjuque.Engine.BotController:Error computing indicators for FLM/USDT: (<class 'TypeError'>, TypeError("'<' not supported between instances of 'numpy.ndarray' and 'str'"), <traceback object at 0x000001AED60E0D00>) INFO:pyjuque.Engine.BotController:Error computing indicators for DODO/USDT: (<class 'TypeError'>, TypeError("'<' not supported between instances of 'numpy.ndarray' and 'str'"), <traceback object at 0x000001AED6BA0080>)
Hello, I tried to use the code. (Second strategy). but I keep getting this error and I just don't know where the problem is. That is the code:
import time
Imports for the strategy
import pandas_ta as ta
Importing these to be able to run this example
from the main pyjuque folder
from os.path import abspath, pardir, join import sys curr_path = abspath(file) root_path = abspath(join(curr_path, pardir, pardir)) sys.path.append(root_path)
Import for defining the bot
from pyjuque.Bot import defineBot
Import for defining the Strategy
from pyjuque.Strategies import StrategyTemplate
Defines the strategy
class BBRSIStrategy(StrategyTemplate): """ Bollinger Bands x RSI """ def init(self, rsi_len = 8, bb_len = 100, rsi_ob = 50, rsi_os = 50): self.rsi_ob = rsi_ob self.rsi_os = rsi_os self.bb_len = bb_len self.rsi_len = rsi_len
Defines the overall configuration of the bot
bot_config = {
Name of the bot, as stored in the database
}
Runs the bot in an infinite loop, stoppable from the terminal with CTRL + C
def Main(): bot_controller = defineBot(bot_config) while True: try: bot_controller.executeBot() except KeyboardInterrupt: return
if name == 'main': Main()