تم الحفظ.

'; } $key = esc_attr(get_option('sa_finnhub_api_key','')); ?>

Stock Analyzer Settings

Finnhub API Key

سجّل في finnhub.io للحصول على مفتاح مجاني.

admin_url('admin-ajax.php') ]); }); // ------------------ Shortcode ------------------ add_shortcode('stock_analyzer', function($atts){ ob_start(); ?>
null,'sma50'=>null,'rsi14'=>null]; if(isset($candles['s']) && $candles['s'] === 'ok'){ $closes = $candles['c']; $indicators['sma20'] = sa_array_sma($closes,20); $indicators['sma50'] = sa_array_sma($closes,50); $indicators['rsi14'] = sa_array_rsi($closes,14); } // 4) news (last 7 days) $fromn = date('Y-m-d', strtotime('-7 days')); $ton = date('Y-m-d'); $news = sa_finnhub_get("https://finnhub.io/api/v1/company-news?symbol={$symbol}&from={$fromn}&to={$ton}&token={$key}"); wp_send_json_success([ 'profile'=>$profile, 'quote'=>$quote, 'indicators'=>$indicators, 'news'=>$news ]); } // Predict endpoint (simple heuristic) add_action('wp_ajax_nopriv_sa_predict', 'sa_predict'); add_action('wp_ajax_sa_predict', 'sa_predict'); function sa_predict(){ $symbol = sanitize_text_field($_GET['symbol'] ?? ''); $key = get_option('sa_finnhub_api_key',''); if(!$symbol || !$key) wp_send_json_error('missing',400); // reuse get_data (call internal) $_GET['resolution']='D'; ob_start(); sa_get_data(); $resp = ob_get_clean(); $obj = json_decode($resp, true); if(!$obj || !$obj['success']) wp_send_json_error('failed to fetch data',500); $quote = $obj['data']['quote']; $ind = $obj['data']['indicators']; $score = 0; // heuristics: if($ind['sma50'] && $quote['c'] > $ind['sma50']) $score += 1; if($ind['sma20'] && $quote['c'] > $ind['sma20']) $score += 1; if($ind['rsi'] = $ind['rsi14']) { if($ind['rsi'] < 30) $score += 1; if($ind['rsi'] > 70) $score -= 1; } // predicted relative change = score * 2% (example) $pred_change = $score * 0.02; $pred_price = $quote['c'] * (1 + $pred_change); wp_send_json_success([ 'score'=>$score, 'pred_change_pct'=>round($pred_change*100,2), 'pred_price'=>round($pred_price,2) ]); } // ------------------ helper functions ------------------ function sa_finnhub_get($url){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 10); $out = curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if($code === 200){ $json = json_decode($out, true); return $json; } return null; } function sa_array_sma($arr, $period){ $n = count($arr); if($n < $period) return null; $sum = 0; for($i=$n-$period;$i<$n;$i++) $sum += $arr[$i]; return $sum / $period; } function sa_array_rsi($arr, $period=14){ $n = count($arr); if($n <= $period) return null; $gains=0; $losses=0; for($i=$n-$period+1;$i<$n;$i++){ $diff = $arr[$i] - $arr[$i-1]; if($diff>0) $gains += $diff; else $losses -= $diff; } $avgGain = $gains/$period; $avgLoss = $losses/$period; if($avgLoss == 0) return 100; $rs = $avgGain / $avgLoss; return 100 - (100 / (1 + $rs)); }

اكتشف المزيد

تعرّف على تحليل الأسهم ورؤيتنا

Person checking stock market graphs on laptop and smartphone, focusing on financial data.

من نحن وكيف نقدم قيمة للمستثمرين

تحليل الأسهم هو منصة مبتكرة تهدف إلى توفير معلومات دقيقة حول الأسواق المالية الأمريكية. نحن نقدم بيانات شاملة حول الأسهم، بما في ذلك أسعار التداول الحالية وخدمات الإبلاغ عن أخبار الشركات. تميزنا في الدقة وتحديث المعلومات باستمرار هو ما يجعل مستثمرينا يختاروننا كوجهتهم الأولى.

Person checking stock market graphs on laptop and smartphone, focusing on financial data.

رحلتنا في عالم التحليل المالي

بدأت قصة تحليل الأسهم من الحاجة إلى دقة المعلومات في الأسواق المالية. تم تأسيس منصتنا لتكون الجسر بين المستثمرين والبيانات التي يحتاجونها. بمرور الوقت، تطورنا لنصبح أحد المصادر الرائدة لتوفير معلومات دقيقة وسهلة الاستخدام، مما يعزز قدرة المستخدمين على اتخاذ قرارات استثمارية مستنيرة.

Person checking stock market graphs on laptop and smartphone, focusing on financial data.

استخدامي لتحليل الأسهم ساعدني كثيرًا في اتخاذ قرارات أفضل بشأن استثماراتي. المنصة سهلة الاستخدام وتوفر معلومات دقيقة مستمرة. أوصي بها بشدة لأي مستثمر يرغب في النجاح في عالم الأسواق المالية.

سميرة أحمد

Person checking stock market graphs on laptop and smartphone, focusing on financial data.
Person checking stock market graphs on laptop and smartphone, focusing on financial data.

خبراتنا ومؤهلاتنا

نحن نتمتع بخبرة واسعة في تحليل الأسواق المالية، مما يجعلنا الخيار الأمثل للمستثمرين الساعين إلى الحصول على معلومات دقيقة وموثوقة.

تحليل السوق

لدينا قدرة فريدة على تقديم تحليل معمق للأسواق المالية، مما يساعد المستثمرين على فهم الاتجاهات والتقلبات باستمرار.

بيانات دقيقة

نقدم معلومات دقيقة وحديثة عن أسعار الأسهم والأخبار الاقتصادية، لضمان اتخاذ قرارات استثمار موثوقة.

واجهة سهلة الاستخدام

نحن نوفر واجهة مستخدم مصممة بشكل مبتكر، مما يسهل على المستخدمين البحث والحصول على المعلومات التي يحتاجون إليها بسرعة وفعالية.

ابدأ استثماراتك اليوم مع تحليل الأسهم

Scroll to Top