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

just solved it, i had to update my OS. I updated from Sierra to Mojave.

1 Like

What do you do if you use Linux?

1 Like

You can use npm or yarn both are package managers and you can have both installed, i do use both of them (some packages use yarn, some npm).

Carlos Z

Cool, thanks Carlos.

Troy

In the homework. of making the minute, day, hour MA
when im trying to code the dayMA it doesnt recognize the property close.
i did minute and hour MA ok.
i even copied the code from the others and fixed the names many times but it appears the same error again and again…
can anyone. help me please?Captura de Pantalla 2021-05-13 a la(s) 13.34.28

1 Like

Hey @Eduardo_Carrillo, hope you are ok.

Please provide your code in the following way:

Then i will try to replicate your issue to give you a feedback :nerd_face:

Carlos Z

I am getting this error message. Though the file is there, power shell is stating it isn’t there. Please advise
Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\ragib> cd “C:\Users\ragib\OneDrive\Documents\botjs\bot.js”
cd : Cannot find path ‘C:\Users\ragib\OneDrive\Documents\botjs\bot.js’ because it does not exist.
At line:1 char:1

  • cd “C:\Users\ragib\OneDrive\Documents\botjs\bot.js”
  •   + CategoryInfo          : ObjectNotFound: (C:\Users\ragib\...ts\botjs\bot.js:String) [Set-Location], ItemNotFoundE
     xception
      + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
    
    

PS C:\Users\ragib> cd “C:\Users\ragib\OneDrive\Documents\botjs\bot2.js”
cd : Cannot find path ‘C:\Users\ragib\OneDrive\Documents\botjs\bot2.js’ because it does not exist.
At line:1 char:1

  • cd “C:\Users\ragib\OneDrive\Documents\botjs\bot2.js”
  •   + CategoryInfo          : ObjectNotFound: (C:\Users\ragib\...s\botjs\bot2.js:String) [Set-Location], ItemNotFoundE
     xception
      + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
    
    

PS C:\Users\ragib>

thank you, I’ll try this option

PS C:\Users\ragib\OneDrive\Documents\botjs> Is this OK? (yes)

PS C:\Users\ragib>
PS C:\Users\ragib> cd “C:\Users\ragib\OneDrive\Documents\botjs”
PS C:\Users\ragib\OneDrive\Documents\botjs> npm install yarn --global

[email protected] preinstall C:\Users\ragib\AppData\Roaming\npm\node_modules\yarn
:; (node ./preinstall.js > /dev/null 2>&1 || true)

C:\Users\ragib\AppData\Roaming\npm\yarn -> C:\Users\ragib\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js
C:\Users\ragib\AppData\Roaming\npm\yarnpkg -> C:\Users\ragib\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js

  • [email protected]
    added 1 package in 4.944s
    PS C:\Users\ragib\OneDrive\Documents\botjs> “C:\Users\ragib\OneDrive\Documents\botjs\bot.js”
    C:\Users\ragib\OneDrive\Documents\botjs\bot.js
    PS C:\Users\ragib\OneDrive\Documents\botjs> npm install yarn --global

[email protected] preinstall C:\Users\ragib\AppData\Roaming\npm\node_modules\yarn
:; (node ./preinstall.js > /dev/null 2>&1 || true)

C:\Users\ragib\AppData\Roaming\npm\yarnpkg -> C:\Users\ragib\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js
C:\Users\ragib\AppData\Roaming\npm\yarn -> C:\Users\ragib\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js

I followed the path for yarn. When I try to install it does not let me or recognize the file. I went into windows and set it to enable scripting.
the file will not install. What do you suggest?
Thank you, Rachel

1 Like

Hey @Rachel3, hope you are ok.

What is exactly the issue? you have installed yarn properly (apparently no errors).

Some times powershell might run into issues with some programs. I advice you to use the windows console (CMD) that one will give you less issues.

