Pivot - TraderPlan/wiki GitHub Wiki

What is a Pivot Strategy?

The pivot strategy allows you to profit from short-term price movements by buying your positions when the price of your base currency decreases to a desired level, and selling when your profit reaches your desired level.

Settings

1 Allocation

This setting allows the user to run the Pivot Strategy on coins that they are currently holding long term without having the bot sell them off. After creating the new pivot, set this value to 0 and the Pivot Strategy will ignore all held coins before that point. If you are not holding any coins that you want to keep, leave this value alone. Although we give this feature, it is always advised to store held coins in a separate wallet from the exchange you are using Automation.

Example: 1 0

The above entry will hide currently owned coins from the bot and prevent their sell while the pivot strategy is active.

2 Position

Allows the user to manually enter their current position if necessary. If you already have the Base currency and want the bot to sell it, you can manually input its weighted average. If you do not own any of the currency, this value will automatically be calculated by the bot.

Example: 2 .10

In a XRP/BTC market, the above example would set your position to .10 BTC.

3 Active

Toggles the Pivot Pair on or off. Please Note: Default is false which means the Pivot will not start. You need to set this to Active in order for the strategy to run. This is how you start each pivot, individually.

Example: 3

Allocation Behaviour

4 Establishing Amount (1pos)

This setting establishes your 1 position value. This will be the starting value the bot buys when you first initiate the bot and after every time the bot sells and starts over.

Example: 4 .001

In a NEO/BTC market, the above entry will set your position size to .001 BTC. Once the bot is activated, it will buy this amount.

5 Buy Mode

Toggles between Multiplier and Amount modes. In Multiplier mode, you can set the bot to multiply your position by X amount each time the bot allocates. In Amount mode, you can set the bot to buy a user specified amount each time the bot allocates.

Example: 5

6 Allocation Margin Schedule

This sets the percent value your position needs to drop before the bot is allowed to open a new buy order. This can be set to one value or multiple values by listing them X,X,X without any spaces in between.

Example: 6 15

The above entry will set the percent your position has to decrease before it will initiate a new buy order to 15%

Example: 6 5,10,15

The above entry will set the bot to buy after a 5% drop in value, followed by a 10% drop in value, followed by a 15% drop in value. If the coins value makes it to the last value, it will stay at that value until the bot sells. When it sells, it will reset and start back at 5% drop in value.

Example: 6 5,<10>,15

The above entry will set the bot to buy after a 10% drop in value, followed by a 15% drop in value, and so on.

Example: 6 5,10,15,<100>

This above entry will set the bot to buy after a 100% drop in value, which effectively means that the bot will stop buying new positions.

7 Allocation Multiplier Schedule/Allocation Amount Schedule

This sets the desired position multiplier or amount schedules. This can be set to one value or multiple values by listing them X,X,X without any spaces in between.

Example for Multiplier Mode: 7 2

The above entry will set your Pivot to buy 2x your position when the bot allocates(buys).

Example for Multiplier Mode: 7 1,2,3.5

The above entry will schedule the bot to buy 1x your position on the first allocation, 2x your position on the second allocation, and 3.5x your position on the third and all other following allocations.

*Example for Amount Mode: 7 100,200,300

The above entry will schedule the bot to buy 100 coins on the first buy, 200 coins on the second, and 300 coins on the third and all other following allocations.

8 Time Between Buys

This sets the minimum time required for the bot to open new buy orders (format is T00H00M for hours and minutes). This setting is optional and is meant to slow down buys in the event of a rapid drop in a coins value.

Example: 8 T10M

The above entry will limit the bot from being able to create new buy orders until 10 minutes pass from the previous buy

Example 8 T00M

The above entry will have no restriction to how often the bot is allowed to buy.

Example: 8 T01H15M

The above entry will limit the bot from being able to create new buy order until 1 hour and 15 minutes pass from the previous buys

9 Maximum Buy Price

This entry will limit the bot from buying at a higher price than you planned. This limit applies even if the current price is below the next buy price (as set by the allocation margin), and even if the allocation is zero (so it is prevented from re-establishing your position).

This setting is disabled as default.

This setting is particularly useful when the price spikes upward (say increased by 100%) which exceeds our distribution margin of say 20%, and as a result triggers the bot to sell at the top of the spike. If this setting is disabled, then after the sell, the bot will buy back the establishing position. If the price subsequently drops by 30%, and hits our allocation margin, then the bot buys at a price that's still 70% above the price we originally bought at. This is why you might want to use this setting to protect yourself from buying at too high a price.

