I'm new here at Gekko - Problems
#1
I made a strategy where every time they cross the middle, buy or sell.

I'm working with binance ...

What is certain is that theft opens but then closes soon.

Can someone explain what I'm doing wrong?

Code:
/ GTR
var strat = {};

// Prepare everything our strat needs
strat.init = function() {
 this.name = 'GTR';
 this.trend = 'none';

 this.requiredHistory = this.tradingAdvisor.historySize;


 this.addTulipIndicator('slow', 'ema', {
   optInTimePeriod: this.settings.slow
 });

 this.addTulipIndicator('fast', 'ema', {
   optInTimePeriod: this.settings.fast
 });


}

// What happens on every new candle?
strat.update = function(candle) {

}

strat.log = function(candle) {
 // nothing!
}


strat.check = function(candle) {

 const ema1 = this.tulipIndicators.slow.result.result;
 const ema2 = this.tulipIndicators.fast.result.result;
 var   priceclose = candle.close;
 //console.dir(ema1)


   if (ema1 > ema2){
       this.trend = 'Compra';
       this.advice('long');

       console.dir(this.trend)
   }

   if (ema1 < ema2){
     this.trend = 'Venda';
     this.advice('short');

     console.dir(this.trend)
   }    


}

module.exports = strat;


Attached Files
.jpg   Screenshot_1.jpg (Size: 169.61 KB / Downloads: 9)
  Reply
#2
Going to graduate school was a positive decision for me. I enjoyed the coursework, the presentations, the fellow students, and the professors. And since my company reimbursed 100% of the tuition, the only cost that I had to pay on my own was for books and supplies. Otherwise, I received a free master’s degree. All that I had to invest was my time. Vakantiehuis huren
  Reply


Forum Jump:


Users browsing this thread: