ok24601 / etoro-api

etoro trading REST API
ISC License
100 stars 48 forks source link

cant open SELL position #8

Open jaka87 opened 4 years ago

jaka87 commented 4 years ago

First of all good job on the script!

I have been playing around with it for few days and I cant seem to open SELL position on some ETF's. For example if I do it with bitcoin it works fine.

I tried

curl -X POST \
  http://localhost:8088/etoro-api/positions/open \
  -H 'Content-Type: application/json' \
  -H 'mode: Demo' \
  -d '{
    "name": "qqq",
    "type": "SELL",
    "amount": 2000,
    "leverage": 1
}'

and got the error {"timestamp":"2020-07-20T17:15:03.605+0000","status":500,"error":"Internal Server Error","message":"Code: 796, details: null","path":"/etoro-api/positions/open"

If i use the same command but try BUY instead it works. The only thing that comes to mind is that when "buying" QQQ is considered as ETF while when "selling" it is CFD.

Any idea ?

ok24601 commented 4 years ago

hi, thanks for reporting this issue, i'll try to get it fixed this week


От: jaka87 notifications@github.com Отправлено: 20 июля 2020 г. 19:22 Кому: oleh2208/etoro-api etoro-api@noreply.github.com Копия: Subscribed subscribed@noreply.github.com Тема: [oleh2208/etoro-api] cant open SELL position (#8)

First of all good job on the script!

I have been playing around with it for few days and I cant seem to open SELL position on some ETF's. For example if I do it with bitcoin it works fine.

I tried

curl -X POST \ http://localhost:8088/etoro-api/positions/open \ -H 'Content-Type: application/json' \ -H 'mode: Demo' \ -d '{ "name": "qqq", "type": "SELL", "amount": 2000, "leverage": 1 }'

and got the error {"timestamp":"2020-07-20T17:15:03.605+0000","status":500,"error":"Internal Server Error","message":"Code: 796, details: null","path":"/etoro-api/positions/open"

If i use the same command but try BUY instead it works. The only thing that comes to mind is that when "buying" QQQ is considered as ETF while when "selling" it is CFD.

Any idea ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/oleh2208/etoro-api/issues/8, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADHNNVUYRSCMP6XDQPLTUHTR4R4M3ANCNFSM4PCSJIRQ.