(symbol)
| 185 | |
| 186 | # Close open orders for the needed symbol. If one stop order is executed and another one is still there |
| 187 | def close_open_orders(symbol): |
| 188 | try: |
| 189 | response = client.cancel_open_orders(symbol=symbol, recvWindow=6000) |
| 190 | print(response) |
| 191 | except ClientError as error: |
| 192 | print( |
| 193 | "Found error. status: {}, error code: {}, error message: {}".format( |
| 194 | error.status_code, error.error_code, error.error_message |
| 195 | ) |
| 196 | ) |
| 197 | |
| 198 | |
| 199 | # Strategy. Can use any other: |