June 17, 2022

Improvements

This release contains a few improvements to make managing strategies a little bit more flexible and compatible with TradingView strategies out of the box.

Sides Isolated

In the Basic Options section of a strategy configuration, you will now see a new Sides isolated checkbox. When this checkbox is checked with Sides set to Bullish or Bearish, the strategy will never close a position if the position is on the other side. So for example if you have Sides set to Bullish and there is currently an open bearish position not created by this strategy subscription, then when you receive a bullish signal, the bearish position will not be exited and a bullish position will not be entered because sides are isolated. Without Sides isolated checked, the bearish position would be exited before entering a bullish position.
Sides isolated checkbox

Disable Side Swapping

In the Basic Options section of a strategy configuration, you will now see a new Disable side swapping checkbox. When this checkbox is checked with Sides set to Both, then TradersPost will never automatically enter a new position on the other side after exiting a position. For example if you have an open bullish position and you receive a bearish sell signal, the bullish position will be exited and a bearish position will not be entered until you send another bearish sell signal at a later time. Without Disable side swapping checked, TradersPost will automatically exit the open position and enter on the other side with one signal.
Disable side swapping checkbox

TradingView Integration Improvements

Quantity Management

In the Position Size section when editing a strategy subscription, you will see a new checkbox labeled Subtract exit quantity from signal quantity.
Subtract exit quantity from signal quantity
When this checkbox is checked, if you send a quantity that is greater than the quantity of your open position, then we will subtract the exit quantity from signal quantity and then the remainder will be used for the quantity in the entry order. So in the below example we had an open position with a quantity of 5 and we sent a quantity of 12 in the signal, so it exited the 5 short and entered 7 long.
If you send a quantity equal to the quantity of the open position, then the open position will be fully exited and a new position will be entered on the opposite side with the same quantity. If you want to only exit the open position and don't want to enter on the opposite side, then you will also need to send sentiment=flat in the signal. Read more on that below.
Exit quantity subtracted from signal quantity and remainder used for entry quantity.

Signal Sentiment

To make it easier to integrate TradingView strategies with TradersPost out of the box, we've introduced a new parameter named sentiment that you can use when sending signals. The sentiment parameter indicates to TradersPost what the sentiment of the open position should be after executing the trade.
The sentiment parameter can have the following values:
  • bullish - exit bearish position and enter bullish position
  • bearish - exit bullish position and enter bearish position
  • flat - no open position after executing trade
Here is an example of what that would look like if you are using a TradingView strategy. The {{strategy.market_position}} variable has a value of long, short or flat and it represents the side of the position you will be on after the strategy order is executed.
{
"ticker": "{{ticker}}",
"action": "{{strategy.order.action}}",
"sentiment": "{{strategy.market_position}}"
}
To make TradersPost compatible with TradingView {{strategy.market_position}} variable out of the box, you can send long or short instead of bullish or bearish when using the sentiment parameter.
So for example say you currently have an open bearish position and you only want to exit the position without entering bullish on the other side. This signal would flatten the bearish position and would not enter bullish on the opposite side.
{
"ticker": "SPY",
"action": "buy",
"sentiment": "flat"
}
Or if you currently have an open bullish position and you only want to exit the position without entering bearish on the other side. This signal would flatten the bullish position and would not enter bearish on the opposite side.
{
"ticker": "SPY",
"action": "sell",
"sentiment": "flat"
}
This is effectively the same as using the action=exit. However, the exit action is not compatible with TradingView strategies out of the box so using a combination of action and sentiment allows TradersPost to work with TradingView strategies more seamlessly out of the box.
Sending action=exit or sentiment=flat will always exit the full quantity of the open position regardless of the quantity sent in the signal.
Additionally, say for example if you have an open bearish position and you send action=buy and sentiment=bearish then the bearish position will only be exited and a bullish position will not be entered on the other side. This is useful when you are only partially exiting a bearish position.
For example say you have an open bearish position with a quantity of 5, you could partially exit 2 quantity and remain in a bearish position with a quantity of 3.
{
"ticker": "SPY",
"action": "buy",
"sentiment": "bearish",
"quantity": 2
}
You can optionally specify the Sentiment parameter when manually sending a signal to a webhook with the Send Request functionality.