11-03-2020, 09:12 AM
Hello everyone,
I hope i can put this here in this forum. I have no experience in JavaScript, but I have script knowledge in powershell. I'm just trying out a bit. In my current strategy I would like to buy and sell again as soon as I have a 1% profit.
The whole thing should then be repeated. I realize that this is not a good strategy but to learn and how it works in Javascript it would be interesting.
Here is my check function:
strat.check = function(candle) {
var ema = this.indicators.myema.result;
var sma = this.indicators.mysma.result;
var adx = this.indicators.myadx.result;
if(ema > sma && adx >25)
{
this.advice('long');
buyat = candle.close;
sellat = buyat / 0.99;
if(candle.close >= sellat)
{
delete buyat;
delete sellat;
this.adivce('short');
}
else
{
}
}
// your code!
}
module.exports = strat;
Sadly its not working i dont even know if im on the right path here
Any help much appriciated
I hope i can put this here in this forum. I have no experience in JavaScript, but I have script knowledge in powershell. I'm just trying out a bit. In my current strategy I would like to buy and sell again as soon as I have a 1% profit.
The whole thing should then be repeated. I realize that this is not a good strategy but to learn and how it works in Javascript it would be interesting.
Here is my check function:
strat.check = function(candle) {
var ema = this.indicators.myema.result;
var sma = this.indicators.mysma.result;
var adx = this.indicators.myadx.result;
if(ema > sma && adx >25)
{
this.advice('long');
buyat = candle.close;
sellat = buyat / 0.99;
if(candle.close >= sellat)
{
delete buyat;
delete sellat;
this.adivce('short');
}
else
{
}
}
// your code!
}
module.exports = strat;
Sadly its not working i dont even know if im on the right path here
Any help much appriciated