TWS trading - error


I am trying to place simple order to Interactive Broker

ibc = GetTradingInterface("IB");
ibc.PlaceOrder("CL Dec'20 @NYMEX", "BUY", 1, "LMT", 38, 0, "DAY",100 );

but this give error ApiPending

if I change it to another contract like

MFST, then it works.

ibc = GetTradingInterface("IB");
ibc.PlaceOrder("MFST", "BUY", 1, "LMT", 38, 0, "DAY",100 );

Can somebody please help.

You are using incorrect symbol

thanks it works but how do I specify next month expiry contract ? By default it takes current month future.

Also how to get symbol for options ?

OK I found solution . For next month contract its different Symbol. I suppose same will be for options (I still need to check that).


This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.