Dear all,
Many thanks for sharing your codes and experience. I am a
newbie testing the trading system using ib controller with this code for buy
as in the manual:
//trading system
ibc =
GetTradingInterface("IB");
if(ibc.IsConnected())
{
if(LastValue(Buy))
{
if(ibc.GetPositionSize(Name()) ==
0)
{
ibc.PlaceOrder(Name(),"Buy",1,"MKT",0,0,"Day",True);
}
}
}
What I find is that
more than 8 buy signals are produced.
I suspect that
GetPositionSize() is not fast enough to report the actual
position.
I would be grateful if anyone could help me code this so the
buy condition will only be triggered once per bar, as is the case for arrows
on the charts.
Thanks in advance.
Keith
On 18 Apr 2007 07:59:14 -0700, Roger <rogerz@xxxxxxxxcom >
wrote:
Thanks Don for sharing. Very nice indicator!
Roger