Javascript bot programming using Gemini API, NodeJS and CryptoCompare - DISCUSSION

Greatings to all. I had some problems running PowerSell at the begining. For some reason i found it was blocked from my antivirus(avast) for some reason and i had to restart my computer so it could finally work. Secondly i had the same problem as @CryptoKomuna. For some reason windows 10 has all execution policies set as undefined on my system.


On the foto you can see the first time error for yarn add gemini-api.(first big red paragraf)
Then i typed in : Get-ExecutionPolicy - list with this you can see all the execution policy.
In my case everything is undefined so i choosed the current user . The green underlined is the code to set it off. The system asks you to verify yes, yes to all, no, no to all, suspend, help. I have choosen Y and it worked when i set yarn again. Here is a useful link for this problem like in previous comment @noobon3 mentiond https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7

2 Likes

Still not working gemini in germany :frowning: I hope there will be soon a cover of the course on another europian exchange like gemini. Any one know about cryptoAPIs or CoinAPI?or another exchance exept bitmex?
After trying things out i found that if you go directly to https://exchange.sandbox.gemini.com/ it also lets germans subscribe even without vpn just use the exact adress of Ivans videos.

1 Like

I found it a little bit disappointing that I could follow your instructions because I am working with a Mac. Any solutions?

1 Like

We would need to see your code. But the error code says that you didn’t include a catch block. See lesson 15 " Gemini API Walkthrough"

@ivan
@filip

Building MA Strategy

Javascript bot programming using Gemini API, NodeJS and CryptoCompare

Great lessons that made many things clearer to me! Thank you!

However I found a small coding error:

Ivan changed the console.log commands correctly, but he missed to change the API call for selling the position from marketBuyBitcoin to marketSellBitcoin:

exchange.marketSellBitcoin() 

should be correct!

1 Like

Thank you for letting us know. We’re probably looking at updating this course soon.

2 Likes

It should be pretty straight forward to use the Mac terminal. Any specific issues I can help with?

i cant install i cant see power shell after i installed nodejs!
im a mac user!
can someone help me!?

1 Like

On Mac you use something called Terminal. You should be able to find it.

1 Like

i have problems installing yarn! can someone help me ?

1 Like

Hi Everyone!
Can’t figure out what is wrong here
Help plz :slight_smile:

LOL omg it took me 12 hours to realize that i Wrote “sandobox”…hahaha
finally I made it!!!

3 Likes

so im trying to create the bot but when i go on terminal and look for the the index.js it wont find it and from there i cant keep going! i tried and tried and nothing is happening

Well, gemini not available in Venezuela, on to another course I suppose, Binance would have worked…

—EDIT----
I have resolved this issue by setting to:

Set-ExecutionPolicy Bypass -Scope UserPolicy
----END EDIT----

ARGHGHG!!! OK I’ve calmed down now. I am having the same issues as others as regards to this message " yarn : File C:\Users\user\AppData\Roaming\npm\yarn.ps1 cannot be loaded. The file C:\Users\user\AppData\Roaming\npm\yarn.ps1 is not digitally signed. You cannot run this script on the current system."

I have tried changing various parameters but there was an override stopping me. I have now reset everything to Undefined… Please advise…

GEMINI SANDBOX
I can’t register with gemini sandbox the screen is blank. I tried using a VPN and it seems to work when selecting UK (I tried France and Sweden but that didn’t work either.) Will I get into trouble for this?!

Same issue here. It shows blank page for me as well.

I just went ahead and used a VPN - localisation UK (I’m not in the UK) as the exercise is not for real, I don’t think it should be a problem. I used a French phone number for sms verification and there were no issues.

1 Like

Hi I get the same errors. Did you resolve this issue?

I have seen other posts on this issue but with no response…
It seems as if only on moving average is possible because when I have all three I get errors saying “'whatever’MovingAverage is not a function” but they work individually… Am I right in thinking this or is there something I missing

Here is my code:

------FROM INDEX----------
indicators.hourlyMovingAverage(‘BTC’,‘USD’,50,function(result){
console.log("HMA: ", result)});
indicators.dailyMovingAverage(‘BTC’,‘USD’,7,function(result){
console.log("DMA: ", result)});
indicators.minuteMovingAverage(‘BTC’,‘USD’,60,function(result){
console.log("minMA: ", result)});

-------FROM INDICATORS---------

module.exports = {

hourlyMovingAverage:function (cryptoAsset,fiatCurrency,hours,callback){
//when function in curley brackets -> functionName:functionName
if(hours>169){
console.error(“Only up to 169 hours allowed!”)
return
}

//1get data from CC (or other)
CryptoCompareAPI.histoHour(cryptoAsset, fiatCurrency)
.then(data => {
data = data.reverse()
var sum = 0;
for(var i = 0;i<hours;i++){
sum+=data[i].close;
}

var hourlyMovingAverage = sum/hours;
callback(hourlyMovingAverage);

})
.catch(console.error)
}};

module.exports = {

dailyMovingAverage:function(cryptoAsset,fiatCurrency,days,callback){

if(days>7){
console.error("Only up to 7 days allowed!")
return

}

CryptoCompareAPI.histoDay(cryptoAsset, fiatCurrency)
.then(data => {
data = data.reverse()
var sum = 0;
for(var j = 0;j<days;j++){
sum+=data[j].close;
}

var dailyMovingAverage = sum/100;
callback(dailyMovingAverage);

})
.catch(console.error)
}}

module.exports = {

minuteMovingAverage:function(cryptoAsset,fiatCurrency,minutes,callback){

if(minutes>10080){
console.error("Only up to 10'080 minutes allowed!")
return

}

CryptoCompareAPI.histoMinute(cryptoAsset, fiatCurrency)
.then(data => {
data = data.reverse()
var sum = 0;
for(var min = 0;min<minutes;min++){
sum+=data[min].close;
}

var minuteMovingAverage=sum/minutes;
callback(minuteMovingAverage);

})
.catch(console.error)
}}