harwee/IQOption-Api

Placing an order return None

Opened this issue · 4 comments

Hello. I've been facing this issue: when I place an order, the method just return None.

The question is, do you know if this is solvable?

Sometimes this is actually random! thinking

Having same issue. Just ignoring it now, but it would be nice to know a reason and fix it somehow.

@cnexans @djumpen

I think I know why this problem exists. It seems to occur in my program whenever I take a long time to select a stock to trade in.

I recently added a way for my program to pick the highest interest stock, as a result the program is always returning NONE

Let me know if this is the cause for you as well

What the hell

I just found out that even though the order returns 'None' the bet is still placed. If you run the app and your API together you will see the orders go throw. This makes it possible worse because you could be losing money while your program reflects that nothing is happening

It returns none because, it uses bidirectional socket API of IQOption and the actions are not synchronous, even if you place a bet iqoption doesn't send the confirmation immediately, there is a small delay, So the program doesn't wait for the confirmation of success.

If you want something synchronous, you have to write a function which wraps placement of bets, then run a while True async loop with a break condition checking the portfolio items, but then if there are some network errors it breaks the program as the loop never ends.

It returns none because, it uses bidirectional socket API of IQOption and the actions are not synchronous, even if you place a bet iqoption doesn't send the confirmation immediately, there is a small delay, So the program doesn't wait for the confirmation of success.

If you want something synchronous, you have to write a function which wraps placement of bets, then run a while True async loop with a break condition checking the portfolio items, but then if there are some network errors it breaks the program as the loop never ends.

Could you provide some code for that please...

I wouldn't know where to start