Auto Trading BUG when closing a multiple future position

Questions about MultiCharts and user contributed studies.
itai007
Posts: 69
Joined: 14 Jun 2007

Auto Trading BUG when closing a multiple future position

Postby itai007 » 24 Mar 2008

Hi.
My strategy seems to work with the IB TWS when there is only 1 contract in a position.

When there is a pyramided position which needs to exit all contracts the MC IB get it wrong. It reverses the position instead of only closing it.

this is the statement I use ...

I use the intrabar order generation with the third option (allow signal for unlimited etc '' ..

to cover short my statement is
if marketposition < 0 then buytocover next bar XX limit ...

to sell long my statement is
if marketposition > 0 then buytocover next bar XX limit ...

in the attached file you can see the strategy just coverd a short 2 contract position but each order to cover was sent with a size of "2" so now I end up long 2.

pls explain tell me how to make this something I can trust and not just play with..


Itai.
Attachments
IB_bug.PNG
IB duble cover
(152.34 KiB) Downloaded 411 times

brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times

Postby brodnicki steven » 24 Mar 2008

"to sell long my statement is
if marketposition > 0 then buytocover next bar XX limit ... "

Why would you "buytocover" a long position ?

itai007
Posts: 69
Joined: 14 Jun 2007

Postby itai007 » 25 Mar 2008

"to sell long my statement is
if marketposition > 0 then buytocover next bar XX limit ... "

Why would you "buytocover" a long position ?
yah well as you can see I switched by mistake but that not the issue here


Return to “MultiCharts”