mdn522 / expertoptionapi

Abandoned project
4 stars 1 forks source link

Hi any example of API how to do login and send order #2

Closed rajkiranjeet closed 8 months ago

rajkiranjeet commented 2 years ago

Hi please share some code example ,how to login and send trade. thanks

mdn522 commented 2 years ago

I am actually not into trading for a long time and this project this abandoned. also using robots with expert option is tricky. as per my last encounter with them 2 years ago. they had very low tolerance for automated trading.

I found a simple example from 2 years ago. if it does not work you gotta figure out how to make it work or so. as I am not into it anymore.

import logging
import pause
from expertoptionapi.constants import REGION
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(message)s')

from expertoptionapi.stable_api import ExpertOption

eo = ExpertOption(token="<TOKEN>", server_region=REGION.SINGAPORE)

print('Logged in')

# print('Bought')
print(eo.api.profile.msg)

pause.seconds(300)

as far as I remember you get token from the browser's devtool's networks tab. from cookie or websocket that you have to find out yourself

rajkiranjeet commented 2 years ago

Hi thanks for quick replay any idea how to get token ?

rajkiranjeet commented 2 years ago

Hi token i got now need how to send order to exchange

rajkiranjeet commented 2 years ago

plz provide one single example

mdn522 commented 2 years ago

I don't have an example for it. I had not gone further due to their policy conflicting with robots.

I can suggest you to inspect their WebSocket request in browser's devtool's networks tab. to understand how buy, send order works.

and some files that are worth looking for similar examples on sending requests. so you can mock the send order. https://github.com/mdn522/expertoptionapi/blob/master/expertoptionapi/api.py https://github.com/mdn522/expertoptionapi/tree/master/expertoptionapi/ws/chanels

theshadow76 commented 8 months ago

Hi! if you are still looking into a expert option API bot, here is the finished project! https://github.com/theshadow76/ExpertOptionApi