I am fully aware of the information in www.amibroker.com/at
I need help in correct AFL statements to achieve the following:
I already got my buy/sell strategy afl developed. I have a pre-selected list of stock symbols that I stored in List0.
I want to:
1- scan the list every 1 min to trigger buy/sell signals on stocks symbols listed on List0. ( I know how to do that)
2- Once a buy condition is True, I need to search for a call option contract that is (2 strikes in the money & 90 day+ expiration & spread less than $0.1) and send to my IB account a market buy order with the symbol of the automatically selected option chain. If no option chain satisfy the condition of i.e. spread, there will be no order sent to the broker.
3- Once a sell condition is True for a stock symbol, I want to search from any option contract that is currently opened for the underlying stock symbol that caused the sell trigger. All open contracts should be closed with a market sell order.
Your support is kindly needed.