Looking for simple buy/sell at certain amount strategy - Printable Version +- Gekko Forum (https://forum.gekko.wizb.it) +-- Forum: Gekko (https://forum.gekko.wizb.it/forum-13.html) +--- Forum: Strategy Development (https://forum.gekko.wizb.it/forum-12.html) +--- Thread: Looking for simple buy/sell at certain amount strategy (/thread-57519.html) Pages:
1
2
|
Looking for simple buy/sell at certain amount strategy - Garem - 08-08-2018 Hi folks, I am looking for a simple buy at a certain price / sell at a certain price Startegy, offering a coffee for a solution RE: Looking for simple buy/sell at certain amount strategy - Kris191 - 08-08-2018 https://github.com/xFFFFF/Gekko-Strategies look in there might be something you can work with RE: Looking for simple buy/sell at certain amount strategy - Garem - 08-08-2018 Kris thanks. Unfortunately there's just a strategy with a certain procentage and not a certain price RE: Looking for simple buy/sell at certain amount strategy - Fez - 08-24-2018 hi , i'm looking for some like that too. i would like to have a simple strategy that buy when the price is at the price i set and put a stop loss automatically as it buy example: i want to buy LTC at 60 $ . when the price will be 60$ gekko buy it and automatically put a stop loss at 59$ or a percentual less or else the position stay open or sell at the price i will set i'm no coder , i'm usig gekko for a while i tryed few strategies but i would like to create some simple like that. i found the buyat sellat strategiy very interesting but not able to modified that thanks for helping RE: Looking for simple buy/sell at certain amount strategy - Fez - 08-24-2018 just found out this: // Source: https://raw.githubusercontent.com/imperator6/gekko/stable/strategies/FIXPRICE.js // Downloaded from: https://github.com/xFFFFF/Gekko-Strategies // helpers var _ = require('lodash'); var log = require('../core/log.js'); // configuration var config = require('../core/util.js').getConfig(); var settings = config.FIXPRICE; // let's create our own method var method = {}; // prepare everything our method needs method.init = function() { this.name = 'FIXPRICE'; this.currentTrend; this.requiredHistory = 0; if (settings.exit === undefined) { settings.exit = -1; } log.debug('New FIXPRICE', settings); } // what happens on every new candle? method.update = function(candle) { // nothing! } // for debugging purposes: log the last calculated // EMAs and diff. method.log = function() { } method.check = function(candle) { var price = candle.close; var message = '@' + price.toFixed(5) + ' (long:' + settings.long.toFixed(5) + ' short: '+ settings.short.toFixed(5) +')'; if(price <= settings.exit) { this.advice('exit'); } else if(price <= settings.long) { //log.debug('long', message); if(this.currentTrend !== 'up') { this.currentTrend = 'up'; log.debug('long advice', message); this.advice('long'); } else this.advice(); } else if(price >= settings.short) { //log.debug('short', message); if(this.currentTrend !== 'down') { this.currentTrend = 'down'; log.debug('short advice', message); this.advice('short'); } else this.advice(); } else { log.debug('we are currently not in a long or short advice', message); this.advice(); } } module.exports = method; could be working. i tested but stop loss doesn't work (exit variable) anyone can help? RE: Looking for simple buy/sell at certain amount strategy - Teo - 08-26-2018 (08-08-2018, 04:50 AM)Garem Wrote: Hi folks, https://github.com/TeoWay/Gekko-Strategies Wrote a few days ago, my first. I did not think that anyone could need it, except me. Have a good idea where it can be useful? RE: Looking for simple buy/sell at certain amount strategy - CryptoCoeus - 08-29-2018 @Teo, Your solution looks solid. Is there anyway to set prices from .toml file ? RE: Looking for simple buy/sell at certain amount strategy - Teo - 08-30-2018 Of course, you can set your own buy and sale prices in the .toml file or in a gekko itself. The strategy makes buying or selling at set prices or better. It also have a debug mode, where you can see exactly executed prices. Just set debug to true in .js file, run backtest in gekko and look at console screen where you was started the gekko. RE: Looking for simple buy/sell at certain amount strategy - Fez - 09-03-2018 great job man. i will give it a try right now. thanks RE: Looking for simple buy/sell at certain amount strategy - owl4528 - 09-20-2018 (08-30-2018, 06:52 AM)Teo Wrote: Of course, you can set your own buy and sale prices in the .toml file or in a gekko itself. Thanks Teo this is really useful. Is it easy to introduce a new variable that would execute sell1 if the price goes over by a certain amount? But then also execute buy again if the price is less than a certain amount of the previous sell1?? |