News Focus
News Focus
icon url

nokodemion

07/04/25 12:29 PM

#47880 RE: karw #47863

Hi K...

Posted 2 times, srry.
icon url

nokodemion

07/04/25 12:31 PM

#47881 RE: karw #47863

Hi K...

Interesting...

I came up with this:

// Calculate cash ratio and dynamic thresholds
const cash_ratio = new Decimal(eur_balance).div(portfolio_control_btc).mul(100).toNumber();
const f_xy = 90 / cash_ratio; // f(x, y) = 90% / (EUR VALUE / portfolio_control_btc)
let buyThreshold;
let sellThreshold;

if (crossover_status === 'BULL MARKET') {
buyThreshold = 0.01; // Default 1% for GOLDEN CROSS
const price_above_sma50 = current_price.gt(sma_50);
const price_above_sma200 = current_price.gt(sma_200);
const true_count = (price_above_sma50 ? 1 : 0) + (price_above_sma200 ? 1 : 0) + 1; // +1 for BULL MARKET
if (true_count === 1) {
sellThreshold = (f_xy / 100).toFixed(4); // Level 1
} else if (true_count === 2) {
sellThreshold = ((f_xy * 2) / 100).toFixed(4); // Level 2
} else {
sellThreshold = ((f_xy * 3) / 100).toFixed(4); // Level 3
}
} else if (crossover_status === 'BEAR MARKET') {
sellThreshold = 0.01; // Default 1% for DEATH CROSS
const price_below_sma50 = current_price.lt(sma_50);
const price_below_sma200 = current_price.lt(sma_200);
const true_count = (price_below_sma50 ? 1 : 0) + (price_below_sma200 ? 1 : 0) + 1; // +1 for DEATH CROSS
if (true_count === 1) {
buyThreshold = (f_xy / 100).toFixed(4); // Level 1
} else if (true_count === 2) {
buyThreshold = ((f_xy * 2) / 100).toFixed(4); // Level 2
} else {
buyThreshold = ((f_xy * 3) / 100).toFixed(4); // Level 3
}
} else {
buyThreshold = 0.01; // Default for NEUTRAL
sellThreshold = 0.01; // Default for NEUTRAL
}

PORTFOLIO_CONTROL_EUR = 50%
CASH RATIO = 90% DRAWDOWN / (EUROVALUE / PORTFOLIO_CONTROl_EUR). 90% is the historical max for Bitcoin. Better sure than sorry.

The fun part is : a 3 level multiplication of f_xy (Cash Ratio) based on market direction. The effect is really nice, cash ratio goes up after each buy.

BULL MARKET = GOLDEN CROSS = SMA50 > SMA200 = DEFAULT BUY SAFE = 1%

Multiplication: 1-3 base on True or False.

1. BULL MARKET + 1
2. PRICE ABOVE SMA50 +1
3. PRICE ABOVE SMA200 +1

1. BEAR MARKET + 1
2. PRICE UNDER SMA50 + 1
3. PRICE UNDER SMA200 + 1

Awesome Catch ... K ...

Now...I am still wresting about the trading size. What are your thoughts about that? I have something called deviation for the SMA50 and SMA200... this is the percentage of price above or under the SMA50 and SMA200, I was thinking, For Example, Yesterday Bitcoin Price had a deviation on SMA200 of +4.75% and +0.67% on the SMA50. I could count them together? As long as they are positive. 5.42%. But be careful the current indicators are BULL MARKET-GOLDEN CROSS this means, The deviation should be used for SELL TRADING SIZE. When prices go down < SMA50 means sell trading size = 4.75% (SMA200) when prices go further down < SMA200 we will end up in BEAR MARKET territory with a default of 1% for sell trading size. (on little recoveries, we sell 1% CASH BALANCE management as addition to your CASH Ratio. The moment the SMA50 goes under SMA200 = DEATH CROSS the same mechanics apply to the buy side trading sizes. For example. Yesterday : Buy Threshold = 1% and Sell Threshold = 2.75%, Buy Trading Size = 1% and Sell Trading Size = 5.52%. Total : 10.27%

In this example (dev account) I had 102% cash...I made scenarios when cash balance drops, when this goes lower... percentages increase in a sensitive way...on the buy side of things... I hope you can understand what I try to convey... any feedback or ideas or additions are welcome.

PS: I had a hard time, to grasp increasing sell threshold and trading size and decreasing buy threshold and trading size in a BULL MARKET, GOLDEN CROSS PASSED and Price above SMA200 and above SMA50 ... It gave me a contrarian gut feeling ... Same for BEAR MARKET, DEATH CROSS PASSED and Price under SMA200 and under SMA50 decreasing sell threshold and trading size and and increasing buy threshold and trading size. If you can see the mechnics and their implications, you can never unsee them :)

Srry for my english.

Thx, Regards,

N.