Options & Example commands

Options

Options are displayed/updated from the command line by typing the following commands:

# view/list global option commands
node tradeforme

# view/list config tool usage
node tradeforme config

# view/list global config options
node tradeforme config get

# get a single config option value
node tradeforme config get --maxRiskPerTrade

# get a single nested option value
node tradeforme config get --tdConfig.apiKey

# set a single config option value
node tradeforme config set --maxRiskPerTrade=50

# set a single nested option value
node tradeforme config set --tdConfig.apiKey="XXXXXXX"
# view/list ORB strategy options
node tradeforme strategy orb

# view/list SMACrossUp strategy options
node tradeforme strategy SMACrossUp

ORB

tradeforme strategy ORB run {flags}
	--symbol=XYZ [the --symbol flag overrides --watchlist... flags. Places a single order.]
	--breakoutCandle=[5 | 1 | 10 | 15 | 30]
	--watchlistType=default
	--watchlistName=yyyy-mm-dd
	--watchlistLimit=3
	--priceRange=false [Usage: --priceRange='10-100']
	--riskPerTrade=[maxRiskPerTrade | custom]
	--useSma=[false | true] [Only place trade if price is above smaFast and smaFast above smaSlow]
	--smaSlow=13
	--smaFast=9
	--smaCrossLag=5 [SMA crossed up within this number of candles]
	--debug [Write order details to log without placing an order]
tradeforme strategy ORB stop

SMA Cross Up

tradeforme strategy SMACrossUp run {flags}
	--symbol=REQUIRED [required if not using watchlist]
	--candleLength=[5 | 1 | 10 | 15 | 30]
	--maxOrdersPerSymbol=1
	--smaSlow=13
	--smaFast=9
	--smaCrossLag=5 [SMA crossed up within this number of candles]
	--watchlistType=default
	--watchlistName=yyyy-mm-dd
	--watchlistLimit=3
	--priceRange=false [Usage: --priceRange='10-100']
	--riskPerTrade=[maxRiskPerTrade | custom]
	--debug [Write order details to log without placing an order]
tradeforme strategy SMACrossUp stop

RSI Cross Up

tradeforme strategy RSICrossUp run {flags}
	--symbol=REQUIRED [required if not using watchlist]
	--lookback=14 [Number of periods to use for the RSI calculation]
	--threshold=30 [RSI cross from below to above this value to trigger entry signal]
	--candleLength=[5 | 1 | 10 | 15 | 30]
	--maxOrdersPerSymbol=1
	--watchlistType=default
	--watchlistName=yyyy-mm-dd
	--watchlistLimit=3
	--priceRange=false [Usage: --priceRange='10-100']
	--riskPerTrade=[maxRiskPerTrade | custom]
	--debug [Write order details to log without placing an order]
tradeforme strategy RSICrossUp stop

Save TD movers watchlist

node tradeforme saveWatchlistTdMovers \
--watchlistName='$SPX.X' \
--watchlistType=td_movers_up \
--direction=up \
--type=percent

Save Custom Watchlist

In this example, the watchlist name (watchlistName) will be in the default format of YYYY-MM-DD. You can create a custom watchlist every day with that naming convention, and the TradeForMe app will consume it from TD Ameritrade and optionally delete it after saving a local copy.

node tradeforme saveWatchlistDaily \
--deleteFromTd=true

Run ORB strategy

In the following example, the ORB strategy will be run against the default watchlist of the day. You may pass a custom watchlist name, or watchlist type as well.

node tradeforme strategy ORB run \
--breakoutCandle=15 \
--priceRange='10-100' \
--riskPerTrade=10 \
--watchlistLimit=4 &

Run SMA Cross Up Strategy

This example demonstrates how to run an sma cross up strategy on a 1 minute chart using the 10 and 20 period simple moving averages. It is using the dynamically generated watchlist from the TD Ameritrade developer API, and only placing trades for equities between $10 and $100.

node tradeforme strategy SMACrossUp run \
--candleLength=1 \
--smaSlow=20 \
--smaFast=10 \
--watchlistType=td_movers_up \
--priceRange='10-100' &