Amibroker to Interactive Brokers

Job ID: 32466146

Budget: $10 – $30 USD

Happy Holidays

I am in the late stages of developing my trading system on Amibroker. I have designed quite a few trading strategies using AFL, which I plan to scan through every day using Batch, and if conditions match, Buy/Sell/Short/Cover. I have backtested these thoroughly and would like to use them live. I don't use charts

My next step is using Interactive Brokers to paper trade. This is where I would like some help to make sure there are no errors in my code develpment since any duplicated or missed orders can be very costly.

NEED: All my algos have two sell/cover conditions. 1) One is specific to the algo or timebased (eg MA cross below certain level or close out position at end of day) and 2) The second is a trailing stop loss

Given this info, I would like code that I can insert into my projects that will:
1. Verify connection with IB
2. Buy/Short when the signal is triggered
3. Avoid double orders (however, not worried about holding the same ticker multiple times, since each position is opened using different criteria and time horizon)
4. Send a trailing stop loss as a child order with each order placed (step 2)
5. Send a Sell/Cover order as a child order with each order placed (step 2)
6. If either the trailing stop or the Sell/Cover are executed, then cancel the other child order

I hope I did a decent job of explaining what I need here. Based on my research, I believe I'm almost there and it should be simple for someone like you who is familiar. Please let me know if this is interesting for you

thanks!
Related categories: Amibroker Formula Language