Skip to content

R — Financial Analysis In

print(paste("Sharpe Ratio:", round(sharpe, 3))) table.AnnualizedReturns(aapl_returns) chart.RiskReturnScatter(aapl_returns) 6. Comparing Multiple Assets # Download multiple stocks tickers <- c("AAPL", "MSFT", "GOOGL", "AMZN") getSymbols(tickers, from = "2020-01-01") Combine adjusted closes prices <- do.call(merge, lapply(tickers, function(x) Cl(get(x)))) colnames(prices) <- tickers Calculate returns returns <- na.omit(Return.calculate(prices, method = "log")) Correlation matrix cor(returns) Covariance matrix (annualized) cov_annual <- cov(returns) * 252 7. Portfolio Optimization (Markowitz) Equal-Weight Portfolio # Equal weights weights_eq <- rep(1/ncol(returns), ncol(returns)) Portfolio return & risk port_return <- sum(colMeans(returns) * weights_eq) * 252 port_risk <- sqrt(t(weights_eq) % % cov_annual % % weights_eq)

cat("Expected Return:", round(port_return, 4), "\nExpected Risk:", round(port_risk, 4)) # Load PortfolioAnalytics portfolio <- portfolio.spec(assets = colnames(returns)) portfolio <- add.constraint(portfolio, "weight_sum", min_sum = 1, max_sum = 1) portfolio <- add.constraint(portfolio, "long_only") portfolio <- add.objective(portfolio, "return", name = "mean") portfolio <- add.objective(portfolio, "risk", name = "StdDev", risk_aversion = 1) Optimize opt <- optimize.portfolio(returns, portfolio, optimize_method = "ROI") print(opt) 8. Time Series Forecasting Simple Moving Average # 20-day moving average aapl_sma <- SMA(aapl_prices, n = 20) Plot price + SMA chart_Series(AAPL) add_SMA(n = 20, col = "blue") ARIMA Model for Price Prediction # Fit ARIMA on log returns model <- auto.arima(aapl_log_returns) Forecast next 10 days forecasted <- forecast(model, h = 10) autoplot(forecasted) 9. Value at Risk (VaR) Calculation # Historical VaR at 95% confidence var_historical <- quantile(aapl_returns, 0.05) Parametric VaR var_parametric <- mean(aapl_returns) + qnorm(0.05) * sd(aapl_returns) Using PerformanceAnalytics VaR(aapl_returns, p = 0.95, method = "historical") 10. Visualizing Financial Data Candlestick Chart chartSeries(AAPL, subset = "last 60 days", theme = chartTheme("black")) Return Distribution ggplot(aapl_returns, aes(x = daily.returns)) + geom_histogram(bins = 50, fill = "darkgreen", alpha = 0.7) + geom_density(color = "red", size = 1) + labs(title = "AAPL Return Distribution") Rolling Volatility rolling_sd <- rollapply(aapl_returns, width = 30, FUN = sd, fill = NA) plot(rolling_sd, main = "30-day Rolling Volatility") 11. Complete Workflow Example # Full pipeline: fetch, clean, analyze, report library(tidyverse) library(quantmod) 1. Fetch data stocks <- c("JPM", "WMT", "JNJ", "PG") getSymbols(stocks, from = "2019-01-01") 2. Combine and calculate returns returns_list <- lapply(stocks, function(s) dailyReturn(Cl(get(s)), type = "log")) returns <- do.call(merge, returns_list) colnames(returns) <- stocks 3. Annualized performance annual_ret <- colMeans(returns) * 252 annual_risk <- apply(returns, 2, sd) * sqrt(252) sharpe_ratio <- (annual_ret - 0.02) / annual_risk 4. Create summary table performance_df <- data.frame( Stock = stocks, Return = round(annual_ret, 4), Risk = round(annual_risk, 4), Sharpe = round(sharpe_ratio, 3) ) financial analysis in r

الشروط والأحكام المتعلقة بتذاكر أفلام المهرجان

• التذاكر غير قابلة للاستبدال أو الاسترجاع، ولا يجوز إعادة بيعها.
• يُضمن حجز المقعد حتى 15 دقيقة قبل موعد بدء العرض أو الندوة.
• يُسمح بدخول المتأخرين وفق تقدير إدارة القاعة.
• يرجى العلم أن البرامج والجداول والمواقع قابلة للتغيير.
• قد يُطلب إظهار ما يثبت العمر في الأفلام المقيّدة بفئة عمرية محددة.
• يُمنع منعًا باتًا استخدام أجهزة التسجيل أو التصوير في جميع العروض والندوات.
• يمكن لحاملي الشارات إلغاء حجز التذاكر حتى 60 دقيقة قبل موعد العرض عبر التطبيق أو الموقع الإلكتروني أو من خلال شبّاك التذاكر.
• التذاكر غير المُلغاة وغير المستخدمة تُحتسب تحت حكم عدم الحضور .

للاستفسارات والاقتراحات، الرجاء التواصل معنا على البريد التالي:
[email protected]

أو الاتّصال على الرقم التالي:

تنويه بشأن التصوير والتسجيل

تخضع جميع مواقع مهرجان البحر الأحمر السينمائي الدولي للتصوير الفوتوغرافي وتصوير الفيديو والتسجيلات الصوتية، ويُمكن عرض كل وأيّ مادة على وسائل التواصل الاجتماعي بغرض الإعلان والتسويق. لذلك ننوّه بأنكم وبمجرد دخولكم لِمواقع المهرجان، فأنتم توافقون على الظهور في جميع هذه المواد الإعلامية دون تعويض. 

RedSeaIFF Ticket Terms 

• Tickets are non-exchangeable, non-refundable, and cannot be resold.
• Seating is guaranteed up to 15 minutes before the start of the screening and panel.
• Late arrivals are seated at the Theatre Manager’s discretion.
• Programs, schedules, and venues are subject to change.
• Proof of age may be required for age-restricted films.
• Recording devices are strictly prohibited in all screenings and panels • Badge holders may release tickets up to 60 minutes before the screening via the app, website, or Box Office. Unreleased and unused tickets will count toward the No Show Policy.

For assistance, contact , [email protected], or reach us via the RedSeaIFF Mobile App.

 

Photography and Recording Notice

By entering any RedSeaIFF venue, guests acknowledge that photography, video, and audio recording may be taking place. All recorded material may be used by the Festival for social media, advertising, and marketing purposes. Attendance at the Festival constitutes consent to appear in such material and authorizes its use without compensation.