Straddle Strategy

video File:Placeholder
Write the first paragraph of your page here.

#### Introduction

The straddle strategy is primarily used for risk management, where you set the amount of your portfolio that will be invested in a given market (i.e. currency pair), with the amount varying based on where the market price is within a given price range (Lower Target Price and Upper Target Price).
If the market price of ZEC-BTC increases towards the upper range, then the percentage that will be invested will decrease. Assuming no scaling is applied, when the price is in the middle of the range, then you will invest only 50% of the maximum allocation of your portfolio. If the price increases to the point that it's equal to your upper target price, then you'll invest 0%, which means you'll sell all of your ZEC (your base ) into BTC (your counter).

This strategy also has a secondary purpose, which is to profit from short-term price fluctuations. Let's say you set a Pivot Margin of 10%, If the price decreases to a level that results in a 10% difference between the Base Allocation % and the Current Target %, then you'll be in Allocation Mode, which means you will buy enough ZEC so that you go into Neutral Mode, where there is no longer a difference between the two percentages. Conversely, when the price increases so that your Base Allocation % is 10% higher than your Current Target %, you'll sell an amount ZEC so that you are back to neutral (or zero difference).

=== Definitions

Input Fields

**Base Allocation**

Assuming a ZEC-BTC pair, this is the amount of ZEC that the strategy will use for its calculations. The starting value is your base wallet balance, and you can override the value. Also, if there are deposits and withdrawals in your base wallet, they won't affect the base allocation. The base allocation will remain the same unless a buy or a sell is triggered by the straddle strategy.

This prevents the situation where a manual withdrawal from your base wallet will immediately make your strategy go into allocation mode and start buying.

**Maximum Allocation**

Assuming a ZEC-BTC pair, then this is the amount of base (ZEC) measured in counter (BTC) that you will have allocated when the Current Target % is 100%. You can set this to budget how much BTC you are willing to invest. The lower the market price, the more you will invest, up to your Maximum Allocation.

**Lower Target Price and Upper Target Price**

This is used to calculate the Current Target %. The midpoint of your lower and upper price will result in a Current Target % of 50% when no scaling is applied.

If the market price falls outside your range, then the strategy will be suspended (i.e. no buys or sells will occur) until the price moves back into your range.

**Lower Margin and Upper Margin**

The margin is used to adjust your Lower Target Price and Upper Target Price so the range is narrower, where 0% is at the lowest price, and 100% is at the highest price.

If the market price falls outside the price range adjusted by your margin, then the strategy will be suspended until the price moves back into your margin-adjusted range.

**Pivot Mode and Pivot Margin**

Setting the pivot mode to "PRICE" and a pivot margin to 10% will look for a 10% movement in the actual price to initiate a buy or sell.

Setting the pivot mode to "RANGE" and a pivot margin to 10% will look for a 10% movement of your straddle range (Upper-Lower) to initiate a buy or sell.

**Scale Mode**

Scaling is set to NONE by default. You may want to increase your scaling if you prefer to allocate more at the lower price points. For example, if the Current Target % of 50% is too high, then increasing your scaling will reduce your Current Target % to say 40%.

With no scaling, you'll be increasing your allocation by the same amount for each dollar decrease in price. With scaling, you'll be increasing your allocation by a higher amount for each dollar decrease in price.

This feature is more profitable when you prefer to wait for the price to drop much before doing most of your allocation. For example, let's assume you set your lower target price to $11,000 and upper target price to $25,000.

When no scale is used, you allocate 75% of your opportunity when the price is $14,500. When you're aggressively scaled, you allocate 75% of your opportunity when the price is $12,000. As you can see, the price needs to be much lower than if you were not scaled. If you know the price is going to drop to $12,000, then using an aggressive scale will be more profitable because you saved yourself from allocating at a higher price under no scaling.

 == ===

#### Calculated Fields

Here are the definitions for each field that is calculated by the strategy (when no scaling is applied):

The Base Allocation % is your base allocation (converted into your counter value) as a percentage of your Maximum Allocation. If your Maximum Allocation is 1.00 BTC and your Base Allocation is 20 ZEC which is equivalent to 0.86 BTC, then your Base Allocation % is equal to 0.86 / 1.00 \* 100 = 86.

basePercent = baseAllocationValue / maxAllocation \* 100

The Current Target is the position of the market price relative to a given price range (upperPrice and lowerPrice). If no scaling is applied, then 50% means the price is at the midpoint of your range. The more aggressive your scale, then lower the percentage. The Current Target is used as the percentage that you want your Base Allocation % to become.

targetPercent = (upperPrice - currentPrice) / (upperPrice - lowerPrice)

When do you buy or sell? You buy when your Base Allocation % is less than your Current Target Percent % by more than your Pivot Margin %, assuming your Pivot Mode is set to RANGE. A similar logic applies when you sell.

isTimeToBuy = basePercent + rangePivotMargin < targetPercent

isTimeToSell =  basePercent - rangePivotMargin > targetPercent

**Example**

How does the Straddle Strategy work in practice? How does it limit your risk, and how is it profitable even when the market is moving side-ways?

Let's say you added a straddle with the below settings. We set the Pivot Mode to PRICE to ensure that we only trade when the price has moved by 10% or more.

Max Allocation = 1.00000000 BTC Counter Wallet Balance = 1.00000000 BTC Pivot Mode = PRICE Pivot Margin = 10.00% Scale Mode = NONE Lower Target Price = 0.02500000 Upper Target Price = 0.15000000 Lower Margin = 100% Upper Margin = 0% Starting point

We begin at a neutral state because we've allocated the same percentage as the current target. Since we've set the Pivot Mode to PRICE, the algorithm will convert the Pivot Margin to the equivalent RANGE of 11.99% so that we only buy or sell when the price exceeds 10% of the target price (i.e. the price in neutral mode).

Current Price = 0.04300000 BTC Current Mode = NEUTRAL Current Target = 85.60% Range Pivot Margin = 11.99% Next Allocation Level = 0.03856738 BTC Next Distribution Level = 0.04714235 BTC Base Allocation = 20 ZEC (86.00% @ 0.86000000 BTC) Wallet Balance = 1.86000000 BTC Price decreases to next allocation price

The market price of ZEC decreases to 0.03856738 BTC, putting us in ALLOCATION. The algorithm buys ZEC so we now have a Base Allocation of 23.1142769 ZEC (previously 20 ZEC), which puts us back into NEUTRAL.

Current Price = 0.03856738 BTC Current Mode = NEUTRAL Current Target = 89.15% Range Pivot Margin = 12.00% Next Allocation Level = 0.03471098 BTC Next Distribution Level = 0.04242764 BTC Base Allocation = 23.1142769 ZEC (89.15% @ 0.89145710 BTC) Wallet Balance = 1.77104733 BTC Price increases to next distribution level

The market price of ZEC increases to 0.04242764 BTC, putting us in DISTRIBUTION. The algorithm sells ZEC so we now have a Base Allocation of 20.2866518 ZEC (previously 23.1142769 ZEC), which puts us back into NEUTRAL.

Current Price = 0.04242764 BTC Current Mode = NEUTRAL Current Target = 86.06% Range Pivot Margin = 12.01% Next Allocation Level = 0.03818588 BTC Next Distribution Level = 0.04666932 BTC Base Allocation = 20.2866518 ZEC (86.07% @ 0.86071476 BTC) Wallet Balance = 1.85997453 BTC Price increases back to starting point

The market price of ZEC increases to where it started, at 0.04300000 BTC. This is only a 1.3% increase, which is not enough to exceed the Next Distribution Level of 0.04666932 BTC. Therefore, we are still in NEUTRAL and no sell will occur.

Current Price = 0.04300000 BTC Current Mode = NEUTRAL Current Target = 85.60% Range Pivot Margin = 12.01% Next Allocation Level = 0.03818588 BTC Next Distribution Level = 0.04666932 BTC Base Allocation = 20.2866518 ZEC (87.23% @ 0.87232603 BTC) Wallet Balance = 1.87158580 BTC End result

In a single iteration of the ZEC-BTC price dipping by 10%, we have earned 0.62% profit after commissions of 0.25% per trade. As we know, there are many of these fluctuations every week, so even if the market is moving sideways, you can continually increase your investment. And if the market is trending, you'll automatically take profit when the price moves towards your upper price, or automatically buy the dip, or buy lots when there's a fire sale. In this way, regardless of what the market is doing, you are making a profit within your risk tolerance.

Profit % = 0.62289247 Commissions Paid % = 0.03226828 Commissions Paid = 0.00060019

## 1 - Base Allocation

This option sets the base asset allocation you want for the straddle pair.

*Example: 1 2*

For a BTC market, the above entry will set 2 BTC as the maximum amount TraderPlan will trade with from your exchange wallet.

## 2 - Maximum Allocation

This option sets the maximum counter allocation you want for your straddle pair.

*Example: 2 5000*

For a USDT market, the above entry will set 5000 as the maximum counter allocation amount which TraderPlan will trade with from your portfolio.

## 3 - Active

This option toggles the straddle to active/inactive (Represented as True/False).

*Example: 3 true*

## 4 - Pivot Margin

This option establishes the % change needed in market price to initiate a buy or sell.

*Example: 4 4*

*The above entry will set the pivot margin to 4%.*

## 5 - Pivot Mode

This option allows the user to toggle between Pivot Range and Pivot Price modes. In Pivot Range mode: TraderPlan will buy and sell as the market price increases or decreases by your pivot margin %, relative to the range set by your upper and lower target prices. In Pivot Price mode:TraderPlan will buy and sell as the market price increases or decrease by your pivot margin %, regardless of the range set by your upper and lower target prices.

*Example: 5 Range*

*The above entry will set the pivot mode to Range.*

## 6 - Scale Mode

When activated, Scale Mode adjusts the trading behavior of the Bot to weigh buys heavier towards the bottom of the market, and sells heavier towards the top of the market. Mild, Medium and Aggressive scaling profiles are available.

*Example: 6 OFF*

*The above entry set Scale Mode to None.*

## 7 - Lowest Target Price (100%)

This is what you want your straddle to have as the lowest market price in your straddle range.

*Example: 7 500*

*For a USDT market, the above entry will set the lower price in your straddle range at 500 US Dollar Tether (USDT).*

## 8 - Allocation Choke %

You can set your straddle to not initiate a buy at a set target percentage of your allocation.

*Example: 8 90*

*The above entry will set TraderPlan to not buy when the Current Target is 90% or above.*

## 9 - Trail Stop Mode (Allocation)

*This option toggles trailing buys on and off.*

*Example: 9*

## 10 - Trail Stop % (Allocation)

If Trail Stop Mode is toggled on, this will allow the bot to follow momentum of the market beyond the specified pivot margin %.

*Example: 10 0.1*

*The above entry will initiate a 0.1% market price trail, which will continue to follow the market price down. TraderPlan will initiate a buy after a 0.1% increase in market price.*

## 11 - Buying Order Mode

This toggles the buy mode to LIMIT/MARKET (applies to exchanges that have these options).

*Example: 11 LIMIT*

*The above entry sets the buying order mode to limit.*

## 12 - Maker Taker Mode (Allocation)

This toggles the buy order type to MAKER/TAKER (MAKER will create the lowest bid, TAKER fills from the current lowest bid).

*Example: 12 MAKER*

## 13 - Highest Target Price (0%)

This is what you want your straddle to have as the highest market price in your straddle range.

*Example: 13 2500*

For a USDT market, the above entry will set the higher price in your straddle range at $2500 USDT.

## 14 - Distribution Choke %

You can set your straddle to not initiate a sell at a set target percentage of your allocation.

*Example: 14 10*

*The above entry will set TraderPlan to not sell when the Current Target is 10% or below.*

## 15 - Trail Stop Mode (Distribution)

This toggles trailing sells on and off.

*Example: 15*

## 16 - Trail Stop % (Distribution)

If Trail Stop Mode is toggled on, this will allow the bot to follow momentum of the market beyond the specified pivot margin %.

*Example: 16 0.1*

*The above entry will initiate a 0.1% market price trail, which will continue to follow the market price up. TraderPlan will initiate a sell after a 0.1% increase in market price.*

## 17 - Selling Order Mode (Distribution)

This toggles the sell mode to LIMIT/MARKET (applies to exchanges that have these options).

*Example: 17 LIMIT*

*The above entry sets the selling order mode to limit.*

## 18 - Maker Taker Mode (Distribution)

This toggles the buy order type to MAKER/TAKER (MAKER will create the lowest bid, TAKER fills from the current lowest bid).

*Example: 18 MAKER*