I have a few questions concerning trade executions going from Excel to IB's TWS platform (via DDE).
As far as I know IB doesn't permit Excel to tell TWS to "close" a trade for example but can just say BUY or SELL, and not, more correctly "OPEN BUY", "CLOSE BUY", "OPEN SELL" and "CLOSE SELL".
This has caused me a big loss when my system, due to some bug (that I am trying to find and solve), has tried closing a short position twice, by saying "buy" and correctly closing it, and then again "buy", and opening an unwanted long position, which stayed open all day, and caused me losing 100 points on the YM.
First of all, obviously, I have to solve the bug that causes such repeated orders, but I would like to know if there are other precautions I can take.
Is there a way for example to say "close trade", instead of having to just say each time "buy 1" or "sell 1"? This way if I closed a trade twice it would just give me error and do nothing. Much better than having it open a trade in the wrong direction.
Do you have any suggestions on how to constantly monitor your position with the broker (in TWS) and make sure it matches your position on the excel workbook?
There are several ways I am sure, and I have seen the account sheet on the sample IB workbook, but do you have advice on what the best method is? Thank you.
As far as I know IB doesn't permit Excel to tell TWS to "close" a trade for example but can just say BUY or SELL, and not, more correctly "OPEN BUY", "CLOSE BUY", "OPEN SELL" and "CLOSE SELL".
This has caused me a big loss when my system, due to some bug (that I am trying to find and solve), has tried closing a short position twice, by saying "buy" and correctly closing it, and then again "buy", and opening an unwanted long position, which stayed open all day, and caused me losing 100 points on the YM.
First of all, obviously, I have to solve the bug that causes such repeated orders, but I would like to know if there are other precautions I can take.
Is there a way for example to say "close trade", instead of having to just say each time "buy 1" or "sell 1"? This way if I closed a trade twice it would just give me error and do nothing. Much better than having it open a trade in the wrong direction.
Do you have any suggestions on how to constantly monitor your position with the broker (in TWS) and make sure it matches your position on the excel workbook?
There are several ways I am sure, and I have seen the account sheet on the sample IB workbook, but do you have advice on what the best method is? Thank you.