Which time frame performing the best result after comparing the sharpe vs sortino ratio?
@DailyGameMoments
Test EMA Strategy 1:
Test SMA Strategy 2:
DGM Class Start Date and Time now is 2024-05-19 14:18:50.497258 START: 30m SOLUSDT OHLC-data from 2020-11-11 00:00:00 until 2024-05-19 DGM Class Start Date and Time now is 2024-05-19 14:22:57.747713 START: 30m SOLUSDT OHLC-data from 2020-11-11 00:00:00 until 2024-05-19 Open Time Open High Low Close 0 2020-11-10 16:00:00 2.1840 2.2528 2.1839 2.2484 1 2020-11-10 16:30:00 2.2484 2.2485 2.2304 2.2409 2 2020-11-10 17:00:00 2.2395 2.2995 2.2255 2.2790 3 2020-11-10 17:30:00 2.2790 2.2869 2.2438 2.2554 4 2020-11-10 18:00:00 2.2518 2.2554 2.2111 2.2111 .. … … … … … 659 2024-05-19 04:00:00 174.3200 174.4100 173.3100 173.5900 660 2024-05-19 04:30:00 173.5900 174.5000 173.3500 174.5000 661 2024-05-19 05:00:00 174.5000 175.5000 174.3600 174.8500 662 2024-05-19 05:30:00 174.8600 174.9400 173.8600 174.0700 663 2024-05-19 06:00:00 174.0700 174.3400 173.9200 174.1400
[61664 rows x 5 columns] END: v3/klines 30m SOLUSDT DB Processed.
START DB Processing: >>> Data from GetDataRequested table. Mean Price: 62.08541965814739 Standard Deviation: 58.721715230338866 v3/klines Upper Percentage Threshold: 179.52885011882512 v3/klines Lower Percentage Threshold: -55.358010802530345 Open Time High Low Close 0 2020-11-10 16:00:00 2.2528 2.1839 2.2484 1 2020-11-10 16:30:00 2.2485 2.2304 2.2409 2 2020-11-10 17:00:00 2.2995 2.2255 2.2790 3 2020-11-10 17:30:00 2.2869 2.2438 2.2554 4 2020-11-10 18:00:00 2.2554 2.2111 2.2111 GetDataProcess Trade Message = None GetDataProcess Trade Price (Qty: 0.05) = 0 GetDataProcess Data processed and saved to QuantTrending table. END: v3/klines 30m SOLUSDT GetDataProcess Completed.
START DB Processing: >>> Data from QuantTrending table. BackTestSharpRatioMDD: >>> Processed the file QuantTrending.csv. Warning: NaN values detected in ‘Previous_Close’. Attempting to recalculate ‘Daily_PnL’. Warning: NaN or Infinite values detected in ‘Daily_PnL’ after recomputation. Cleaning required. Info: Previous_Close Close Daily_PnL Cumm_PnL count 61663.000000 61663.000000 61663.000000 61663.000000 mean 62.083602 62.086390 0.001621 63.921336 std 58.720934 58.722173 0.007704 26.552746 min 1.101800 1.101800 -0.178662 0.000000 25% 20.810000 20.810000 0.000000 49.072912 50% 33.951000 33.960000 0.000000 72.006780 75% 97.620000 97.620000 0.000000 85.162826 max 258.440000 258.440000 0.200871 99.982746
*> DGM Sharp Ratio = 4.02 **> DGM Maximum Drawdown: 17.87% ***> DGM Peak Profit: 9998.27% ****> DGM Drawdown from Peak: 0.00% *****>> Created SOLUSDT-QuantSharpRatioMDD-30m.csv for Equity Curve.
Test LWMA Strategy 3:
In summary:
fastEMA:30 slowEMA:50 SOLUSDT SL=2.5, TP=1.8, return=12.76% in 1h. fastEMA:30 slowEMA:50 SOLUSDT SL=1.6, TP=2.1, return=4.73% in 30m. fastEMA:30 slowEMA:50 SOLUSDT SL=1.6, TP=2.1, return=4.30% in 30m. fastWMA:10 slowWMA:34 SOLUSDT SL=1.6, TP=2.1, return=13.84% in 30m.
Beyond the Sharpe Ratio: Unveiling Effective Trading Strategy Assessment
In 1993, Buffett spoke to Columbia University’s Business School graduates. Asked about his method for evaluating risk, he said, “Risk comes from not knowing what you’re doing.” This quote reflects Buffett’s investment philosophy, highlighting the crucial role of knowledge and understanding in reducing risk.
“The biggest risk is not taking any risk… In a world that changing really quickly, the only strategy that is guaranteed to fail is not taking risks.” Mark Zuckerberg
Despite of the crypto dump recently on all the alt coins after SEC announcement to sue Binance and Coinbase. Guess what? My Ai Trading Strategies are making shit ton of USDT from the crazy markets. Well there is a secret and cannot tell you unless…Anyway, I have given you the formula to copy and it is up to you to trade manually with stress and sleepless nights or ride on the trend of Ai trading today ⬇️⬇️⬇️
AI Sleeping Income With DGM System
The SECRET is to marry between Ai trading strategies and an income generated exchange platform
bt = Backtest(dfstream, MyStrat, cash=100000, margin=0.01, commission=0.00055) stats, heatmap = bt.optimize(slcoef=[i/10 for i in range(10, 26)], TPSLRatio=[i/10 for i in range(10, 26)], maximize=’Return [%]’, max_tries=300, random_state=0, return_heatmap=True) print(stats)
In 1993, Buffett spoke to Columbia University’s Business School graduates. Asked about his method for evaluating risk, he said, “Risk comes from not knowing what you’re doing.” This quote reflects Buffett’s investment philosophy, highlighting the crucial role of knowledge and understanding in reducing risk.
“The biggest risk is not taking any risk… In a world that changing really quickly, the only strategy that is guaranteed to fail is not taking risks.” Mark Zuckerberg
Despite of the crypto dump recently on all the alt coins after SEC announcement to sue Binance and Coinbase. Guess what? My Ai Trading Strategies are making shit ton of USDT from the crazy markets. Well there is a secret and cannot tell you unless…Anyway, I have given you the formula to copy and it is up to you to trade manually with stress and sleepless nights or ride on the trend of Ai trading today ⬇️⬇️⬇️
AI Sleeping Income With DGM System
The SECRET is to marry between Ai trading strategies and an income generated exchange platform
2024-05-14 09:01:09,378 – INFO – DGM Start Date and Time now is 2024-05-14 09:01:09.378769 2024-05-14 09:01:09,880 – INFO – All data downloaded successfully in GetDataRequest. 2024-05-14 09:01:09,993 – INFO – Exported FROM 2020-11-11 TO 2024-05-14 Data saved to DB. 2024-05-14 09:01:10,401 – INFO – File QuantTrending.csv has been successfully deleted. 2024-05-14 09:01:10,401 – INFO – >>*>> ETHUSDT-QuantSharpRatioMDD-1d.csv for Equity Curve. 2024-05-14 09:01:10,401 – INFO – BackTest Trade Message = None 2024-05-14 09:01:10,401 – INFO – BackTest Trade Price (Qty: 0.05) = 0 DGM Class Start Date and Time now is 2024-05-14 09:01:09.380486 START: 1d ETHUSDT OHLC-data from 2020-11-11 00:00:00 until 2024-05-14 Open Time Open High Low Close 0 2020-11-11 450.34 476.25 449.28 463.09 1 2020-11-12 463.09 470.00 451.20 462.39 2 2020-11-13 462.48 478.01 457.12 476.43 3 2020-11-14 476.42 477.47 452.00 460.89 4 2020-11-15 460.90 462.89 440.19 448.08 .. … … … … … 276 2024-05-10 3036.24 3053.89 2878.03 2909.99 277 2024-05-11 2909.98 2945.67 2886.46 2912.45 278 2024-05-12 2912.45 2955.20 2901.17 2929.29 279 2024-05-13 2929.30 2996.40 2864.76 2950.99 280 2024-05-14 2950.99 2958.76 2937.51 2944.75
[1281 rows x 5 columns] END: v3/klines 1d ETHUSDT DB Processed.
START DB Processing: >>> Data from GetDataRequested table. Mean Price: 2208.228266978923 Standard Deviation: 914.490172178236 v3/klines Upper Percentage Threshold: 4037.208611335395 v3/klines Lower Percentage Threshold: 379.2479226224509 Open Time High Low Close 0 2020-11-11 476.25 449.28 463.09 1 2020-11-12 470.00 451.20 462.39 2 2020-11-13 478.01 457.12 476.43 3 2020-11-14 477.47 452.00 460.89 4 2020-11-15 462.89 440.19 448.08 GetDataProcess Trade Message = None GetDataProcess Trade Price (Qty: 0.05) = 0 GetDataProcess Data processed and saved to QuantTrending table. END: v3/klines 1d ETHUSDT GetDataProcess Completed.
START DB Processing: >>> Data from QuantTrending table. BackTestSharpRatioMDD: >>> Processed the file QuantTrending.csv. Warning: NaN values detected in ‘Previous_Close’. Attempting to recalculate ‘Daily_PnL’. Warning: NaN or Infinite values detected in ‘Daily_PnL’ after recomputation. Cleaning required. Info: Previous_Close Close Daily_PnL Cumm_PnL count 1280.000000 1280.000000 1280.000000 1280.000000 mean 2207.652859 2209.591656 0.014513 11.073642 std 914.972973 913.902063 0.038246 5.210313 min 448.080000 448.080000 -0.263329 0.000000 25% 1598.405000 1599.225000 -0.000000 7.088900 50% 1899.325000 1900.090000 -0.000000 12.360589 75% 2910.605000 2914.057500 0.031202 15.726248 max 4807.980000 4807.980000 0.277372 18.590075
*> DGM Sharp Ratio = 7.25 **> DGM Maximum Drawdown: 28.47% ***> DGM Peak Profit: 1859.01% ****> DGM Drawdown from Peak: 1.40% *****>> Created ETHUSDT-QuantSharpRatioMDD-1d.csv for Equity Curve.
In 1993, Buffett spoke to Columbia University’s Business School graduates. Asked about his method for evaluating risk, he said, “Risk comes from not knowing what you’re doing.” This quote reflects Buffett’s investment philosophy, highlighting the crucial role of knowledge and understanding in reducing risk.
“The biggest risk is not taking any risk… In a world that changing really quickly, the only strategy that is guaranteed to fail is not taking risks.” Mark Zuckerberg
Despite of the crypto dump recently on all the alt coins after SEC announcement to sue Binance and Coinbase. Guess what? My Ai Trading Strategies are making shit ton of USDT from the crazy markets. Well there is a secret and cannot tell you unless…Anyway, I have given you the formula to copy and it is up to you to trade manually with stress and sleepless nights or ride on the trend of Ai trading today ⬇️⬇️⬇️
AI Sleeping Income With DGM System
The SECRET is to marry between Ai trading strategies and an income generated exchange platform
Analyzing any USA stocks with python codes. We can understand the sentiment much better,,, The Markov analysis process involves defining the likelihood of a future action, given the current state of a variable. Once the probabilities of future actions at each state are determined, a decision tree can be drawn, and the likelihood of a result can be calculated.
To predict the sequence probability and frequency in the past data set. In game theory, a Markov strategy is one that depends only on state variables that summarize the history of the game in one way or another. For instance, a state variable can be the current play in a repeated game, or it can be any interpretation of a recent sequence of play.
In 1993, Buffett spoke to Columbia University’s Business School graduates. Asked about his method for evaluating risk, he said, “Risk comes from not knowing what you’re doing.” This quote reflects Buffett’s investment philosophy, highlighting the crucial role of knowledge and understanding in reducing risk.
“The biggest risk is not taking any risk… In a world that changing really quickly, the only strategy that is guaranteed to fail is not taking risks.” Mark Zuckerberg ⬇️⬇️⬇️
Analyzing any USA stocks with python codes. We can understand the sentiment much better,,, The Markov analysis process involves defining the likelihood of a future action, given the current state of a variable. Once the probabilities of future actions at each state are determined, a decision tree can be drawn, and the likelihood of a result can be calculated.
To predict the sequence probability and frequency in the past data set. In game theory, a Markov strategy is one that depends only on state variables that summarize the history of the game in one way or another. For instance, a state variable can be the current play in a repeated game, or it can be any interpretation of a recent sequence of play.
A Regime Switching Model can help identify and switch between different market regimes, such as mean reversion (when prices tend to revert to a mean) and momentum trending (when prices follow a trend). One common approach to model such regimes is using a Markov Regime Switching Model (MRS), where the market can switch between different states (regimes) based on probabilities.
Here’s a guide on how you could implement this:
1. Define the Regimes:
Mean Reversion: In this regime, prices fluctuate around a long-term mean. The idea is to buy when prices are below the mean and sell when they are above the mean.
Momentum Trending: In this regime, prices tend to follow a trend. The strategy here is to go long during an uptrend and short during a downtrend.
2. Data Preparation:
Collect historical price data (e.g., closing prices).
Compute indicators that capture mean reversion and momentum behavior. Common indicators include:
Mean Reversion: Moving average (MA), Bollinger Bands, Z-Score.
Momentum: Moving Average Convergence Divergence (MACD), Relative Strength Index (RSI), trend-based indicators.
3. Markov Regime Switching Model:
The Markov model assumes that the market can be in one of two or more regimes, with a certain probability of switching between them.
The key parameters are the transition probabilities between regimes and the characteristics (e.g., mean, variance) of returns in each regime.
Steps to Implement:
Model the Log Returns: Use log returns of the asset prices to model changes. These will serve as the inputs to the regime switching model.
Define Two Regimes:
Regime 1: Mean-reversion behavior.
Regime 2: Momentum/trending behavior.
Fit the Model: Use a package like statsmodels in Python to fit the Markov Regime Switching Model. Here’s an example using MarkovAutoregression:
import numpy as np import pandas as pd from statsmodels.tsa.regime_switching.markov_regression import MarkovRegression
Example of fitting Markov Regime Switching model to stock returns
This code fits a two-regime Markov switching model to the log returns. The results object contains the parameters and probabilities of being in each regime over time.
4. Interpreting the Results:
Regime 1: This could represent the mean-reversion regime, where prices tend to revert to their mean.
Regime 2: This could represent the momentum-trending regime, where prices exhibit directional trends.
The model estimates the probability of being in each regime at each time step, allowing you to determine whether the market is in a mean-reversion or momentum-trending state.
5. Strategy Implementation:
When in Mean Reversion (Regime 1):
If the price is below the mean (using indicators like moving averages), go long.
If the price is above the mean, go short.
When in Momentum (Regime 2):
Buy when the trend is upward and sell when the trend is downward.
6. Backtesting and Optimization:
Backtest the strategy by switching between the two regimes based on the predicted probabilities.
Fine-tune your indicators, such as the length of the moving averages or momentum indicators, to optimize performance.
Libraries to Consider:
statsmodels for regime-switching models.
hmmlearn for Hidden Markov Models, which is an alternative approach.
By switching between the two regimes based on the probabilities from the regime-switching model, you can potentially capture the market’s mean-reverting or trending behavior at the right time.
“The biggest risk is not taking any risk… In a world that changing really quickly, the only strategy that is guaranteed to fail is not taking risks.” Mark Zuckerberg
In 1993, Buffett spoke to Columbia University’s Business School graduates. Asked about his method for evaluating risk, he said, “Risk comes from not knowing what you’re doing.” This quote reflects Buffett’s investment philosophy, highlighting the crucial role of knowledge and understanding in reducing risk.
Tips:
Despite of the crypto dump recently on all the alt coins after SEC announcement to sue Binance and Coinbase. Guess what? My Ai Trading Strategies are making shit ton of USDT from the crazy markets. Well there is a secret and cannot tell you unless…Anyway, I have given you the formula to copy and it is up to you to trade manually with stress and sleepless nights or ride on the trend of Ai trading today ⬇️⬇️⬇️
AI Sleeping Income With DGM System
The SECRET is to marry between Ai trading strategies and an income generated exchange platform
DGM Sharp Ratio = 3.5015 and Winning rate = 73.33596%
In 1993, Buffett spoke to Columbia University’s Business School graduates. Asked about his method for evaluating risk, he said, “Risk comes from not knowing what you’re doing.” This quote reflects Buffett’s investment philosophy, highlighting the crucial role of knowledge and understanding in reducing risk.
“The biggest risk is not taking any risk… In a world that changing really quickly, the only strategy that is guaranteed to fail is not taking risks.” Mark Zuckerberg
Despite of the crypto dump recently on all the alt coins after SEC announcement to sue Binance and Coinbase. Guess what? My Ai Trading Strategies are making shit ton of USDT from the crazy markets. Well there is a secret and cannot tell you unless…Anyway, I have given you the formula to copy and it is up to you to trade manually with stress and sleepless nights or ride on the trend of Ai trading today ⬇️⬇️⬇️
AI Sleeping Income With DGM System
The SECRET is to marry between Ai trading strategies and an income generated exchange platform