# Breakthrough strategy using conditional orders

{% hint style="danger" %}
The strategies in the guide assume special market conditions for the convenience of explanation. However, it is essential to keep in mind that risk management is of paramount importance because, in reality, market conditions can be quite different.
{% endhint %}

PNIX DEX uses the order book method, unlike general AMM-type DEX. As a result, it provides not only limit orders but also several stop order functions to facilitate strategic automated trading. In the following example, we will demonstrate how to utilize these stop orders for a simple yet effective trading strategy.

## Breakthrough strategy using conditional orders

If the market price is moving consistently in a certain direction, it presents a potential investment opportunity. Let's explore a strategic example of following such market trends.

The simplest trend-following strategy is the breakthrough strategy, which involves setting specific price levels and taking a position in a specific direction when those levels are breached. Phoenix Dex allows users to establish both long and short positions through margin trading. However, in this guide, we will focus on creating a long position by buying tokens without leverage.

### Setting Price Level

To implement a breakthrough strategy, you must establish price levels to be breached. Usually, support lines are set below, and resistance levels are set above the current market price. There are several methods for determining these levels, including the use of trading indicators, which are considered the essence of the strategy. In this illustration, we will utilize a simple indicator known as price channels.

The price channel entails creating a channel based on the highest and lowest prices observed within a specific period of candlestick information. For this example, we will use a 4-hour candle with 17 unit periods to construct the price channel.

### Setting up an Entry Trigger

By analyzing the chart below, we can observe that the price of Ethereum has established a support line at $1823 and a resistance line at $1878, using the price channels indicator. The initial breakthrough occurred at the 'break out' point when the price surpassed the resistance level. However, given the volatile nature of the market, it is prudent to wait for another confirmation of the breakout.

