Lu-Yi-Hsun / iqoptionapi

IQ Option API
372 stars 289 forks source link

Speed of multiple trades on same bar #81

Open lp1982 opened 5 years ago

lp1982 commented 5 years ago

Hi,

When I use the buy() function multiple times to send multiple orders on the same bar close, the delay between these trades is such that it comes to a 1 second lag between every every few trades beign executed. For example, if I trade the first five expiry times for EURUSD on the same signal, there will be a second's delay or worse between the first and last trade. Same thing if I try to trade two pairs at the same time. With five EURUSD and five GBPUSD trades, for example, I end up with a 3- or 4-second lag between the first and last trade.

Is there any way around this? Is it possible, for instance, to send multiple orders at once instead of one-by-one?

Thanks.

Mecabot commented 5 years ago

Hi, 3-4 seconds between trades is much, I improved the time taking the decision before make the trade and putting all trades inside a loop, It just take 1 second average or 2 seconds maximum.

I have attached an image as example:

image

Currently, I didn´t find the way in order to send multiple orders at once instead.

Lu-Yi-Hsun commented 5 years ago

@lp1982

fix way 1. you can write multiprocessing for EURUSD.. GBPUSD..

fix way 2. i will try to find how to speed up the buy, or multi buy

lp1982 commented 5 years ago

Thanks!

Lu-Yi-Hsun commented 5 years ago

@lp1982 fix way 1. multiprocessing

try this sample ,it can speed up buy() https://github.com/Lu-Yi-Hsun/iqoptionapi/issues/14#issuecomment-478978622

Mecabot commented 5 years ago

Multiprocessing is a topic that needs to be handled with particular care because you are creating several IQ clients over the same IP.

Lu-Yi-Hsun commented 5 years ago

@Mecabot @lp1982

try last version ,i add multi buy function