Example: 9 .10

In a XRP/BTC market, the above example would prevent your bot from buying at a price above .10 BTC.

Example: 9 0

This will disable the limit, and the bot will be allowed to buy at any price.

10 Trail Stop Mode

This setting toggles buying trails on and off. Trailing Stops allow the bot to follow the momentum of the market to find better buy prices. If turned off, the bot will buy the moment it hits the Allocation Margin Schedule.

Example: 9

11 Trail Stop Percent

If Trail Stop Mode is toggled on, this will allow the bot to follow momentum of the market beyond the specified Allocation Margin Schedule until it reverses direction by this set percent value.

Example: 10 .2

The above entry will set the Trail Stop Mode to .2%. If the coin's value continues past the Allocation Margin Schedule, the bot will follow the value down the market until its value increase by .2% before initiating a buy order.

12 Buying Order Mode

Toggles between Limit and Market orders (locked to Limit Orders on most exchanges)

Example: 11

13 Maker Taker Mode

This toggles between Maker and Taker modes. For Allocation, Maker mode will place a new buy order at the top of Bids side of the orderbook and will need to be filled by another trader. Taker mode will buy from the the lowest ask price in the Asks side of the orderbook.

Example: 12

Distribution Behavior

14 Distribution Margin

This sets the percent value your position needs to increase before the bot is allowed to open a sell order.

Example: 13 5

The above entry will set the percent your position’s value has to increase before opening a sell order to 5%

15 Trail Stop Mode

This setting toggles selling trails on and off. Trailing Stops allow the bot to follow the momentum of the market to find a better price. If turned off, the bot will sell the moment it hits the Distribution Margin. Example: 14

16 Trail Stop Percent

If Trail Stop Mode is toggled on, this will allow the bot to follow momentum of the market beyond the specified Distribution Margin percent until it reverses direction by this set percent value.

Example: 15 .2

The above entry will set the Trail Stop Mode to .2%. If the coin's value continues past the Distribution Margin, the bot will follow the value up the market until its value decreases by .2% before initiating a buy order.

17 Selling Order Mode

Toggles between Limit and Market orders (locked to Limit Orders on most exchanges)

Example: 16

18 Maker Taker Mode

This toggles between Maker and Taker modes. For Distribution, Maker mode will place a new sell order at the top of Asks side of the orderbook and will need to be filled by another trader. Taker mode will sell to the highest bid price in the Bids side of the orderbook.

Example: 17

Maker mode will create a new lowest ask order, TAKER mode will fill the current highest bid order.

Example

For this example, we will use NEO/BTC as the currency pair and use fictitious prices to explain how the pivot strategy operates.

Starting point

When we first add a pivot on a base currency we don't hold, the allocation is zero. When the allocation is zero, the Current Mode is ESTABLISH, which means the bot will buy your Establishing Amount of 0.005 BTC.

Field Value
Allocation 0 NEO
Lowest Ask 0.0081
Current Profit 0.00%
Current Mode ESTABLISH
Position 0.0081
Allocation Margin <25.00>,30.00,40.00
Allocation Multiplier <3.00>
Establishing Amount 0.005 BTC
Maximum Buy Price DISABLED

Opening a BID limit order on NEO for 0.61728395 @ 0.00810000 NEO/BTC which is 0.005 BTC.

After Position is Established

Field Value
Allocation 0.61728395 NEO
Lowest Ask 0.0081
Current Profit 0.00%
Current Mode NEUTRAL
Position 0.0081
Allocation Margin <25.00>,30.00,40.00
Allocation Multiplier <3.00>

Price decreases to 0.0054

Field Value
Allocation 0.61728395 NEO
Lowest Ask 0.0054
Current Profit -33.33%
Current Mode ALLOCATION
Position 0.0081
Allocation Margin <25.00>,30.00,40.00
Allocation Multiplier <3.00>
Maximum Buy Price DISABLED

Opening a BID limit order on NEO for 1.85185185 @ 0.00540000 NEO/BTC which is 0.01 BTC.

Price stays at 0.0054

After buying 3 times your allocation, your unrealized loss is 11%. This puts you above your 30% allocation margin, which means the bot will not be buying more until the price drops further.

Field Value
Allocation 2.4691358 NEO
Lowest Ask 0.0054
Current Profit -11.11%
Current Mode NEUTRAL
Position 0.006075
Allocation Margin 25.00,<30.00>,40.00
Allocation Multiplier <3.00>
Maximum Buy Price DISABLED

