Hi Alex, Thanks for the syntax. Unfortunately, things are still not working.
I show my code below. QB creates the instrument, and fills out the top block of the property sheet correctly (USD, "CAD 2012", Futures, but leaves the following fields blank:
- AltIDgroups, factor, maturity,margin, ticksize, and price format (actually my F4 is ignored, the default F2 shows).
Perhaps you could try this code on your machine/QB, and see what I'm doing wrong? Thanks.
Code:
foreach (string month in strDates) {
string sym = pIbSym + " " + strDates[n]; // CAD 201212
Instrument inst = new Instrument (InstrumentType.Futures,sym);
inst.Currency = "USD";
inst.Description = pDesc; // Canadian Dollar
inst.Exchange = pExchange; // GLOBEX
AltIDGroup group = inst.AltIDGroups.Add("IB");
group.AltSymbol = pIbSym; // CAD
group.AltExchange = pExchange; // GLOBEX
//group.AltSource = "IB";
inst.Factor = pFactor; // 100000
inst.Margin = pMargin; // 2500
inst.TickSize = pTickSize; // 0.0001
inst.PriceFormat = pPriceDisplay; // F4
inst.Maturity = numDates[n]; // 2012-12-01
// very important! Don't forget to save instrument changes
// inst.Save ();
n = n + 1;
}