---
title: strategy.market_position vs market_position_size in Alerts
slug: strategy-market_position-vs-market_position_size-in-alerts
date: 2026-09-18
modified: 2026-09-18
author: Bhavishya Goyal
excerpt: ""
meta_description: "strategy.market_position sends long, short or flat. market_position_size sends the post-fill size, 0 on every full exit."
focus_keyword: strategy.market_position
canonical_url: "https://blog.pickmytrade.trade/strategy-market_position-vs-market_position_size-in-alerts/"
og_title: strategy.market_position vs market_position_size in Alerts
og_description: "strategy.market_position sends long, short or flat. market_position_size sends the post-fill size, 0 on every full exit."
og_image: "https://blog.pickmytrade.trade/wp-content/uploads/2026/09/Gemini_Generated_Image_u8biz2u8biz2u8bi-1024x572.avif"
schema_type: FAQPage
categories:
  - TradingView
  - Tradingview Strategy
tags: []
reading_time: 16
word_count: 3870
robots: "index, follow"
lang: en-US
---

# strategy.market_position vs market_position_size in Alerts

`{{strategy.market_position}}` and `{{strategy.market_position_size}}` sit side by side among TradingView’s 11 strategy placeholders, and they look like two answers to the same question. They aren’t.

Table of Contents

