Run a morning market briefing¶
The first ten minutes of a trading day usually cover the same questions: am I whole, what am I carrying, what did the market do overnight, and where does it stand now. This guide chains four cTrader CLI commands into a single morning routine you can rerun before every session.
Tip
Define your credentials in shell variables once. Every interactive command below reuses them, so the steps stay short and the script stays portable.
export CTID=1234567
export ACC=7654321
export PWD_FILE=$HOME/.ctrader/pwd
1. Check your account health¶
Start with account-stats to confirm balance, equity and margin. If free margin is tight relative to equity, the day is already overexposed before it opens.
ctrader-cli account-stats --ctid=$CTID --pwd-file=$PWD_FILE --account=$ACC -q
2. Review what you are already carrying¶
positions lists every open position with entry price, volume, stop loss and take profit. Skim it for any position that has drifted or any stop that sits too close to the market.
ctrader-cli positions --ctid=$CTID --pwd-file=$PWD_FILE --account=$ACC -q
3. Get current prices for your watchlist¶
prices takes a comma-separated list of symbols and prints bid and ask for each in one call. Keep the list short, the symbols you actually plan to act on this morning.
ctrader-cli prices --ctid=$CTID --pwd-file=$PWD_FILE --account=$ACC -q \
--symbols=EURUSD,GBPUSD,USDJPY,XAUUSD
4. Read the overnight move for one symbol¶
For a single symbol you want to study in depth, candles returns the last N candles in JSON. Use periods once to confirm the period token you want.
ctrader-cli candles --ctid=$CTID --pwd-file=$PWD_FILE --account=$ACC -q \
--symbol=EURUSD --period=h1 --count=12
Use --count for the most recent candles, or --from and --to for a fixed date range. Pass one or the other, not both.
5. Save the briefing to dated files¶
Each command already prints JSON, so redirection is enough to keep a record of the morning.
DATE=$(date +%Y-%m-%d)
ctrader-cli account-stats --ctid=$CTID --pwd-file=$PWD_FILE --account=$ACC -q > ${DATE}_account.json
ctrader-cli positions --ctid=$CTID --pwd-file=$PWD_FILE --account=$ACC -q > ${DATE}_positions.json
6. Combine into a morning routine script¶
Once each step works, save the full sequence as morning.sh and run it whenever you sit down to trade.
#!/usr/bin/env bash
set -euo pipefail
CTID=1234567
ACC=7654321
PWD_FILE=$HOME/.ctrader/pwd
DATE=$(date +%Y-%m-%d)
ctrader-cli account-stats --ctid=$CTID --pwd-file=$PWD_FILE --account=$ACC -q > ${DATE}_account.json
ctrader-cli positions --ctid=$CTID --pwd-file=$PWD_FILE --account=$ACC -q > ${DATE}_positions.json
ctrader-cli prices --ctid=$CTID --pwd-file=$PWD_FILE --account=$ACC -q \
--symbols=EURUSD,GBPUSD,USDJPY,XAUUSD > ${DATE}_prices.json
ctrader-cli candles --ctid=$CTID --pwd-file=$PWD_FILE --account=$ACC -q \
--symbol=EURUSD --period=h1 --count=12 > ${DATE}_eurusd_h1.json
echo "Morning briefing saved to ${DATE}_*.json"
Run it with bash morning.sh after the broker session has finished syncing. Each file is a timestamped snapshot you can compare against the same time tomorrow.
The CLI references lists all available options for the commands used in this workflow.
Warning
cTrader CLI is a tool for trading and automation. It does not provide financial, investment, legal or tax advice. Commands that place or change orders can trigger real trades and result in losses. Verify every command before you run it, test on a demo account first and protect your credentials.