NRUNO Trading Automation Wiki · Question 8

How do I send Buy, Sell and Close commands from TradingView?

Accounts, Routing & Multi-Account SafetyLast reviewed: 25 Aug 2026
Short answer

Use explicit semantics: BUY/SELL for entries and CLOSE_LONG/CLOSE_SHORT/CLOSE_POSITION for exits. An opposite entry is not always the same as closing.

What this means in practice

Use explicit semantics: BUY/SELL for entries and CLOSE_LONG/CLOSE_SHORT/CLOSE_POSITION for exits. An opposite entry is not always the same as closing. This page is specifically about “How do I send Buy, Sell and Close commands from TradingView?”, so each scenario below is explained by its own mechanism instead of sharing one generic diagnosis.

Real-world scenarios

Scenario A — Open long

Resolve current cTrader exposure before acting. An opposite order can hedge, flatten or reverse depending on account model and state, so explicit OPEN, CLOSE and REVERSE semantics are safer than ambiguous BUY/SELL behavior. For Scenario A — Open long on question 8, use that evidence specifically to answer “How do I send Buy, Sell and Close commands from TradingView?”; keep it separate from the evidence for the other scenarios on this page.

Scenario B — Open short

Resolve current cTrader exposure before acting. An opposite order can hedge, flatten or reverse depending on account model and state, so explicit OPEN, CLOSE and REVERSE semantics are safer than ambiguous BUY/SELL behavior. For Scenario B — Open short on question 8, use that evidence specifically to answer “How do I send Buy, Sell and Close commands from TradingView?”; keep it separate from the evidence for the other scenarios on this page.

Scenario C — Close long

Resolve current cTrader exposure before acting. An opposite order can hedge, flatten or reverse depending on account model and state, so explicit OPEN, CLOSE and REVERSE semantics are safer than ambiguous BUY/SELL behavior. For Scenario C — Close long on question 8, use that evidence specifically to answer “How do I send Buy, Sell and Close commands from TradingView?”; keep it separate from the evidence for the other scenarios on this page.

Scenario D — Reverse

Resolve current cTrader exposure before acting. An opposite order can hedge, flatten or reverse depending on account model and state, so explicit OPEN, CLOSE and REVERSE semantics are safer than ambiguous BUY/SELL behavior. For Scenario D — Reverse on question 8, use that evidence specifically to answer “How do I send Buy, Sell and Close commands from TradingView?”; keep it separate from the evidence for the other scenarios on this page.

Scenario E — Close specific position

Resolve current cTrader exposure before acting. An opposite order can hedge, flatten or reverse depending on account model and state, so explicit OPEN, CLOSE and REVERSE semantics are safer than ambiguous BUY/SELL behavior. For Scenario E — Close specific position on question 8, use that evidence specifically to answer “How do I send Buy, Sell and Close commands from TradingView?”; keep it separate from the evidence for the other scenarios on this page.

What to check

  • intended signal/action
  • last stage that definitely succeeded
  • first stage that differs from intent
  • final cTrader state after the event

Practical rule

For “How do I send Buy, Sell and Close commands from TradingView?”, change only the first layer whose evidence no longer matches the intended action. Preserve signal identity, timestamps and final cTrader state, and reproduce execution-affecting changes on demo before live use.

Decision summary

Direct answer: Use explicit semantics: BUY/SELL for entries and CLOSE_LONG/CLOSE_SHORT/CLOSE_POSITION for exits. An opposite entry is not always the same as closing.

Next action: Match the observed evidence to one scenario above, test that mechanism independently on demo and keep the result traceable with one signal ID.

Primary sources

Need a TradingView → cTrader execution route?

NRUNO routes your TradingView instructions to cTrader. Your strategy and signal logic remain yours.