gekko | A bitcoin trading bot written in node - https://gekkowizbit/ | Cryptocurrency library

 by   askmike JavaScript Version: 0.0.9 License: MIT

kandi X-RAY | gekko Summary

kandi X-RAY | gekko Summary

gekko is a JavaScript library typically used in Blockchain, Cryptocurrency, Bitcoin applications. gekko has no bugs, it has a Permissive License and it has medium support. However gekko has 1 vulnerabilities. You can install using 'npm i gekko' or download it from GitHub, npm.

Gekko is a Bitcoin TA trading and backtesting platform that connects to popular Bitcoin exchanges. It is written in JavaScript and runs on Node.js.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              gekko has a medium active ecosystem.
              It has 9946 star(s) with 4034 fork(s). There are 708 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 0 open issues and 2092 have been closed. On average issues are closed in 73 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of gekko is 0.0.9

            kandi-Quality Quality

              gekko has 0 bugs and 0 code smells.

            kandi-Security Security

              gekko has 1 vulnerability issues reported (0 critical, 0 high, 1 medium, 0 low).
              gekko code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              gekko is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              gekko releases are available to install and integrate.
              Deployable package is available in npm.
              Installation instructions are available. Examples and code snippets are not available.
              gekko saves you 8 person hours of effort in developing the same functionality from scratch.
              It has 24 lines of code, 0 functions and 244 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed gekko and discovered the below as its top functions. This is intended to give you an instant insight into gekko implemented functionality, and help decide if they suit your requirements.
            • Converts a number to a number .
            • Computes the linest .
            • create a humanizer
            • apply highlight to the canvas
            • Calculates days in the current date .
            • Ensures that a and b are valid
            • Convert time time to ISO 8601 format
            • Implementation of i . e .
            • Day of a language list
            • Scale values by y axis .
            Get all kandi verified functions for this library.

            gekko Key Features

            No Key Features are available at this moment for gekko.

            gekko Examples and Code Snippets

            No Code Snippets are available at this moment for gekko.

            Community Discussions

            QUESTION

            Solving linear programming by python
            Asked 2022-Feb-24 at 19:57

            I want to solve linear programming with Python. The model is:

            ...

            ANSWER

            Answered 2022-Feb-24 at 19:57

            As I mentioned in the comment section, simply changing sum(x1 , x2) to x1 + x2 should solve the issue. Also, you should try Solving the model with model.solve()! so:

            Source https://stackoverflow.com/questions/71257238

            QUESTION

            How to use Gekko to solve for optimal control for a reusable reentry vehicle
            Asked 2022-Jan-16 at 05:50

            I am seeking to find optimal control (aoa and bank angle) to maximize cross range for a shuttle type reentry vehicle using Gekko. Below is my code currently and I am getting a "Solution not found" with "EXIT: Maximum Number of Iterations Exceeded". The simulation assumes a point mass with a non-rotating earth frame. The EOMS are 6 coupled, non-linear ODEs. I have tried using different solvers, implementing/removing state and control constraints, increasing maximum number of iterations, etc. I am not confident with my setup and implementation of the problem in Gekko and am hoping for some feedback on what I can try next. I have tried to follow the setup and layouts in APMonitor's Example 11. Optimal Control with Integral Objective, Inverted Pendulum Optimal Control, and Example 13. Optimal Control: Minimize Final Time. Solutions I'm seeking are below.

            Any help is very much appreciated!

            ...

            ANSWER

            Answered 2022-Jan-14 at 04:17

            I got a successful solution by decreasing the final time (max=0.04 for successful solution) and rearranging the equations to avoid a possible divide-by-zero:

            Source https://stackoverflow.com/questions/70700585

            QUESTION

            GEKKO: Error in syntax of function string
            Asked 2022-Jan-15 at 05:50

            I'm having trouble understanding an error message I'm getting from my GEKKO model.

            For context, this model is supposed to optimize the gas spring force and dimension parameters of a gas-spring assisted door to minimize the operator force required to close the door. My intent is to calculate the required force at a series of angles between 0 and 90 degrees, then sum the absolute value of the force at all angles and minimize that value. There is also a constraint on the gas spring length so the optimization doesn't come up with unrealistic dimension parameters. I've defined the force and other values that need to be computed at each angle as lists of Intermediate variables.

            The error appears to be related to one of these lists of Intermediate variables, but I don't know how to interpret "Position: 2" in the error message, let alone "Error in syntax of function string". I've searched in some other answers on here, but I haven't found a clear answer on how to use this position information to troubleshoot the model. What is the message trying to tell me?

            ...

            ANSWER

            Answered 2022-Jan-15 at 05:44

            One way to locate the error is to open the run directory and inspect the text model file gk_model0.apm.

            Source https://stackoverflow.com/questions/70713632

            QUESTION

            MEAS of MV when fstatus=1
            Asked 2021-Sep-03 at 18:20

            everyone and Professor John

            We are using gekko to do MPC on tclab simulation model. We try to emulate the situation that on site the actuator deviates from MV calculated by gekko because of the problems of actuator.

            If the deviation is in the fixed pattern, for example a quite big constant deviation happens for a long time and may come back then work well for a long time. We can deal with it by extra logic to detect deviation and add the deviation value to the mv calculated by gekko.

            one day, I noticed that there could be meas for MV when fstatus = 1. So I gave it a try. I hope gekko could deal with the deviation by itself. for example, if mv from gekko is 10 and the measurement is 5 and the pattern continues, gekko may spit out a higher MV value than 10, for example 15 and measurement is 10.

            In the simulation, when I set MV's fstatus=1, the MV's curve becomes to :

            q1a is the q1 with manual deviation. In the above pic, q1a == q1. It looks like gekko takes one more step thinking about the MV's effect.

            In the below pic, there are two times range, one with "q1a == q1+20" and the other with "q1a == q1 -20". q1a's value is fed to tclab and mv(q1)'s meas.

            I do not understand why the q1 calculated by gekko is going up or going down when meas deviates despite the t1 is going far away from sp.

            Edit: Example Code

            See the screen shot below from "normal" HMI. The sluggish MV disappeared, so it maybe caused by bug in my code. But the up-going or down-going could still be seen. See my code below:

            ...

            ANSWER

            Answered 2021-Sep-03 at 18:20

            Is the FSTATUS also ON for the CVs such as t1.FSTATUS=1? If you update the measurement such as:

            Source https://stackoverflow.com/questions/69026508

            QUESTION

            Solving optimal control problem with constraint x(0) + x(2) =0 with GEKKO
            Asked 2021-Aug-18 at 16:17

            I am starting to learn Gekko and I am testing optimal control problems. I am trying to solve the following optimal control problem with Gekko

            The solution of this problem is (x_1(t) = (t-2)^2 - 2) How to build the constraint x(0) + x(2) = 0? My code gives me a wrong solution.

            ...

            ANSWER

            Answered 2021-Aug-18 at 16:17

            Use m.integral or m.vsum() to create a time weighted summation or vertical summation along the time direction. Here is a solution that replicates the exact solution.

            Source https://stackoverflow.com/questions/68727546

            QUESTION

            GEKKO. X value does not go beyond certain point
            Asked 2021-Apr-27 at 04:13

            I need to solve 1D plane flight optimal control problem. I have a plane that is 1000m high. I need it to travel certain distance (x) forward along x-axis while minimizing fuel consumption. And when it achieves travels that distance x I need program to stop. This function controls it: m.Equation(x*final<=1500).

            And for some reason during the simulation my x value does not want to go higher than 1310.

            How could I fix that "blockage"?

            My gekko script:

            ...

            ANSWER

            Answered 2021-Apr-27 at 04:13

            The lower bound on Tcontr is preventing the x value from going above 1310. Setting the lower value to 0.1 improves the final value of x to 2469.76 if the constraint m.Equation(x*final<=1500) is removed.

            Source https://stackoverflow.com/questions/67257715

            QUESTION

            Constraining a Mixed-Integer Non-Linear optimization problem by L0-norm/number of non-zero elements in GEKKO
            Asked 2021-Jan-24 at 15:18

            I want to minimize the cost for achieving a given set of non-negative integer values b that are computed linearly from two sets of non-negative integer variables x, y in GEKKO. If have stated my problem in a way, that the b's are constraints on the x & y. My cost function is non-linear: quadratic using a conditional/minimum. In addition to these standard constraints, I have a constraints which requires the number of non-zero elements in x is at least as large as the largest element in x (e.g. that the L0-norm is equal to the LInifity-norm).

            My difficulty is now twofold, since I'm fairly new to optimization and a novice in GEKKO.

            1. I saw that GEKKO supports numpy arrays which would make the problem statement rather concise, but I struggle to get it to work - resulting in a lot of list comprehensions instead of vectorized operations.
            2. I managed to define the L0-norm constraint and GEKKO actually runs with it, but it fails to find a solution. I recognize that L0 problems are really hard (e.g. combinatoric), but somehow the solution is fairly easy to find by "hand". I feel just that I'm doing something wrong.

            I would appreciate any help! Here is what I have done so far:

            ...

            ANSWER

            Answered 2021-Jan-24 at 15:18

            Gekko uses gradient-based solvers so the equations shouldn't change iteration-to-iteration. There is a way to get the count of non-zero variables that is compatible with gradient based solvers. Here is an alternative form to give you count and max for your x vector. This uses if3, max3, and min3 as found in the documentation on Model Building Functions with logical conditions.

            Source https://stackoverflow.com/questions/65863807

            QUESTION

            GEKKO Exception: @error: Max Equation Length (Number of variables greater than 100k)
            Asked 2021-Jan-23 at 15:57

            I need to run an optimization for 100k to 500k variables, but it gives me max equation length reached an error. Can anyone help me out to set up this problem? Time is not a constraint as long as it takes 3-4 hours to run, it's fine.

            ...

            ANSWER

            Answered 2021-Jan-23 at 15:57

            When creating a question, it is important to have a Minimal Example that is complete. Here is a modification that creates a random DataFrame with n rows.

            Source https://stackoverflow.com/questions/65852719

            QUESTION

            Gekko: Problem with the obtained solution
            Asked 2021-Jan-13 at 13:52

            I am trying to solve the following Optimal Control Problem in GEKKO:

            I know a priori that the path for c is:

            where the parameter values are: r = 0.33, i = 0.5, K(0) = 10 and T = 10.

            I wrote the following code in Python:

            ...

            ANSWER

            Answered 2021-Jan-13 at 13:52

            The optimal control problem as it is currently written is unbounded. The value of c will go to infinity to maximize the function. I set an upper bound of 100 on c and the solver went to that bound. I reformulated the model to reflect the current problem statement. Here are a few suggestions:

            1. Use the m.integral() function to make the model more readable.
            2. Initialize c at a value other than 0 (default). You may also want to set a lower bound with c>0.01 so that m.log(c) is not undefined if the solver tries a value <0.
            3. Only use Gekko functions inside Gekko equations such as with factor = m.exp(rate). Use factor = np.exp(rate) instead unless it is in a Gekko equation where it can be evaluated.
            4. Include a plot of the exact solution so that you can compare the exact and numerical solution.
            5. Use m.options.NODES=3 with c=m.MV() and c.STATUS=1 to increase the solution accuracy. The default is m.options.NODES=2 that isn't as accurate.
            6. You can free the initial condition with m.free_initial(c) to calculate the initial value of c.

            Source https://stackoverflow.com/questions/65689673

            QUESTION

            Issue with integer optimization with Gekko
            Asked 2021-Jan-02 at 23:29

            I tried with this code and the result was (2,2). Obviously it's not true, since (0,4) is a best solution. could you please tell me where is it the problem?

            ...

            ANSWER

            Answered 2021-Jan-02 at 23:29

            All of the solvers (m.options.SOLVER with 1=APOPT, 2=BPOPT, 3=IPOPT) find the local maximum point (2,2) with initial guess (0,0) and other initial guesses as well. There are two local optima at (0,4) and (4,0). This is a non-convex optimization problem. The solvers are nonlinear convex optimization solvers so they "should" find one of the local solutions. This problem reminds me of a saddle point problem if you rotate the graph to orient with the x0=x1 line. Optimizers can have problems with saddle points if there is no check for an indefinite Hessian.

            Better initial guesses help the solver find the optimal solution such as x0=1 and x1=3. Also, an upper bound <1.999 on one of the variables or a lower bound of >2.001 also finds the optimal value. The constraints limit the search region so that it is a convex optimization problem and avoids the saddle point.

            Source https://stackoverflow.com/questions/65542898

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            Gekko 0.8.2 and earlier stores sensitive information under the web root with possibly insufficient access control, which might allow remote attackers to read certain files under temp/, as demonstrated by a log file that records the titles of blog entries. NOTE: access to temp/ is blocked by .htaccess in most deployments that use Apache HTTP Server.

            Install gekko

            See the installing Gekko doc.

            Support

            See the documentation website.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i gekko

          • CLONE
          • HTTPS

            https://github.com/askmike/gekko.git

          • CLI

            gh repo clone askmike/gekko

          • sshUrl

            git@github.com:askmike/gekko.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link