Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
- Twsapi
- Messages
Search
Correct DDE syntax to catch errors PLEASE
Chas_watkins
Here is what the readme says for the DDE interface
New DDE-supported tag for displaying errors Another DDE-supported tag has been added for returning errors on Excel spreadsheets. The syntax is <username>=|error!error. How do I set this up in a cell on Excel. I can decode the other DDE stuff from the spreadsheet but this has me stumped. I would of thought the syntax would be "=cdemo|error!error" but that does n't seem to do anything. Help please Chas |
Re: twsapi: Problem Bid -Ask Labelcolor
Nick
Giving a quick look I see two things:
1) LabelBidSize.Text = CStr(e.size)You set the label to the new value and then compare it to the new value, which will always result in "equal". You need something like PrevSize = CInt(LabelBidSize.Text) LabelBidSize.Text = CStr(e.size) If Prev > e.size Then 2) You are in the TickSize event which give the sizes. I haven't looked at the ActiveX api but in the socket api there is another event called TickPrice that has the prices. You might also want to use some variables to avoid the conversions between string and numeric formats. HTH - Nick Can someone help with this problem? I'd like show the change of bid |
Problem Bid -Ask Labelcolor
desstex2000
Can someone help with this problem? I'd like show the change of bid
and ask price with different colours: higher prices = green, lower prices = red. I've written the following code, which, unfortunately, doesn't work properly. Sometimes the showing of colours is correct and other times it's not. Here is my code: Private Sub AxTws1_tickSize(ByVal sender As System.Object, ByVal e As AxTWSLib._DTwsEvents_tickSizeEvent) Handles AxTws1.tickSize Select Case e.tickType Case Is = 0 LabelBidSize.Text = CStr(e.size) If CInt(LabelBidSize.Text) > e.size Then LabelBidSize.ForeColor = Color.Red ElseIf CInt(LabelBidSize.Text) < e.size Then LabelBidSize.ForeColor = Color.Green Else LabelBidSize.ForeColor = Color.Black End If Case Is = 3 LabelAskSize.Text = CStr(e.size) If CInt(LabelAskSize.Text) > e.size Then LabelAskSize.ForeColor = Color.Red ElseIf CInt(LabelAskSize.Text) < e.size Then LabelAskSize.ForeColor = Color.Green Else LabelAskSize.ForeColor = Color.Black End If Case Is = 5 LabelLastSize.Text = CStr(e.size) End Select End Sub Does anyone know the mistake? I work with VB.Net. Thank you. |
Re: twsapi: auto logout time
bruno voisin
开云体育I
don't think it is possible.? While the demo account can run 24/7, regular
accounts cannot, as the system shuts down for a short period at
night.
|
Possible Gotcha When Modifying an Order via API
Nick
It appears that when you change an order that has not been transmitted, the order is transmitted after the change!
Here are the steps in the edemo account: 1) Place limit order to buy (but not transmit). Order appears normally in TWS. 2) Modify limit price (but not transmit). Limit price is changed but order is transmitted - bad! If anyone has successfully changed an order via the socket api without having it transmit please let me know. I ran across this as I want to spy on the ats running in the live account. I figured I could have it create the orders but not transmit them so I could do a visual double-check. Looks like this might not work out due to this issue. - Nick |
Re: twsapi: ANNOYING Missed events in Excel/VB
toggle quoted message
Show quoted text
|
Re: twsapi: ANNOYING Missed events in Excel/VB
Chas_watkins
Yes I guess I have had the same issues with coding against the demo.
I will go as far as I can with the demo and then try it live. Trouble is I only trade Futures so that is a little dificult <grin> Is that syntax for the error correct? thanks For your help. regards Chas --- In twsapi@y..., Brendon Cheves <brendon@h...> wrote: Chas,STPAlso I use STP LMT orders and using the demo I can't seem to send my realLMT orders. I have used both "STP_LMT" and also "STP LMT" but theI had endless problems when using the demo account. I switched to account and only traded small lots in a slow moving stock fortesting purposes and things went much smoother. |
Re: twsapi: ANNOYING Missed events in Excel/VB
Brendon Cheves
Chas,
Also I use STP LMT orders and using the demo I can't seem to send STPI had endless problems when using the demo account. I switched to my real account and only traded small lots in a slow moving stock for testing purposes and things went much smoother. Brendon |
Re: twsapi: ANNOYING Missed events in Excel/VB
Chas_watkins
Thanks Brendon
Wish I had checked it more carefully to start with. I have ben looking at the DDE and it seems to be reasonably straight forward. I have a couple of questions if you or someone else would n't mind helping. I see that to get errors. You have to use ="cdemo|error!error however when I do that I get the result invalid topic? Any ideas on how I can track errors. Also I use STP LMT orders and using the demo I can't seem to send STP LMT orders. I have used both "STP_LMT" and also "STP LMT" but the resulting DDE links all just show 0s. Any thoughts. Thanks for the help. Regards Chas --- In twsapi@y..., Brendon Cheves <brendon@h...> wrote: Chas,ifOK have happily created my App in Excel but every now and then IB beginingI have multiple orders being filled at the same time. Is there everythingand redesign it useing DDE??I had the same problems and redesigned the whole thing in DDE and works well now. IB has specifically recommended against using VBwith Excel for TWS because of the dropped events. |
Re: twsapi: ANNOYING Missed events in Excel/VB
Brendon Cheves
Chas,
OK have happily created my App in Excel but every now and then IBI had the same problems and redesigned the whole thing in DDE and everything works well now. IB has specifically recommended against using VB with Excel for TWS because of the dropped events. Brendon |
ANNOYING Missed events in Excel/VB
Chas_watkins
OK have happily created my App in Excel but every now and then IB
fills an order and I do not get the event to handle. This happens if I have multiple orders being filled at the same time. Is there anything I can do to fix this or do I have to go back to the begining and redesign it useing DDE?? Thanks Chas |
Re: twsapi: TWS with Visual Basic
bruno voisin
开云体育I have
come across the same issue.? As far as I know, you can only get account
information after you place your first order.
?
I
can't?get the openOrder1 and openOrder2 events either.? Only the final
orderStatus event.
?
Apart
from that, all is fine so far.? I have written a VB program which extracts
signals from NeuroShell DayTrader Pro and sends orders to the
TWS.
?
?
Regards
Bruno
?
?
-----Original Message-----
From: manish_a1tech [mailto:manish_a1tech@...] Sent: Tuesday, 30 July, 2002 2:47 PM To: twsapi@... Subject: twsapi: TWS with Visual Basic Hello Friends, |
TWS with Visual Basic
manish_a1tech
Hello Friends,
I am new to TWS API. I am trying to get stock for a particular account.For this API said that that we have to call requestAccountUpdates method. and the API will response through UpdateAccountTime, UpdateAccountValue and UpdatePortfolio events. But i feel that these events never fird. Can any body tell me what I have to do to get Account StockInformation. Thanks you. |
Re: Any Excel gurus in here?
realquotes101
IB claims that activeX should not be used with excel spreadsheets.
They recommend the DDE interface. Search for info on IB's site. Andy M. --- In twsapi@y..., "Chas_watkins" <chas@o...> wrote: I set my Excel application to work today connected live with IB.my code is running it gives an object undefined error.my VB code is event driven so its possible that 2 events coincide.others?
|
Re: twsapi: Any Excel gurus in here?
开云体育Here is a? yahoo group that might be helpful.
xltraders@...
?
?
Also I have asked these people about 30 ?.'s and if
I don't get a response in 6 hours it is unusual.
?
?
Good luck,
?
Bruce
|
Any Excel gurus in here?
Chas_watkins
I set my Excel application to work today connected live with IB.
Several times it gave me errors. I am not sure why? Application.Goto Reference:="Name" Gives errors sometimes Where "Name" is a defined name in my work book. The goto works fine when called via macro. HOwever sometimes when my code is running it gives an object undefined error. I am running this macro every 2 seconds. Also I am using ActiveX my VB code is event driven so its possible that 2 events coincide. I just don't understand why it works some of the time and not others? Regards Chas |
to navigate to use esc to dismiss