Skip to main content

power result 2

// Sample data array with all columns const dataEntries = [ { Minute: 10, Type: 'Actual', Price: 123938.73, Time: '08:06 AM', Error: 5, Accuracy: 50.00, DirectionAccuracy: 70.00 }, { Minute: 10, Type: 'Predicted', Price: 123926.83, Time: '08:06 AM', Error: 11.90, Accuracy: 50.00, DirectionAccuracy: 70.00 }, // Add more entries as needed ]; // Function to convert time string to minutes function timeToMinutes(timeStr) { const [time, meridian] = timeStr.trim().split(' '); let [hh, mm] = time.split(':').map(Number); if (meridian === 'PM' && hh !== 12) hh += 12; if (meridian === 'AM' && hh === 12) hh = 0; return hh * 60 + mm; } // Enhanced calculation function function calculateEnhancedTargetDecision({ HP, BDS_score, MAE, directionalAccuracy, actualPrice, error, volatilityPercent, maxDrawdownPercent, varPercent, sharpeRatio, timeString }) { const minutes = timeToMinutes(timeString); const timeFactor = minutes > 1200 ? 0.5 : 1; const accuracyFactor = directionalAccuracy / 100; const riskFactor = (volatilityPercent / 100 + maxDrawdownPercent / 100 + varPercent / 100) * accuracyFactor; const sharpeAdj = 1 + sharpeRatio; const signPred = HP > actualPrice ? 1 : -1; const complexVolatility = riskFactor * timeFactor * sharpeAdj; const baseTarget = HP + (signPred * complexVolatility * HP) - (error * (1 - accuracyFactor)); const baseVolatility = 0.01; const volatilityCode2 = baseVolatility * accuracyFactor; const targetPriceCode2 = HP + (signPred * volatilityCode2 * timeFactor * HP) - (error * 0.75); const targetPrice = (baseTarget + targetPriceCode2) / 2; let decision = "Neutral ⚪"; if (BDS_score > 0.1) { decision = "High (↑)"; } else if (BDS_score < -0.1) { decision = "Low (↓)"; } else { if (sharpeRatio > 0.02 && (volatilityPercent / 100) < 0.01) { decision = "Neutral ⚪ (Stable)"; } const thresholdVolatility = 0.02 * accuracyFactor; const thresholdPrice = actualPrice * 0.99; if (signPred > 0 && HP > thresholdPrice && volatilityCode2 < thresholdVolatility) { decision = "High (↑)"; } else if (signPred < 0 && HP > thresholdPrice) { decision = "Low (↓)"; } } return { targetPrice, decision }; } // Example volatility and risk params (can be dynamic or from data) const volatilityPercent = 1.0; const maxDrawdownPercent = 0.5; const varPercent = 0.3; const sharpeRatio = 0.02; const MAE = 0.002; // example normalized MAE const BDS_score = 0.36; // example score // Finding actual and predicted entries for given minute const actualData = dataEntries.find(e => e.Type === 'Actual' && e.Minute === 10); const predictedData = dataEntries.find(e => e.Type === 'Predicted' && e.Minute === 10); if (actualData && predictedData) { const inputData = { HP: predictedData.Price, BDS_score: BDS_score, MAE: MAE, directionalAccuracy: predictedData.DirectionAccuracy, actualPrice: actualData.Price, error: predictedData.Error, volatilityPercent: volatilityPercent, maxDrawdownPercent: maxDrawdownPercent, varPercent: varPercent, sharpeRatio: sharpeRatio, timeString: predictedData.Time }; const result = calculateEnhancedTargetDecision(inputData); console.log(`Minute: ${predictedData.Minute}`); console.log(`Target Price: ${result.targetPrice.toFixed(4)}`); console.log(`Decision: ${result.decision}`); } else { console.log('Required Actual or Predicted data not found for the 10th minute.'); }

Comments

Popular posts from this blog

K

# app.py from flask import Flask, jsonify import numpy as np import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import LSTM, Dense import requests app = Flask(__name__) # Binance se last 60 minute price data fetch karna def fetch_binance_data(): url = "https://api.binance.com/api/v3/klines?symbol=BTCUSDT&interval=1m&limit=60" data = requests.get(url).json() closes = [float(item[4]) for item in data] return closes # LSTM input prepare karna sliding window ke form me def prepare_data(series, n_steps): X, y = [], [] for i in range(len(series) - n_steps): X.append(series[i:i+n_steps]) y.append(series[i+n_steps]) return np.array(X), np.array(y) # LSTM model train karna def train_model(series): n_steps = 10 X, y = prepare_data(series, n_steps) X = X.reshape((X.shape[0], X.shape[1], 1)) model = Sequential([ LSTM(50, activation='relu', input_shape=...

90% logic

Bahut solid point uthaya tune 🔥 — ye hi **core secret** hai market ka: *order book + synthetic interval + liquidity behavior* ka connection. Chalo ye ekdum **clear aur depth se** samajhte hain — “kyun candle ke andar jo price bhara hota hai wo sabse satik signal deta hai” aur “synthetic 10-min next direction ko kaise predict karta hai.” --- ## 🔹 1. Candle ke andar kya hota hai — “Order book ka sach” Ek 1-min ya 10-min candle sirf ek visual summary hoti hai: * **Open** = pehle trade ka price * **Close** = last trade ka price * **High/Low** = us interval me sabse bada aur chhota executed trade Lekin asal me, is candle ke **andar har second**, **order book** me kuch chije chal rahi hoti hain: * **Bid wall** (buyers ka volume cluster) * **Ask wall** (sellers ka volume cluster) * **Spoof orders** (fake liquidity — direction manipulate karne ke liye) * **Absorption** (jab ek side ke large orders absorb ho rahe hote hain) Ye sab data Binance ke order book (Level 2 feed) me hota hai —...

13A 10 m future pine script good working

//@version=5 indicator("10m Predictor Complete", overlay=true) // GET 10m DATA c10 = request.security(syminfo.tickerid, "10", close) h10 = request.security(syminfo.tickerid, "10", high) l10 = request.security(syminfo.tickerid, "10", low) atr10 = request.security(syminfo.tickerid, "10", ta.atr(14)) rsi10 = request.security(syminfo.tickerid, "10", ta.rsi(close, 14)) [macdLine, signalLine, histLine] = request.security(syminfo.tickerid, "10", ta.macd(close, 12, 26, 9)) stochK = request.security(syminfo.tickerid, "10", ta.stoch(close, high, low, 14)) // PREDICTIONS slope = ta.change(c10, 3) / 3 pred_close = c10 + slope pred_high = pred_close + atr10 pred_low = pred_close - atr10 // WEIGHTED SCORE rsiScore = rsi10 > 70 ? 2 : rsi10 > 50 ? 1 : rsi10 signalLine ? 2 : -2 stochScore = stochK > 80 ? 2 : stochK > 50 ? 1 : stochK 40 isBearish = weightedScore 50 ? "HIGH" : "LOW" macdS...