Skip to content

Market command

market executes immediately using market execution.

It is the simplest command type and the best command to start with.

Use TradingView Order Syntax first if you need the full command structure before working through individual command types.

ALPHA(BTCUSDT){type=market,side=buy,amount=0.001}
  • type=market
  • side=buy or side=sell
  • amount=...
  • position=...
  • reduceOnly=true
  • tp=...
  • sl=...
  • tag=...
ALPHA(BTCUSDT){type=market,side=buy,amount=0.001}
ALPHA(BTCUSDT){type=market,side=sell,amount=0.001}
ALPHA(BTCUSDT){type=market,position=0.003}

This is different from amount=0.003.

It means the app resolves the current position first, then sends only the difference needed to reach 0.003.

ALPHA(BTCUSDT){type=market,position=0}

This is the cleanest flatten pattern.

ALPHA(BTCUSDT){type=market,side=sell,amount=50%p,reduceOnly=true}

Close current position using current position size

Section titled “Close current position using current position size”
ALPHA(BTCUSDT){type=market,side=sell,amount=100%p,reduceOnly=true}
ALPHA(BTCUSDT){type=market,side=buy,amount=0.001,tp=1%,sl=0.5%}

You can also use entry-relative forms:

ALPHA(BTCUSDT){type=market,side=buy,amount=0.001,tp=e1%,sl=e-0.5%}

Use amount when you want an order quantity.

Use position when you want a final target position size.

That can prevent the order from opening a new position.

Using side and position without understanding the difference

Section titled “Using side and position without understanding the difference”

position determines the final target state.

Using a quantity that resolves below exchange minimums

Section titled “Using a quantity that resolves below exchange minimums”

The exchange can reject the final order even if your syntax is valid.