Backtest to trade help

Hoping someone can point me in the direction of how to setup my backtesting script for trading. The API and broker I can handle later - one step at a time.

You're probably going to need to be much more specific on what it is that you're unclear about. There are multiple ways to use AFL to generate live trading signals: from a chart, from an Exploration, or from a Backtest. You can integrate with your broker from AFL, or you can create a separate order manager of some type. There are also 3rd party solutions like Alera and probably others that I'm unaware of. The best approach will depend on the specifics of your strategy.

If this is your first time automating, it might be worthwhile to find someone to help you through it.

Example, I am able to connect to to IB paper trading through IB connect yet when i run the backtest there are no trades. I am looking to see if there is something else I need to do in order for trades to happen, such as additional afl in the script, settings in AmiBroker, etc... My searches on the forum and internet have yet to lead me in a direction that produced positive results.

You may find this post helpful: IBController Guide all at One Place

Specifically, if you want to send orders to IB from AmiBroker, you will probably want to use the IBController plugin.

Thanks you for taking the time to head me in the right direction

Following the link you provided AmiBroker is now connected to TWS through the IBController. The challenge now seems to be modifying the backtest script I created with code that will initiate the Buy and Sell signals. Are there any examples or goby documents or links that could help with this scenario?
Thanks again

I'm sure there are examples floating around, but you will need to make sure they apply to your strategy. For live (automated) trading, you need to consider all the same elements that went into your backtest. The list below provides a few things to think about, and is not meant to be exhaustive.

  • Are you entering trades at the open, at the close, or on a limit/stop order?
  • If entering on limit/stop, will you keep taking orders until you hit max position size or run out of capital, or will you only place as many orders as you have open "slots" at the start of the day?
  • Is your position size related to the equity in your account? If so, how will the backtest know how much capital it has to work with?
  • Are you exiting at the close of the exit signal day, or sometime during the following trading day?
  • How will you guarantee that the trades being closed by the backtest were actually opened by your broker? Sending a "Sell" order for a position that isn't open may result in you opening a Short trade.
  • If using stops, will you enter a GTC stop order at the time of trade entry, or will you enter a new stop order each day, or will you try to get AB to "monitor" live prices so it can decide when to exit "on the fly"?
  • Can all orders for the day be entered during a single run of AB, or will you run your backtest /exploration multiple times? If multiple, how will you keep track of what orders were placed on previous runs so that you don't send duplicate orders?