Strategy Submission#

This document outlines the technical deliverables, submission rules, suggested approaches, position sizing strategies, PnL formulas, and guidelines for calculating the maximum dip in running trades for the OHLCV data analysis of BTC/USDT across various timeframes.

Technical Deliverables#

Participants are provided with OHLCV data for BTC/USDT in multiple timeframes: 3 minutes, 5 minutes, 15 minutes, 30 minutes, 1 hour, 2 hours, 4 hours, 6 hours, 12 hours, and 1 day. Aggregation or deduction to other desired timeframes from the provided data is permitted.

This can be found under /work/data of your jupyter workspace.

Submission Rules#

Logs must be submitted in the format: (1, 0, -1, 2, -2), under the following conditions:

  • If you are willing to open a long trade and cut it :- then your entry is 1 and exit is -1 (just square off)

  • If you are willing to open a short trade and cut it :- then your entry is -1 and exit is 1 (just square off)

  • If you are willing to open a long trade and then square it off and open a new short trade at the same timestamp’s closing :-then your entry is 1 and exit is -2. (square off and new initiate)

  • If you are willing to open a short trade and then square it off and open a new long trade at the same timestamp’s closing :- then your entry is -1 and exit is 2. (square off and new initiate)

  • When there is no signal - mark the timestamps with 0.

  • In between entry(1 or -1) and exit (1 or -1) of a trade , mark the timestamps with 0 .

You can refer sample csv in examples section

Make sure ,we execute orders on the closing of timestamps , irrespective of long/short signals.

Suggested Approaches#

  • Time series models (ARIMA, STL, LSTM networks, etc.).

  • Machine learning models (regression models, decision trees, random forests, SVMs, etc.).

  • Deep learning models (RNNs, CNNs, etc.).

  • Reinforcement learning (Q-learning, deep reinforcement learning, etc.).

  • Technical analysis using indicators.

  • Miscellaneous (bagging and boosting, Monte Carlo methods, Markov chains, etc.).

Trailing Stop Loss#

The TSL (Trailing Stop Loss) engine operates as follows: - When a trade is opened, either long (1) or short (-1), a TSL value is set. - The TSL engine checks if the next high or low of the price reaches the TSL value:

  • If the TSL value lies within the range of the high and low, the trade will exit.

  • If the TSL value does not lie within the high and low range, the current TSL value is updated to the next TSL value provided by the user.

  • If the TSL value is not reached and a new trade signal (either long or short) is generated, the previous trade will close, and the new trade will execute at the same timestamp.

  • Example:
    • You open a long position with a TSL value.

    • The TSL value does not get hit, and a new short signal is generated.

    • The long position closes, and a new short position opens at the same timestamp.

Utilizing Multiple Time Frames in Trading Strategy Development#

This document provides guidance on using multiple time frames in the development of trading strategies, enhancing decision-making through technical analysis. It explains the methodology of combining a smaller and a larger time frame to create robust trading strategies.

  1. Decision-Making Process:

    • Strategic decisions should be primarily influenced by the larger time frame, which offers a broader view of market trends.

    • While the smaller time frame provides more frequent updates, decisions should account for the state of the ongoing larger time frame candle, which may still be in progress.

  2. Practical Example:

    • At a specific point, such as 12:15 PM, a trading period marked by the smaller time frame (e.g., from 12:00 PM to 12:15 PM) concludes, and the data becomes available. However, the corresponding period for the larger time frame (e.g., from 12:00 PM to 4:00 PM) is still open.

    • Decision Criteria: Strategic decisions should either wait for the completion of the current larger time frame period or rely on the data from the last completed period of the larger time frame (e.g., from 8:00 AM to 12:00 PM) for making immediate decisions. This ensures decisions are made based on complete and reliable data.

  3. Strategy Implementation Challenges:

    • Live Trading vs. Backtesting: Live trading involves making decisions with ongoing data, which can be incomplete for the larger time frame. Backtesting, however, uses historical data where all periods are completed and known, avoiding issues of incomplete information.

    • Data Synchronization: It is essential to synchronize decisions by considering the closure of periods in the larger time frame when combining different time frames.

  4. Best Practices:

    • Wait for Closure: Avoid making decisions based on incomplete larger time frame periods to ensure data integrity and prevent premature actions.

    • Use Historical Data from the Larger Time Frame: Decisions during the smaller time frame periods should be based on the most recent completed period of the larger time frame.

    • Ensure Data Consistency: The testing environment for strategies should mirror the live environment by considering the closure times of periods across different time frames.