basically you should learn how to move into folders in CLI (command line interface), cd is the command keyword you use to go into a folder… the first error in your post is that your path finish with a file, so cd is not intended to open the file, just the folder, so any time you need to go into a folder, just finish the path with the folder name like your example :nerd_face:

Carlos Z

Hi!
Please help me.
I can not mark “Installing NodeJS & Atom” lecture complete. It just doesn not happen. I tried several times, but it just cannot let me move on. In other courses it works.

Hey @balintdaniel13, i assume you refers to the Academy 2.0, please try again, we have done some fixes on those lesson related to the same issue.

If still persist, let us know to solve it asap.

Carlos Z

Hi!
I am trying to do the buy order from the lesson, but my order gets automatically cancelled, below the code and response:
const GeminiAPI = require(“gemini-api”).default;

const secret = “2BhC7gzpYGMQTn3MtKaDUEqg47SN”;
const key = “account-dPQJYSZHgcy06XlZnjkc”;
const restClient = new GeminiAPI({key, secret, sandbox:true});

restClient.newOrder({amount:10, price:100, side:“buy”, symbol:“btcusd”})
.then(response => console.log(response));

======================

{
order_id: ‘945513061’,
id: ‘945513061’,
symbol: ‘btcusd’,
exchange: ‘gemini’,
avg_execution_price: ‘0.00’,
side: ‘buy’,
type: ‘exchange limit’,
timestamp: ‘1623240606’,
timestampms: 1623240606164,
is_live: false,
is_cancelled: true,
is_hidden: false,
was_forced: false,
executed_amount: ‘0’,
client_order_id: ‘U9npblP5i’,
reason: ‘ExceedsPriceLimits’,
options: [],
price: ‘100.00’,
original_amount: ‘10’,
remaining_amount: ‘10’
}

Can you help me? I cannot find the error.

2 Likes

hey @Ana.Barreto, hope you are ok.

Would you please also share an screenshot of the error? that will help us to review properly where is the error of your code. :nerd_face:

Also would be great to provide the code in the following way:
https://forum.ivanontech.com/t/faq-how-to-post-code-in-the-forum/3535

Carlos Z

Hey guys,

I’m using MacOS. Node.js and the npm are working fine when using it in the terminal/command line. But when trying to install Yarn I’m getting an error message.

error yarn

Can’t manage to solve it. Appreciate any help.

Thanks!!!

Robert

1 Like

hey @Robert12, hope you are ok.

You might have to run the commands with admin privilege try to add sudo at the start of entire command (Example: sudo npm install), sudo is the keyword to use admin privileges on the terminal.

Carlos Z

@thecil Solved it. Thx!!!

1 Like

Hi @thecil,
I refer to Ivan’s video “Building MA strategy”. At the end when programming the 2nd if-statement (Sell condition).
Did he forget to amend the function “exchange.marketBuyBitcoin” into "“exchange.marketSellBitcoin”?
strategy_error

Best regards,
Robert

1 Like

Indeed, nice catch, it should change it to SellBitcoin, but might be that he just forgot on that moment. :nerd_face:

Carlos Z

1 Like

Hi guys

I thought I followed everything that Ivan did, but I must be missing something. Can someone take a look and see if you can see what I’m missing?

Here is my code:

const GeminiAPI = require(“gemini-api”).default;
const secret = “5rWhrEsP2hBjFKLjU7qTJxYSAEw”;
const key = “bAynhBcbELVwPDBrRL5o”;
const restClient = new GeminiAPI({key, secret, sandbox:true});
restClient.newOrder({amount:10,price:100,side:“buy”,symbol:“btcusd”})
.then(response => console.log(response));

And here is my error:

PS E:\BUSINESS\Bitcoin\IvanOnTechAcademy\Bot> node index.js
node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason “#”.] {
code: ←[32m’ERR_UNHANDLED_REJECTION’←[39m

Thanks in advance for your assistance.

1 Like