1. [What does {{strategy.market_position}} return, and when?](https://blog.pickmytrade.trade/#what-does-strategy-market_position-return-and-when)
2. [What does {{strategy.market_position_size}} return?](https://blog.pickmytrade.trade/#what-does-strategy-market_position_size-return)
3. [Two lookalikes: position_size and order.contracts](https://blog.pickmytrade.trade/#two-lookalikes-position_size-and-order-contracts)
4. [One strategy, five fills: what each placeholder sends](https://blog.pickmytrade.trade/#one-strategy-five-fills-what-each-placeholder-sends)
5. [Why are market_position and market_position_size a pair?](https://blog.pickmytrade.trade/#why-are-market_position-and-market_position_size-a-pair)
6. [Which pair does your strategy type need?](https://blog.pickmytrade.trade/#which-pair-does-your-strategy-type-need)
7. [Continuous strategies: the position pair](https://blog.pickmytrade.trade/#continuous-strategies-the-position-pair)
8. [Flat-to-flat strategies: the position pair, if anything else exits](https://blog.pickmytrade.trade/#flat-to-flat-strategies-the-position-pair-if-anything-else-exits)
9. [Partial exits and pyramiding: the order pair](https://blog.pickmytrade.trade/#partial-exits-and-pyramiding-the-order-pair)
10. [What if a scaling strategy can also be closed from outside?](https://blog.pickmytrade.trade/#what-if-a-scaling-strategy-can-also-be-closed-from-outside)
11. [Mixing the pairs: two one-field mistakes](https://blog.pickmytrade.trade/#mixing-the-pairs-two-one-field-mistakes)
12. [Mix 1: market_position_size in an order-pair alert](https://blog.pickmytrade.trade/#mix-1-market_position_size-in-an-order-pair-alert)
13. [Mix 2: market_position with the default flags](https://blog.pickmytrade.trade/#mix-2-market_position-with-the-default-flags)
14. [The exit trap: market_position_size reads 0 on every full exit](https://blog.pickmytrade.trade/#the-exit-trap-market_position_size-reads-0-on-every-full-exit)
15. [Set up each pair in PickMyTrade](https://blog.pickmytrade.trade/#set-up-each-pair-in-pickmytrade)
16. [Test the pair on a demo before it trades real money](https://blog.pickmytrade.trade/#test-the-pair-on-a-demo-before-it-trades-real-money)
17. [Frequently asked questions](https://blog.pickmytrade.trade/#frequently-asked-questions)
18. [Before you save the alert](https://blog.pickmytrade.trade/#before-you-save-the-alert)

The first sends a word: `long`, `short` or `flat`. The second sends a number, the absolute size of the position. Both describe the strategy after the order has filled, which is why one of them reads 0 on every full exit.

So the title’s question has a short answer. Your alert doesn’t pick one of them. It picks a pair. PickMyTrade’s `data` field can carry an order (`buy` or `sell`) or a target position (`long`, `short` or `flat`), and each of those vocabularies comes with its own size placeholder.

Below, one strategy runs through five fills: enter, add, scale out, reverse and exit. You’ll see what each placeholder sends at every step, what PickMyTrade does with both pairs, and how the two most common one-field edits break an account. For every other strategy placeholder, see the [full list of TradingView strategy placeholders](https://blog.pickmytrade.trade/tradingview-placeholder-list-strategy-variables-explained/).

&gt; **Key Takeaways**
&gt; 
&gt; 
&gt; 
&gt; 
&gt; 
&gt; 
&gt; 
&gt; - `{{strategy.market_position}}` sends `long`, `short` or `flat`. `{{strategy.market_position_size}}` sends the size after the fill, so every full exit reads `0`.
&gt; - They form one pair: the word goes in `data`, the number in `quantity`.
&gt; - In our five-fill walkthrough, one common mix-up leaves the account wrong after 4 of 5 fills.
&gt; - Scale-in and scale-out strategies need the order pair instead.

**The order pair** is `{{strategy.order.action}}` in `data` plus `{{strategy.order.contracts}}` in `quantity`, and it tells PickMyTrade which trade to place. **The position pair** is `{{strategy.market_position}}` in `data` plus `{{strategy.market_position_size}}` in `quantity`, and it tells PickMyTrade where the position should end up.

Haven’t built a strategy alert before? TradingView’s own tutorial shows where alerts get created, including alerts on indicators and strategies.

## What does {{strategy.market_position}} return, and when? {#what-does-strategy-market_position-return-and-when}

`{{strategy.market_position}}` returns one of 3 words: `long`, `short` or `flat`. TradingView sets it at the moment an order fills, so the word describes the position after that order. A full exit therefore sends `flat`, and a flip from long sends `short`.

**`{{strategy.market_position}}`** is a text placeholder that only resolves in alerts created from a strategy’s order fills. It never carries the side of the order. That’s what sets it apart from `{{strategy.order.action}}`, which reports every order as `buy` or `sell`.

Why does that matter? A `sell` can mean three things. It can close a long, open a short, or do both at once when the strategy reverses. The position word skips the guessing, because it names the result.

You can see the timing in any alert log. An alert whose message is `{{strategy.order.action}} {{strategy.position_size}}` logs `buy 1` when a 1-contract long entry fills from flat. A value from before the fill would have logged `buy 0`.

Need the state from before the fill? That’s `{{strategy.prev_market_position}}`, which sends the same three words for the position the order started from. Read the two together and most fills label themselves: `flat` to `long` is an entry, `long` to `flat` is an exit, and `long` to `short` is a reversal. `long` to `long` could be an add or a scale-out, and only the sizes tell those two apart.

In PickMyTrade, the word goes in the `data` field. The [strategy automation guide](https://docs.pickmytrade.trade/docs/automate-tradingview-strategies/) explains the switch in two lines: `{{strategy.order.action}}` tells it what trade to place, while `{{strategy.market_position}}` tells it what the final position should be. In practice, `long` works as a buy, `short` as a sell and `flat` as a close.

## What does {{strategy.market_position_size}} return? {#what-does-strategy-market_position_size-return}

`{{strategy.market_position_size}}` returns the position’s size after the fill as an absolute number, so it’s never negative. A 3-contract short reads `3`. Any fill that leaves the strategy flat reads `0`, which matters the moment you put it in a close alert.

**`{{strategy.market_position_size}}`** is the numeric half of the position pair. It shares the word’s timing, and the two always agree: `flat` arrives with `0`, while `long` or `short` arrives with a positive size. What it can’t tell you is how many contracts the last order moved.

So which placeholder does know the order’s size? Two others describe a size, and both are easy to mix up with this one.

### Two lookalikes: position_size and order.contracts {#two-lookalikes-position_size-and-order-contracts}

`{{strategy.position_size}}` carries the same number with a sign attached. Long 3 reads `3` and short 3 reads `-3`. That sign helps in a log and hurts in a `quantity` field, since no broker takes an order for minus three contracts.

`{{strategy.order.contracts}}` is the size of the order that just filled. On a first entry from flat it equals `{{strategy.market_position_size}}`, and that coincidence is why a swapped placeholder passes a quick test. The two split apart on the first add, scale-out, reversal or exit.

Here’s how the six position and order placeholders read on a short entry from flat, and on the exit that closes it:

| Placeholder | What it returns | Short entry (flat to short 3) | Exit (short 3 to flat) | PickMyTrade field |
| --- | --- | --- | --- | --- |
| {{strategy.market_position}} | Position word after the fill | short | flat | data, position pair |
| {{strategy.market_position_size}} | Absolute size after the fill | 3 | 0 | quantity, position pair |
| {{strategy.position_size}} | Signed size after the fill | -3 | 0 | Neither field |
| {{strategy.prev_market_position_size}} | Absolute size before the fill | 0 | 3 | Logs only |
| {{strategy.order.contracts}} | Size of the order that filled | 3 | 3 | quantity, order pair |
| {{strategy.order.action}} | Side of the order that filled | sell | buy | data, order pair |

Read down the exit column and the pattern is plain. Only `{{strategy.order.contracts}}` and `{{strategy.prev_market_position_size}}` still carry the size that just closed, and `{{strategy.order.contracts}}` is the one PickMyTrade’s default template puts in `quantity`.

## One strategy, five fills: what each placeholder sends {#one-strategy-five-fills-what-each-placeholder-sends}

Across the five fills below, `{{strategy.market_position_size}}` and `{{strategy.order.contracts}}` agree only twice. The strategy trades 1 contract per entry with `pyramiding = 2`, so it can add once. It enters long, adds, scales out, reverses to short and exits, and every value in the table is what TradingView sends at that fill. Headers drop the `strategy.` prefix to fit.

| Fill | Pine call | order.action | order.contracts | market_position | market_position_size | prev_market_position_size |
| --- | --- | --- | --- | --- | --- | --- |
| 1. Enter | strategy.entry("Long1", strategy.long) | buy | 1 | long | 1 | 0 |
| 2. Add | strategy.entry("Long2", strategy.long) | buy | 1 | long | 2 | 1 |
| 3. Scale out | strategy.close("Long2") | sell | 1 | long | 1 | 2 |
| 4. Reverse | strategy.entry("Short", strategy.short) | sell | 2 | short | 1 | 1 |
| 5. Exit | strategy.close("Short") | buy | 1 | flat | 0 | 1 |

Order size vs. position size, five fills

{{strategy.order.contracts}}

{{strategy.market_position_size}}

0
1
2
Contracts

1

1
Fill 1
Enter long
same

1

2
Fill 2
Add one
differs

1

1
Fill 3
Scale out
same

2

1
Fill 4
Reverse
differs

1
0
Fill 5
Exit
differs

  The two sizes agree on the first entry and the scale-out, then split on the add, the reversal and the exit.
*The two sizes agree on the first entry and the scale-out, then split on the add, the reversal and the exit.*

Which fill deserves the closest look? Fill 4.

When `strategy.entry()` fires against an open position in the other direction, TradingView adds the open size to the new order, so a single `sell 2` closes the long and opens the short. The order says 2, the position says 1, and both are right, because they answer different questions.

What about fill 3? It’s the sneaky one. The strategy just sold a contract, yet the position word still reads `long`. Nothing in the position pair says a sale happened. It only names the target: long 1.

Order placeholders describe the change, and position placeholders describe the result. A pair only works when both of its halves describe the same thing: two changes, or two results.

## Why are market_position and market_position_size a pair? {#why-are-market_position-and-market_position_size-a-pair}

In PickMyTrade, `data` takes 2 vocabularies, and each needs its own size. With `buy` or `sell`, the alert is an order, so `quantity` has to be the order’s size. With `long`, `short` or `flat`, the alert is a target, so `quantity` has to be the target’s size. That leaves 2 valid pairs, not 4 combinations.

The order pair is what PickMyTrade’s Generate Alert tool writes for a strategy. Its [JSON alert reference](https://docs.pickmytrade.trade/docs/tradingview-json-alert-configuration/) sets `data` to `{{strategy.order.action}}` and `quantity` to `{{strategy.order.contracts}}`, with `pyramid` on and `reverse_order_close` off. Each alert becomes one order that nets against the account, much like a trader clicking buy or sell.

The position pair works more like cruise control. You set the speed and the car works out the throttle. PickMyTrade’s Rithmic JSON guide uses it as the strategy template, with `pyramid` off and `reverse_order_close` on. Under the documented flag rules, every alert closes what’s open and reopens at the target, unless the target is `flat`.

Why do the flags have to change with the pair?

With `reverse_order_close` on, PickMyTrade closes an opposite position before placing the new trade, so a `sell` that was meant as an exit comes out as a reversal instead. That’s why PickMyTrade’s [FAQ](https://docs.pickmytrade.trade/docs/faqs/) steers strategy alerts away from the flag. The position pair is the exception. Its exits arrive as `flat`, and `flat` only closes.

We analyzed every PickMyTrade doc page that mentions these placeholders, and only one of the five, the Rithmic guide, puts `{{strategy.market_position_size}}` in `quantity`. The [limit-order guide](https://docs.pickmytrade.trade/docs/automating-tradingview-strategies-with-limit-orders/) keeps the position word but requires a fixed quantity. The [multiple TP/SL workaround](https://docs.pickmytrade.trade/docs/pickmytrade-multiple-tp-sl-strategy-workaround/) needs one too, because its exit legs have to add up to it.

## Which pair does your strategy type need? {#which-pair-does-your-strategy-type-need}

Strategies come in 3 types in PickMyTrade’s strategy guide: continuous, flat and partial exit. The type decides the pair. Continuous and flat strategies gain the most from the position pair, because it repairs a drifted account on the next alert. Partial-exit strategies belong on the order pair, because the position pair rebuilds the whole position on every step.

### Continuous strategies: the position pair {#continuous-strategies-the-position-pair}

A continuous strategy is always in the market and flips on every signal. On the order pair, each flip arrives as one netted order at twice the size, such as `sell 2` to go from long 1 to short 1. That works for as long as the account matches the chart.

But what if a broker-side stop loss closed the long an hour earlier? The same `sell 2` hits a flat account and opens short 2, double what the strategy meant. A prop firm’s daily-loss liquidation or end-of-day flatten causes the same drift, because TradingView never hears about it.

The position pair sends `short 1` instead. PickMyTrade closes whatever is open, which here is nothing, then sells 1. The account lands on short 1 either way, and a normal flip still costs the same 2 contracts as the netted order.

### Flat-to-flat strategies: the position pair, if anything else exits {#flat-to-flat-strategies-the-position-pair-if-anything-else-exits}

A flat strategy enters, exits completely and waits. Both pairs trade the same contracts here, 1 in and 1 out. The difference only shows after an outside exit, when an [auto trail](https://blog.pickmytrade.trade/auto-trail-stop-futures-math-trigger-distance-frequency/) or a take-profit closes the trade before the strategy does.

The strategy’s own exit still fires later. On the order pair it sends `sell 1` to a flat account and opens a short nobody asked for. On the position pair it sends `flat`, and there’s nothing left to close.

What if only the strategy ever exits? Then either pair works, and the default order pair is the simpler one.

### Partial exits and pyramiding: the order pair {#partial-exits-and-pyramiding-the-order-pair}

Scaling is where the position pair gets expensive. With `pyramid` off and `reverse_order_close` on, PickMyTrade closes the open position before every new signal, same side included. A scale-out from long 2 to long 1 therefore closes 2 contracts and buys 1 back. The end state is right, but it costs 3 contracts instead of 1, and the account sits flat between the two orders.

Contracts traded to follow the same fills
1-contract steps, PickMyTrade flag rules as documented

Order pair

Position pair
Always in the market, 5 signals

9

9
Flat to flat, 5 round trips

10

10
Scale in to 3, then out to 0

6

18

  Flips and round trips cost the same on both pairs. A scale-in and scale-out cycle costs three times as much on the position pair.
*Flips and round trips cost the same on both pairs. A scale-in and scale-out cycle costs three times as much on the position pair.*

From our analysis of the flag rules, a strategy that scales in to 3 and back out trades 6 contracts on the order pair and 18 on the position pair. PickMyTrade’s strategy guide also lists broker-side TP and SL as unsupported for partial-exit strategies. So the outside exits that justify the position pair mostly can’t happen on a scaling strategy anyway.

### What if a scaling strategy can also be closed from outside? {#what-if-a-scaling-strategy-can-also-be-closed-from-outside}

Then each pair has a cost. The position pair re-syncs the account but rebuilds the position on every step. The order pair stays cheap, yet after a prop firm’s auto-flatten or a manual close it’s out of sync, and the next scale-out sells into a flat account.

For most scaling strategies, keep the order pair and turn the final exit into a `close`. Set `data` to `{{strategy.order.alert_message}}` and give every order call an `alert_message` of `buy`, `sell` or `close`. Our [TradingView placeholder guide](https://blog.pickmytrade.trade/tradingview-placeholder-list-strategy-variables-explained/) walks through the pattern.

Under PickMyTrade’s [close alert rules](https://docs.pickmytrade.trade/docs/faqs/), a `close` never opens a position, so a late final exit on a flat account does no harm. Partial exits get no such guard, because the [comment-based partial close](https://docs.pickmytrade.trade/docs/reverse-order-close-tradingview-pickmytrade/) works with indicator alerts only. After an outside exit, pause the alert until the strategy is flat again, then switch it back on.

## Mixing the pairs: two one-field mistakes {#mixing-the-pairs-two-one-field-mistakes}

Mixing the halves breaks an account quietly. We walked the five fills through the two most likely one-field edits of the default template. One left the account wrong after 4 of 5 fills and still long once the strategy was flat. The other turned a scale-out into a buy.

### Mix 1: market_position_size in an order-pair alert {#mix-1-market_position_size-in-an-order-pair-alert}

Keep `{{strategy.order.action}}` in `data`, swap `quantity` to `{{strategy.market_position_size}}`, and every alert sends the position total as if it were the order. Fill 2 buys 2 instead of 1, so the account holds 3. Fill 3 sells 1 and leaves 2.

Fill 4 sells 1 rather than 2, which keeps the account long while the strategy is short. Fill 5 sends a buy for 0 contracts. A zero-size order can’t reduce anything, so the account sits long 1 while the chart shows flat.

### Mix 2: market_position with the default flags {#mix-2-market_position-with-the-default-flags}

Now make the opposite edit. The strategy guide calls the position word an optional change, and it’s tempting to swap `data` and stop there. With the default `pyramid: true` and `reverse_order_close: false` still in place, `long` behaves like a buy and `short` like a sell.

Fill 3 pays for it. The strategy sold a contract, the alert said `long` with an order size of 1, and the account bought another, ending at long 3 against the strategy’s 1. Fill 4 then sells 2 and leaves the account long 1 when it should be short.

Account position when the pairs get mixed

Strategy on the chart (both correct pairs match it)

Mix 1: order.action + market_position_size

Mix 2: market_position + order.contracts

+3

+2

+1

0

-1
Contracts (short below 0)
Fill 1
Enter
Fill 2
Add
Fill 3
Scale out
Fill 4
Reverse
Fill 5
Exit

Mix 1 stuck long 1
Mix 2 long 3

  Both correct pairs track the strategy line exactly. Each one-field edit drifts at the first add or scale-out.
*Both correct pairs track the strategy line exactly. Each one-field edit drifts at the first add or scale-out.*

Would a quick test catch either mistake? We found the same blind spot in both mixes: fill 1 looks perfect, because from flat the order size and the position size are equal. A single test entry can’t expose them, which is why the demo test further down runs all five fills.

## The exit trap: market_position_size reads 0 on every full exit {#the-exit-trap-market_position_size-reads-0-on-every-full-exit}

On a full exit, `{{strategy.market_position_size}}` reads `0` every time. It’s tempting to use it in close alerts, so the alert closes whatever the strategy holds. By the time the placeholder resolves, the strategy holds nothing. The number you actually want is the size before the fill.

So where does the closed size live? Two placeholders carry it. `{{strategy.prev_market_position_size}}` is the size before the fill, which on a full exit is the whole position. `{{strategy.order.contracts}}` is the size of the exit order, and it matches unless the exit also reversed.

![Code that parses JSON properties glowing on a dark monitor, like a receiver reading a strategy.market_position alert payload.](https://images.pexels.com/photos/6424591/pexels-photo-6424591.jpeg?auto=compress&amp;cs=tinysrgb&amp;w=1200&amp;fm=webp)

Does that zero hurt inside PickMyTrade? Mostly, no. Its close alert closes open positions and cancels open orders whatever the quantity says. The Rithmic position template even sends that `0` on every exit, because `flat` ignores the size. The zero bites when the number feeds something that trusts it, such as a sizing formula, a trade log or a second webhook receiver.

&gt; **Quick check:** Put `{{strategy.prev_market_position}} {{strategy.prev_market_position_size}} -&gt; {{strategy.market_position}} {{strategy.market_position_size}}` in a test alert’s message. A full exit from a 2-contract long logs `long 2 -&gt; flat 0`.

## Set up each pair in PickMyTrade {#set-up-each-pair-in-pickmytrade}

Switching pairs means editing 4 fields. Generate a strategy alert as usual, then change `data`, `quantity`, `pyramid` and `reverse_order_close` together. Leave every other field as generated. Changing only one or two of them is exactly how the mixed setups above happen.

Which pair does your alert need?

Does the strategy scale in or out?
Pyramiding entries or partial exits

Yes

No

Order pair
data: order.action
quantity: order.contracts
pyramid: true
reverse_order_close: false

Can anything else
close the position?
SL/TP, auto trail, prop-firm
flatten or a manual exit

Yes

No

Position pair
data: market_position
quantity: market_position_size
pyramid: false
reverse_order_close: true

Either pair works
Keep the order pair,
PickMyTrade’s default

  Scaling decides first. Outside exits decide second. A scaling strategy that can also be closed from outside adds a close on its final exit.
*Scaling decides first. Outside exits decide second. A scaling strategy that can also be closed from outside adds a close on its final exit.*

| Field | Order pair (default) | Position pair |
| --- | --- | --- |
| data | {{strategy.order.action}} | {{strategy.market_position}} |
| quantity | {{strategy.order.contracts}} | {{strategy.market_position_size}} |
| pyramid | true | false |
| reverse_order_close | false | true |

The position pair’s four lines look like this:

```
"data": "{{strategy.market_position}}",
"quantity": "{{strategy.market_position_size}}",
"pyramid": false,
"reverse_order_close": true,
```

Leave [same_direction_ignore](https://docs.pickmytrade.trade/docs/same-direction-ignore-json-alert/) set to `false` on the position pair. When it’s `true`, PickMyTrade ignores alerts on the side you already hold, and on this pair those alerts are your adds and scale-outs. The [TradingView webhook alert field reference](https://blog.pickmytrade.trade/tradingview-webhook-alerts-field-reference/) covers the rest of the payload field by field.

### Test the pair on a demo before it trades real money {#test-the-pair-on-a-demo-before-it-trades-real-money}

How long does a proper test take? About six minutes on a 1-minute chart. This Pine script places the same five orders as the walkthrough, one per bar, starting on the first live bar after you create the alert:

```
//@version=6
strategy("Five-fill alert test", overlay = true, pyramiding = 2, default_qty_type = strategy.fixed, default_qty_value = 1)

var int step = 0
if barstate.isrealtime
    step += 1
    switch step
        1 =&gt; strategy.entry("Long1", strategy.long)
        2 =&gt; strategy.entry("Long2", strategy.long)
        3 =&gt; strategy.close("Long2")
        4 =&gt; strategy.entry("Short", strategy.short)
        5 =&gt; strategy.close("Short")
```

Then run it against a demo account, the same way our [Tradovate demo trading test plan](https://blog.pickmytrade.trade/tradovate-demo-trading-test-a-strategy-before-you-fund-it/) checks every alert before real money. Create an alert on the script with the “Order fills only” condition, the PickMyTrade webhook URL and your edited JSON, then check three things:

| Check | What a pass looks like |
| --- | --- |
| All 5 fills | The demo position matches the strategy’s after every fill |
| A hand close after fill 2 | On fill 3 the position pair comes back to long 1, while the order pair sells into a flat account |
| Order history | The position pair shows extra contracts on the add and the scale-out |

Generating the alert itself takes a few clicks, and this PickMyTrade walkthrough shows each one.

PickMyTrade runs both pairs on Tradovate and Rithmic accounts for $50 a month, with a 7-day free trial and no credit card. [Compare the plans](https://pickmytrade.trade/pages/pricing/), read [who runs PickMyTrade](https://pickmytrade.trade/pages/about/), or [contact the PickMyTrade team](https://pickmytrade.trade/pages/contact-us/) if you’d like a second look at your JSON.

## Frequently asked questions {#frequently-asked-questions}

**What does {{strategy.market_position}} return in a TradingView alert?** 

One of 3 words: `long`, `short` or `flat`. It describes the strategy’s position after the order that triggered the alert filled, so an exit sends `flat` and a reversal sends the new side. Its twin, `{{strategy.prev_market_position}}`, sends the word from before the fill.

 
 
**Can {{strategy.market_position_size}} be negative?** 

No. It’s the absolute size after the fill, so a 3-contract short reads `3` and any exit that leaves the strategy flat reads `0`. When you need the sign, `{{strategy.position_size}}` reads `-3` for that same short, though a signed number doesn’t belong in a `quantity` field.

 
 
**Should quantity use market_position_size or order.contracts?** 

Match it to `data`. With `{{strategy.order.action}}` in `data`, use `{{strategy.order.contracts}}`, the size of the order that filled. With `{{strategy.market_position}}`, use `{{strategy.market_position_size}}`, the size to end at. In our five-fill walkthrough, one mixed setup left the account wrong after 4 of 5 fills.

 
 
**Why does my close alert send a quantity of 0?** 

It’s a timing issue. The market_position_size placeholder reports the position after the fill, and a full exit leaves 0. Use `{{strategy.prev_market_position_size}}` or `{{strategy.order.contracts}}` when you need the size that closed. PickMyTrade’s close and `flat` actions close the position regardless, so the 0 mainly matters in logs and formulas.

 
 
**Does the position pair work with limit orders?** 

Yes, and PickMyTrade’s limit-order guide builds on the position word. It sets `data` to `{{strategy.market_position}}`, fixes the quantity and turns `reverse_order_close` on, so a `flat` alert closes and a `short` alert reverses. It’s one of 5 PickMyTrade doc pages that use the placeholder.

 
 

## Before you save the alert {#before-you-save-the-alert}

Run 3 checks before the alert goes live. First, pick the pair. An always-in or flat-to-flat strategy belongs on the position pair whenever something besides the strategy can close a trade. A scaling strategy stays on the order pair, with a `close` on its final exit if it faces the same risk.

Second, change all 4 fields together, because `{{strategy.market_position}}` and `{{strategy.market_position_size}}` only work as a pair. Third, prove the result on 5 demo fills before a funded account sees it. After that, [route one TradingView alert to several prop-firm accounts](https://blog.pickmytrade.trade/route-one-tradingview-alert-multiple-prop-firm-tradovate-accounts/).

_Written by the PickMyTrade Team, the automated futures and execution specialists behind PickMyTrade’s webhook routing. Editorial note: placeholder behavior and PickMyTrade settings were checked against TradingView and PickMyTrade documentation on September 18, 2026, and the pair outcomes follow PickMyTrade’s documented pyramid and reverse rules. Confirm them on a demo account before trading live. This article is for information only, not trading or financial advice._

---

Also Checkout: [Automate TradingView Indicators with Tradovate Using PickMyTrade](https://blog.pickmytrade.trade/automate-tradingview-indicators-with-tradovate-using-pickmytrade/)

For AI tools &amp; developers:[View Markdown →](https://blog.pickmytrade.trade/strategy-market_position-vs-market_position_size-in-alerts.md)