ok24601 / etoro-api

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

Get the opening price of a position #14

Closed jpdom closed 3 years ago

jpdom commented 3 years ago

Hi ! First of all congratulations, this is a fine piece of work! I was wondering if when we open a position we can get the price at which it was opened in the response object. This is very useful because you almost never can open a position at the price you were "watching" it when you made the decision to buy.

Thanks in advance!

ok24601 commented 3 years ago

Hi, thanks for your feedback. you are right, the price which you are using in open position request can be diffrent from the it'll be opened by etoro because price can be changed while request is being sended. I just added "openRate" property to the EtoroPosition, check out latest master and try it out.

jpdom commented 3 years ago

Hi @oleh2208 ! Thanks for the quick solution! Could you please update the docker image so I can pull it ? For some reason I cannot build one myself :/

jpdom commented 3 years ago

Just FYI this is the error I get trying to build the image: C:\Users\joaop\Documents\MTB\etoro-api>docker build -t etoro-api . Sending build context to Docker daemon 224.8MB Step 1/8 : FROM openjdk:11-jdk-slim AS builder ---> 8206ad34e1d2 Step 2/8 : RUN apt update && apt-get install libfontconfig -y ---> Using cache ---> 48d22a901e55 Step 3/8 : WORKDIR /artifact/app ---> Using cache ---> 08a51d24fb48 Step 4/8 : COPY . . ---> Using cache ---> d9217009c066 Step 5/8 : RUN ./gradlew build ---> Running in 7a0a7ea7e341 /usr/bin/env: ‘sh\r’: No such file or directory The command '/bin/sh -c ./gradlew build' returned a non-zero code: 127

jpdom commented 3 years ago

Actually I see that you build push action failed, opened and issue for that :) #15

jpdom commented 3 years ago

Fixed the error while building, the issue was that because i'm using windows I had to set : git config --global core.autocrlf false

Because of the different line endings in windows and linux.

I've tested the new property returned in "OpenPosition" and it works perfectly, closing this issue 👍