tg12/FAIG

Opening multiple trades

Closed this issue · 1 comments

I get the following error:

Deal Number : 2 Profit/Loss : -7.199999999998909
Deal Number : 2 Profit/Loss : -7.199999999998909
Deal Number : 2 Profit/Loss : -7.199999999998909
Deal Number : 2 Profit/Loss : -7.199999999998909
Deal Number : 2 Profit/Loss : -7.0
Deal Number : 2 Profit/Loss : -7.100000000000364
Deal Number : 2 Profit/Loss : -7.0
Deal Number : 2 Profit/Loss : -6.799999999999272
HTTPSConnectionPool(host='api.ig.com', port=443): Max retries exceeded with url: /gateway/deal/positions/DIAAAACE232REAY (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f62cbf619b0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
ERROR : ORDER MIGHT NOT BE OPEN FOR WHATEVER REASON
!!Internal Notes only - Top of Loop!! : 2018-01-23T07:55:09.259391UTC+00:00
0.100835654596
-----------------DEBUG-----------------
Remaining API Calls left : 8366
-----------------DEBUG-----------------
PRICE PREDICTION FOR PRICE CS.D.GBPUSD.TODAY.IP IS : [ 13999.21924578]
-----------------DEBUG-----------------
0.985367596457
{'intercept': 52.315554733855606, 'coefficient': array([  9.97060794e-01,   2.74915286e-04]), 'predicted_value': array([ 13999.21924578]), 'accuracy': 0.98536759645657601}
-----------------DEBUG-----------------
stopDistance_value for CS.D.GBPUSD.TODAY.IP will bet set at 45
limitDistance_value for CS.D.GBPUSD.TODAY.IP will bet set at 6
STOP LOSS DISTANCE WILL BE SET AT : 40
Price Difference Away (Point's) : [-32.51924578]
!!DEBUG TIME!! : 2018-01-23T07:55:25.892142UTC+00:00
!!DEBUG TIME!! : 2018-01-23T07:55:25.892168UTC+00:00
-----------------DEBUG-----------------
200
OK

When this happens, it assumes the trade is closed and opens a new one when a new opportunity is found.
I had this happen yesterday and at some point, I had 6 trades open at the same time. It didn't open more as I hadn't enough funds for the margin.

Happened again this morning.

tg12 commented

Hello, OK this should be fixed in the latest code I pushed out last night.

HTTPSConnectionPool(host='api.ig.com', port=443): Max retries exceeded with url: /gateway/deal/positions/DIAAAACE232REAY (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f62cbf619b0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

This definately relates to a network error. Specifically DNS. This is when IG (Or your network goes down).

"Temporary failure in name resolution" - Please check your DNS.