开云体育

ctrl + shift + ? for shortcuts
© 2025 Groups.io
Date

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


Question about Market Depth data

 

Does anyone know if there is a way to get Market Depth data from IB
in EXCEL using DDE or some other way for that matter?

regards
-fm


Re: twsapi: Problem Bid -Ask Labelcolor

Nick
 

Giving a quick look I see two things:

1)
LabelBidSize.Text = CStr(e.size)
If CInt(LabelBidSize.Text) > e.size Then
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
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.


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.

-----Original Message-----
From: o_2_b_sean [mailto:no_reply@...]
Sent: Tuesday, 30 July, 2002 9:07 PM
To: twsapi@...
Subject: twsapi: auto logout time

has anyone found a way to reset this via VB or turn this feature off
once and for all?



To unsubscribe from this group, send an email to:
twsapi-unsubscribe@...



Your use of Yahoo! Groups is subject to the .


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

 

开云体育

Chas,
?
Try STPLMT (no space inbetween)
?
Good luck

----- Original Message -----
Sent: Tuesday, July 30, 2002 8:00 AM
Subject: Re: twsapi: ANNOYING Missed events in Excel/VB

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 wrote:
> Chas,
>
> > 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??
>
> I 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



To unsubscribe from this group, send an email to:
twsapi-unsubscribe@...



Your use of Yahoo! Groups is subject to the .


auto logout time

o_2_b_sean
 

has anyone found a way to reset this via VB or turn this feature off
once and for all?


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,

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.
I 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

Brendon Cheves
 

Chas,

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.
I 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,

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??
I 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


Re: twsapi: ANNOYING Missed events in Excel/VB

Brendon Cheves
 

Chas,

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??
I 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,

??? 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.




To unsubscribe from this group, send an email to:
twsapi-unsubscribe@...



Your use of Yahoo! Groups is subject to the .


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?

rhodge_uk
 

Try using this:

Application.Goto ThisWorkbook.Names("Name").RefersToRange

where "Name" is your rangename in quotes.


Bracket trade

pcx3
 

I like the way the program works so far. Is it possible to make it
smaller? I have a laptop and space is at a premium. It would be
helpful to shrink the buttons a bit and remove some of the empty
space or 'squeeze' the interface to make it use less screen space.

Thanks
Dave


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.
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


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
?

----- Original Message -----
Sent: Monday, July 29, 2002 10:31 AM
Subject: twsapi: Any Excel gurus in here?

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 unsubscribe from this group, send an email to:
twsapi-unsubscribe@...



Your use of Yahoo! Groups is subject to the .


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