Position Sizing Approaches#

Participants should initially focus on strategy logic rather than position sizing. However, two methods are suggested:

  • Static: Use $1000 in every trade.

  • Compounding: Adjust profits/losses in subsequent trades, starting with $1000.

Example#

  • You open your first trade with $1,000.

  • Let’s say you made a profit of $200.

  • You now have $1,200 in your trading account.

  • You decide to use the entire $1,200 for your next trade and Let’s say you made a loss of $300.

  • Now, you have $900 left in your account therefore the next call will open with 900$.

This method ensures that the size of each trade is adjusted based on the profits or losses from the previous trade, allowing your trading capital to grow or shrink arithmetically with each trade’s outcome.

Same strategy will give you different analytics when run through static and compounding models. You can go through both and see the results by yourself.

Profit and Loss (PNL) Formula#

The Profit and Loss (PNL) formula, when you have the entry and exit prices for a trade and you open each trade with $1000, is given by:

\[PNL= ({Exit Price} - {Entry Price}) * ({Investment Amount}/{Entry Price})\]

Example of a LONG TRADE in BTC USDT#

Given:

  • Entry price: $35,400

  • Exit price: $35,800

  • Investment: $1000 (using a static approach)

The formula calculates PNL as:

\[PNL = (35800 - 35400) * ({1000}/{35400})\]
\[= 400 * 0.028\]
\[= 11.2$\]

This means that, based on the given entry and exit prices, you would make a profit of $11.2 from an investment of $1000 in this BTC/USDT trade.

Example of a SHORT TRADE in BTC USDT#

Given:

  • Entry price: $36,000

  • Exit price: $35,750

  • Investment: $1000 (using a static approach)

The formula calculates PNL as:

\[PNL = (36000 - 35750) * ({1000}/{36000})\]
\[= 250 * 0.027 = 6.75 $\]

This demonstrates how the formula is applied in both LONG and SHORT trades with the specific details provided.

This means that, based on the given entry and exit prices, you would make a profit of $6.75 from the investment of $1000 in this BTC/USDT trade.

For long trades, a profit occurs when the asset’s price increases, and for short trades, a profit occurs when the price decreases. The formulas are structured to account for these directional differences in trading strategies.

Sum up the PNL values for all trades in the log to get the cumulative P&L. This standardized approach will help you guys accurately assess the profitability of your strategy. If you have any questions or need clarification, feel free to reach out to us .

Max Dip In Running Trade (Maximum Adverse Excursion)#

To calculate the maximum dip percentage in your trade, you can use the following formula:

Maximum Dip Percentage#

\[{Maximum Dip Percentage} = (({Entry Price} - {Lowest Price})/{{Entry Price}} ) * 100\]

Example Calculation#

Consider a hypothetical trade with the following details:

  • Entry Price: $42,000

  • Lowest Price: $41,000 (this price is the lowest of low ticks between entry and exit of a running trade)

Plugging these values into the formula gives:

\[{Maximum Dip Percentage} = ( {(42000−41000})/{42000} ) * 100\]
\[{Maximum Dip Percentage} ≈ 2.38%\]

Thus, the maximum dip in this trade was approximately 2.38%. This is calculated by taking the difference between the entry price and the lowest price during the trade, dividing it by the entry price, and then expressing the result as a percentage.

This phenomenon works the same for both long and short trades.

You lose less on losing trades and gain relatively higher on winning trades with a slight good win rate . That’s profitable trading in a nutshell.