Hi,
I have coded as below to place bracket order.
_SECTION_BEGIN("Order");
if(LastValue( Buy ))
{
ibc = GetTradingInterface("IB"); // check if we are connected OK
if( ibc.IsConnected() )
{
if( ibc.GetPositionSize( Name() ) == 0 )
{
parentID = ibc.Placeorder(Name(), "Buy", 1, "MKT", 0, 0, "Day", False);
ibc.Placeorder( Name(), "Sell", 1, "LMT", brd1, 0, "Day", False, 1, "", parentID);
ibc.Placeorder( Name(), "Sell", 1, "STP", bpd, bpd, "Day", True, 1, "", parentID);
}
}
}
_SECTION_END();
I am getting an error
Error 19: COM method/function Placeorder call failed. COM error:Type mismatch on one or more argument(s) (Ln:138, Col:84)
BH = ValueWhen (Buy , H); // Todays high
BL = ValueWhen (Buy , L); // todays low
BC = ValueWhen(Buy , C); // todays close
BR = BH - BL;
Bpd = (BH+ BL + BC )/3;
Bsd1 = (2*Bpd)-BH;
Bsd2 = Bpd -BR;
Bsd3 = BSd1 - BR;
Brd1 = (2*Bpd)-BL;
Brd2 = Bpd + BR;
Brd3 = Brd1 + BR;
Please help me.