TD Ameritrade ThinkorSwim Auto Trading Bot

TD Ameritrade ThinkorSwim Auto Trading Bot

June 26, 2020

Share :


So I've coded an auto trading bot for the TD Ameritrade ThinkorSwim platform using NinjaTrader.


This strategy is based off the common gap reversal strategy. The Gap Reversal strategy was first described by trader David Pieper in Traders magazine. It is a swing trading strategy. The strategy is usually applied to stocks and futures in a trend.


The strategy in detail

The Gap Reversal strategy is based on a precise chart pattern. As the name indicates, this chart pattern includes a gap. The strategy is applied on a 1-day chart.

The strategy only generates buy signals. The signals are filtered by means of a moving average before they can be accepted.

 When to open a position?

The following chart pattern must occur:

  • A gap down appears. The strategy defines a gap as a difference of at least 1% between yesterday’s close and this morning’s open.
  • The close price of the gap candle must be above its open price.
  • The close price of the gap candle must be above its mid-price.

But not every pattern occurrence is a buy signal. The Gap Reversal strategy applies a filter based on the 250-day moving average. Only if the market price is above this moving average, a signal is validated and accepted.


I also made a Youtube video on it as well which is easier to follow, hope you find value :


Tags: