Sign up for free to use this document yourself.
  • Straddle Strategy

    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 at the middle of the range, then you will invest only 50% of your 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 profit within your risk tolerance.

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

    test

  • Straddle Scaling

{"cards":[{"_id":"75e2330977a83ea40b000022","treeId":"75e2342a77a83ea40b00001e","seq":12757409,"position":2,"parentId":null,"content":"# Straddle Strategy\n\n## Introduction\n\nThe 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`).\n\nIf 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 at the middle of the range, then you will invest only 50% of your 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).\n\nThis 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).\n\n## Definitions\n\n### Input Fields\n\n**Base Allocation**\n\nAssuming 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.\n\nThis prevents the situation where a manual withdrawal from your base wallet will immediately make your strategy go into allocation mode and start buying. \n\n**Maximum Allocation**\n\nAssuming 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*. \n\n**Lower Target Price and Upper Target Price**\n\nThis 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.\n\nIf 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.\n\n**Lower Margin and Upper Margin**\n\nThe 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.\n\nIf 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.\n\n**Pivot Mode and Pivot Margin**\n\nSetting 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.\n\nSetting 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.\n\n**Scale Mode**\n\nScaling 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%`.\n\nWith 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.\n\nThis 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.\n\nWhen 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.\n\n### Calculated Fields\n\nHere are the definitions for each field that is calculated by the strategy (when no scaling is applied):\n\nThe `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`.\n\n```\nbasePercent = baseAllocationValue / maxAllocation * 100\n```\n\nThe `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.\n\n```\ntargetPercent = (upperPrice - currentPrice) / (upperPrice - lowerPrice)\n```\n\nWhen 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.\n```\nisTimeToBuy = basePercent + rangePivotMargin < targetPercent\nisTimeToSell = basePercent - rangePivotMargin > targetPercent\n```\n\n## Example\n\nHow 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?\n\nLet'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.\n\n```\nMax Allocation = 1.00000000 BTC\nCounter Wallet Balance = 1.00000000 BTC\nPivot Mode = PRICE\nPivot Margin = 10.00%\nScale Mode = NONE\nLower Target Price = 0.02500000\nUpper Target Price = 0.15000000\nLower Margin = 100%\nUpper Margin = 0%\n```\n\n**Starting point**\n\nWe 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).\n```\nCurrent Price = 0.04300000 BTC\nCurrent Mode = NEUTRAL\nCurrent Target = 85.60%\nRange Pivot Margin = 11.99%\nNext Allocation Level = 0.03856738 BTC\nNext Distribution Level = 0.04714235 BTC\nBase Allocation = 20 ZEC (86.00% @ 0.86000000 BTC)\nWallet Balance = 1.86000000 BTC\n```\n\n**Price decreases to next allocation price**\n\nThe 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*.\n```\nCurrent Price = 0.03856738 BTC\nCurrent Mode = NEUTRAL\nCurrent Target = 89.15%\nRange Pivot Margin = 12.00%\nNext Allocation Level = 0.03471098 BTC\nNext Distribution Level = 0.04242764 BTC\nBase Allocation = 23.1142769 ZEC (89.15% @ 0.89145710 BTC)\nWallet Balance = 1.77104733 BTC\n```\n\n**Price increases to next distribution level**\n\nThe 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*.\n```\nCurrent Price = 0.04242764 BTC\nCurrent Mode = NEUTRAL\nCurrent Target = 86.06%\nRange Pivot Margin = 12.01%\nNext Allocation Level = 0.03818588 BTC\nNext Distribution Level = 0.04666932 BTC\nBase Allocation = 20.2866518 ZEC (86.07% @ 0.86071476 BTC)\nWallet Balance = 1.85997453 BTC\n```\n\n**Price increases back to starting point**\n\nThe 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.\n\n```\nCurrent Price = 0.04300000 BTC\nCurrent Mode = NEUTRAL\nCurrent Target = 85.60%\nRange Pivot Margin = 12.01%\nNext Allocation Level = 0.03818588 BTC\nNext Distribution Level = 0.04666932 BTC\nBase Allocation = 20.2866518 ZEC (87.23% @ 0.87232603 BTC)\nWallet Balance = 1.87158580 BTC\n```\n\n**End result**\n\nIn 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 profit within your risk tolerance.\n \n```\nProfit % = 0.62289247\nCommissions Paid % = 0.03226828\nCommissions Paid = 0.00060019\n```\ntest"},{"_id":"75e22e4977a83ea40b000028","treeId":"75e2342a77a83ea40b00001e","seq":12757401,"position":1,"parentId":"75e2330977a83ea40b000022","content":"# Straddle Scaling"}],"tree":{"_id":"75e2342a77a83ea40b00001e","name":"TraderPlan","publicUrl":"traderplan"}}