Price decreases to 0.00378

As the price drops below your 30% allocation margin, the bot buys 3 times your allocation.

Field Value
Allocation 2.4691358 NEO
Lowest Ask 0.00378
Current Profit -37.78%
Current Mode ALLOCATION
Position 0.006075
Allocation Margin 25.00,<30.00>,40.00
Allocation Multiplier <3.00>
Maximum Buy Price DISABLED

Opening a BID limit order on NEO for 7.40740740 @ 0.00378000 NEO/BTC which is 0.028 BTC

Price stays at 0.00378

The buy order results in moving your profit up to negative 29%, which is above your allocation margin of 40%. This is why the bot is in NEUTRAL mode and will not buy any more.

Field Value
Allocation 9.8765432 NEO
Lowest Ask 0.003078
Current Profit -29.30%
Current Mode NEUTRAL
Position 0.00435375
Allocation Margin 25.00,30.00,<40.00>
Allocation Multiplier <3.00>
Maximum Buy Price DISABLED

Price decreases to 0.002001

Let's assume you now decide to set your Maximum Buy Price to 0.0021429 BTC, which means the bot will only buy if the price is below that value. As the price of 0.002001 is below 0.0021429, the bot will buy 3 times your allocation.

Field Value
Allocation 9.8765432 NEO
Lowest Ask 0.002001
Current Profit -54.04%
Current Mode ALLOCATION
Position 0.00435375
Allocation Margin 25.00,30.00,<40.00>
Allocation Multiplier <3.00>
Maximum Buy Price 0.0021429 BTC

Opening a BID limit order on NEO for 29.62962960 @ 0.00200100 NEO/BTC which is 0.05928889 BTC.

Price stays at 0.002001

After buying 3 times your position, your profit is negative 29%, which puts you back into NEUTRAL mode.

Field Value
Allocation 9.8765432 NEO
Lowest Ask 0.003078
Current Profit -29.30%
Current Mode NEUTRAL
Position 0.00435375
Allocation Margin 25.00,30.00,<40.00>
Allocation Multiplier <3.00>
Maximum Buy Price 0.0021429 BTC

Price decreases to 0.0014

The price drops again, decreasing your profit to negative 46%, which is below your allocation margin of 40%. This triggers your bot into buying 3 times your position.

Field Value
Allocation 39.5061728 NEO
Lowest Ask 0.0014
Current Profit -45.93%
Current Mode ALLOCATION
Position 0.00258919
Allocation Margin 25.00,30.00,<40.00>
Allocation Multiplier <3.00>
Maximum Buy Price 0.0021429 BTC

Opening a BID limit order on NEO for 118.51851840 @ 0.00140000 NEO/BTC which is 0.16592593 BTC.

Price stays at 0.0014

This is what your position looks like after buying.

Field Value
Allocation 158.0246912 NEO
Lowest Ask 0.0014
Current Profit -17.52%
Current Mode NEUTRAL
Position 0.0016973
Allocation Margin 25.00,30.00,<40.00>
Allocation Multiplier <3.00>
Maximum Buy Price 0.0021429 BTC

Price increases to 0.002381

In this step, the price increases to a level where you can take 40% profit. Although the price is still below where it started, you can sell at a profit because you've multiplied your position at the lower price levels.

Field Value
Allocation 158.0246912 NEO
Lowest Ask 0.002381
Current Profit 40.28%
Current Mode DISTRIBUTION
Position 0.0016973
Allocation Margin 25.00,30.00,<40.00>
Allocation Multiplier <3.00>
Maximum Buy Price 0.0021429 BTC

Opening a ASK limit order on NEO for 158.02469120 @ 0.00238100 NEO/BTC which is 0.37625679 BTC.

Price stays at 0.002381

After the bot has sold your entire position, you're now in establishing mode. However, because the price is above your Maximum Buy Price, the bot is prevented from buying until the price drops back below 0.0021429 BTC.

Field Value
Allocation 0 NEO
Lowest Ask 0.002381
Current Profit 0.00%
Current Mode ESTABLISH (BUY CHOKED)
Position 0.002381
Allocation Margin <25.00>,30.00,40.00
Allocation Multiplier <3.00>
Maximum Buy Price 0.0021429 BTC

Further Information

In-depth Video Tutorial of the Pivot Strategy

⚠️ **GitHub.com Fallback** ⚠️