To facilitate this process and avoid constant monitoring, users can employ a stop order. The stop order will automatically execute a trade at the desired price once the breakout is confirmed. Instructions on how to set up stop orders can be found [here](/decentralized-exchange/step-by-step-user-guide/trade-order/strategy-order.md#take-profit).

> Buying Spree Order
>
> Order type: Market
>
> Stop price: $1878
>
> Amount: $100
>
> Good till time: 28d

If you submit a follow-up buy order as described above after the first breakout, the price may temporarily drop below the resistance line and then break through it again (retest). In this case, a market order will be submitted and executed to buy Ethereum, allowing you to build a long position.

<figure><img src="/files/xN32cIKFcI0TsUw4cc2i" alt=""><figcaption><p> Entering a breakthrough strategy using the resistance line of the price channel</p></figcaption></figure>

### Setting up an exit trigger

Experienced traders understand that markets can change unpredictably, even after breaking through resistance and following a trend. Therefore, it is crucial to prepare for potential losses and profits.&#x20;

#### Setting a stop-loss order

The first step is to determine the amount of loss you can afford. By setting the maximum acceptable loss, you can approach the market with a clear understanding of your risk tolerance. To set the maximum loss value, you can utilize a stop order. This allows you to establish a price trigger for exiting your position, similar to setting an entry trigger, enabling you to sell at a specific price without the need for constant monitoring of the market.

When implementing a breakthrough strategy using indicators like price channels, the support line is often used as the stop-loss price, just as the resistance line is commonly employed as the entry price.

> Stop Loss Order
>
> Order type: Market
>
> Stop price: $1823
>
> Amount: $100
>
> Good till time: 28d

With the trader now having set a stop-loss order to limit potential losses to around 3%, even during moments of nervousness or when not constantly monitoring the market, it's time to focus on how to secure profits without unnecessary worry.

<figure><img src="/files/iU5yw8y2oeO0XWptRxOL" alt=""><figcaption><p>Escape strategy using price channel resistence and support lines</p></figcaption></figure>

#### Setting up take-profit order

Setting up take-profit orders allows you to utilize triggers for securing profits, similar to stop orders. Once again, we will employ the next level of resistance in the price channel as a price trigger to capitalize on potential gains. Referencing the chart above, each channel and price are clearly depicted for your convenience.

> Take Profit Order
>
> Order type: Market
>
> Stop price: $1937
>
> Amount: $100
>
> Good till time: 28d

Now that we have both the maximum loss and the profit targets set, traders can trade with peace of mind, no longer needing to constantly monitor the chart. However, experienced traders may not be entirely at ease. As we have placed two stop orders for both Stop Loss and Take Profit, if one of the triggers is activated and the order is executed, the position will be closed, and the resulting profit or loss will be confirmed. Meanwhile, the other stop order will remain active. While this can be a valid trading option, the order will be canceled after 28 days. However, if it is executed, it will open a new position, which may not be desirable.

To address this situation, PNIX DEX offers a trading function that can automate even this scenario. This ensures that traders can have more control over their positions, reducing the need for manual intervention and minimizing the risks associated with managing multiple orders simultaneously.

#### Automating stop-loss and take-profit through OCO orders (to be supported in Q4 2023.)

OCO (One Cancels the Other) is an order designed precisely for the situation described above. By placing a stop-loss order and a take-profit order simultaneously after establishing a position, if one of the conditions is met and the order is executed, the other order is automatically canceled. This ensures that only the original intended action is carried out, preventing any undesired transactions.

When placing a sell-for-profit order, it can be entered directly into the order book as an open order, as it is set above the current market price. Thus, it is submitted as a normal limit order. On the other hand, a sell stop-loss order is set at a price lower than the current market price, making it unsuitable for placement on the order book. Therefore, it must be submitted as a conditional order.

For the OCO order, the sell-for-profit order is a regular limit order, while the stop-loss sell order is submitted as a stop order. Once the sell-for-profit order is executed, the stop-loss stop order is automatically canceled, and vice versa. Consequently, when setting up the profit-taking order, the limit price must be submitted, and when configuring the stop-loss order, the stop trigger price must be specified.

> OCO Order
>
> Order type: Market
>
> Limit price: $1937 (Taker profit limit price)
>
> Stop price: $1823 (Stop loss stop price)
>
> Amount: $100
>
> Good till time: 28d

### Maximizing Profits

In the previous section, we effectively utilized stop orders to execute the entry and exit points of the breakthrough strategy. Fortunately, the market continued to trend upwards, and we were able to achieve a gain of around 3% through our well-timed moves. However, let's consider the scenario shown in the chart below. Profits might not be welcomed due to the regret of acting too hastily.

To strategically lock in profits while still holding positions, we can set take-profit triggers at specific moments. For instance, in the price channel depicted below, we can set the resistance line as the take-profit price after the breakout and then designate the same resistance line as the new stop-loss price. Manually monitoring the charts and constantly adjusting stop orders every minute can be quite tiresome. Thankfully, PNIX Dex offers a trading function that automates this situation, making it more convenient and efficient for traders to manage their profits.

<figure><img src="/files/E5OioayyA8mr8Py4cavX" alt=""><figcaption><p>Price Channel in an Uptrend</p></figcaption></figure>

#### Follow the Trend with Trailing Stop Order (to be supported in 4Q 2023)

In the aforementioned example, we set stop-loss and take-profit prices at approximately 3% intervals along the price channel segments. Similarly, a trailing stop order is an order that can be configured to follow the stop price with a gap of 3% if the market price continues to trend in a favorable direction. Unlike a regular stop order, which maintains the fixed stop price set at the time of submission, a trailing stop order dynamically adjusts the stop price as the market price moves favorably, thus allowing you to secure potential profits. However, in case the market price starts moving unfavorably, the trailing stop order will fix the stop price, enabling you to exit the position with minimal losses. This feature will be available for use in version 4Q 2023 of PNIX Dex.

> Trailing Stop Order
>
> Order type: Market
>
> Activation price:&#x20;
>
> Trailing delta: 3%
>
> Amount: $100
>
> Good till time: 28d

If you do not specify an activation price, the order will be triggered upon submission and will start tracking the market price immediately. By observing the chart below, you can notice that the stop price changes at 3% intervals as the price rises. When the market price stops increasing and falls below the last updated stop price, a take-profit order is executed, allowing you to capitalize on the position. In the previous example, we secured a profit of about 3%, which was satisfactory. However, this time, by closely following most of the trends, we managed to achieve substantial profits.

<figure><img src="/files/wAl2v4Gq9qHQA2zsbxZ1" alt=""><figcaption><p>Price channels and trailing stop orders in an uptrend</p></figcaption></figure>

By incorporating stop orders into the appropriate strategy, you can potentially achieve larger profits. In our next discussion, we will explore how to embark on more daring investments by utilizing leverage.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-en.pnix.exchange/strategy/extending-dex-networks/breakthrough-strategy-using-conditional-orders.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
