Code Monkey home page Code Monkey logo

Comments (3)

sthewissen avatar sthewissen commented on August 20, 2024

At this point I'm fairly sure that there's not. It would probably require some additional code where the bot checks the current trades for their profit rate. The Prepare method is mainly used for defining entry and exit points.

from mynt.

brspurri avatar brspurri commented on August 20, 2024

A few thoughts here that I think might be simple. Open for a discussion. In prepare(), the buy and sell signals are denoted as 1 and -1 respectively (as mentioned above). This limits one open trade allowed at a time. However, if we change those values to incrementing values representing different simultaneous buys and sells, then the prepare() method will effectively allow overlapping open orders of the same coin - effectively allowing hedging.

So a result list might looks like:

[ 0 0 1 0 0 2 0 0 -2 0 0 -1 ...]

Indicating two "buys" open at the same time where the second order is sold prior to the first order. (Just a hypothetical). I am working on cleaning up the code in my fork, then will submit a pull request. But wanted to open this up for a discussion before.

from mynt.

sthewissen avatar sthewissen commented on August 20, 2024

On the develop branch the 0/1/-1 system is replaced by a TradeAdvice enum which should provide more flexibility in writing a strategy. Since the strategies are what you make of them it's quite easy to simply generate multiple sell signals in a row. They don't always have to have a matching sell signal. You could add a TradeAdvice called Hedge and use that in your strategy. Some hedging constants will probably need to be added to define a hedging strategy.

from mynt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.