I have an Interactivebroker’s Account (two actually).
However, their data feed is not up-to-par for me.
Can Amibroker place trades thru to IB yet act on data from IQ Feed ?
Yes, absolutely. The data feed and the automation of trading are completely separate things.
The documentation for the IB Controller (trade automation) can be found here:
https://www.amibroker.com/at/
Thanks for that. However it appears that the buy/sell calls for IB require special syntax…i.e. I would have to backtest with one set of code and trade with a slightly different set of code.
Is that right ?
I believe Multicharts makes the broker interface transparent…i.e. I can switch brokers without having to change any code.
Please correct me if I am wrong.
You might want to read this thread: IBC message "The contract description is ambiguous"
Basically, you can store the IB symbol in the Alias field in the Symbol Information, which creates the link between the IQ Feed ticker and the IB symbol.
Thanks much for that detail. However, I am still confused about setting up the interface for a specific broker. How does that work in back-testing mode where real trades are not being executed ?
re: "ibc = GetTradingInterface(“IB”);"
The above code is not required for back-testing, correct ?
This means each and every signal/strategy must have a BackTest_ON variable to branch around that code.
You can use Explore mode for the auto trading, and set a conditional switch in your code so it doesn’t trigger during Backtest. That method is described here: Generic code snippet to trade with IB. Scroll up through the rest of that thread for more info.
Thanks for that…but that example was very sparse:
if (Status(“action”) == actionExplore)
{
// Your auto-trading code here
}
I need one that shows how to perform backtest trades vs. realtime trades via IB.