Accessing error codes after unsuccessful trade action (e.g. Buy now)
-
Hi there,
using the "Buy now" or "Sell now" blocks, in some cases it occurs that the opening of the requested trade is not possible - for whatever reason (e.g. insufficient margin, just to name one)To the grey outcome (unsuccessful) I attached a "custom code" block with "Print("ERROR: Opening BUY failed. ErrorCode: " + GetLastError()); "
This shows me that the grey outcome has been activated. It should print the reasons for error. However it prints ErrorCode 0, meaning "no error". This means that the error has been read by another block first, but it is not printed to the log.Any suggestions? - Otherwise this is feature request to log error codes after reading them.
cheers
-
If you are using custom code blocks it means you are a programmer. I'm afraid your answer should be offered bu other programmers like miro or roar.
-
Hi, have you found any solution to this? Sometimes “modify stop” blocks go for the grey outcome and I can’t get the last error.. and I’m struggling to understand what’s going on...