Type/to search

Time-stepped Pyramiding Simple Quant Strategy

Common strategy
Created: 2023-12-27 17:39:40
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

This strategy is a simple quant trading strategy that utilizes time-stepped pyramiding. The main idea is to long open positions every day at fixed times, and set different take profit and stop loss levels for each position to realize batched profit taking and stopping loss.

Principles

The strategy is based on three key logics:

  1. Time-stepped pyramiding

    Use the sessionTime parameter to set a daily trading time window, pyramid long positions step by step at market open during this window. The position size is the average allocation of the maximum capital.

  2. Individualized profit taking and stopping loss

    Set corresponding take profit level takeProfit and stop loss level stopLoss for every opened position, so that each position has its own profit taking and stopping loss logic to realize batch executions.

  3. Close all positions when time window ends

    Choose whether to close all positions opened during the time window at the end of the window.

Advantages

The strategy has the following advantages:

  1. Risk diversification. Allocate capital evenly to different positions to effectively control single position loss.

  2. Batch profit taking and stopping loss. Different positions have independent logics to avoid mass stopping loss.

  3. Flexible configurations. Customizable parameters like maximum pyramiding times, daily time window, profit taking/stopping loss ratios etc.

  4. Simple and clear logic. Easy to understand.

Risks

There are also some risks:

  1. Risk of full capital stuck if all positions trigger stop loss before take profit. Can be avoided by reasonably configuring the stop loss ratio.

  2. No limit on total open position capital per day. Too many positions may exceed capital bearability if encountering unusual market situations. Consider adding maximal total position capital per day.

  3. Improper time window configuration may miss trading chances. Suggest to refer to the active trading time window of the trading assets.

Enhancement

The strategy can be enhanced from the following aspects:

  1. Add open position conditions based on technical indicators to avoid reckless pyramiding.

  2. Add daily total open position capital limit to prevent exceeding capital bearability.

  3. Set different take profit/stop loss ratios for different positions to realize differentiated profit taking and stopping loss.

  4. Add logics to link position amount with capital pool balance.

Conclusion

In conclusion, this is a very simple quant trading strategy template utilizing the time-stepped pyramiding methodology. The logic is simple and clear while there are also some risks and rooms for enhancement. Developers can optimize it properly to make it a relatively stable and reliable quant strategy.

Source
Pine
/*backtest
start: 2022-12-20 00:00:00
end: 2023-12-26 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © A3Sh

//@version=5
Strategy parameters
Strategy parameters
Backtest Window
Start Time
End Time
Risk
Max Amount of DCA Entries
Take Profit %
Activate Stop Loss
Stop Loss %
DCA Settings
DCA Order Timeframe
Exit DCA Entry at end of Timeframe
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)