Stock Analysis - Momentum

151 views
Skip to first unread message

Bert Mariani

unread,
Dec 11, 2025, 2:43:14 PM12/11/25
to The Ring Programming Language
Hello Azzedine, Mahmoud

Attached:
 StockAnalysis-BM.ring       // Main Program
 StockYearlyReturns.ring
 StockDrawChart.ring

 Quotes.ini                         
  // Tickers
 Quotes-Mega-32.ini
 Quotes-Mega-62.ini
 Quotes-Mega-160.ini

 AppIcon.png

 AAA-Spread.csv                // Fetch Ticker Data saved.

The Stock Tickers can be found at: 

To RUN the App
     -  Start  StockAnalysis-BM.ring    
     -  Click "Get Quotes"     fetches the historical data for the list of Tickers
     -  Click "Run Analysis"  invokes the algorithn to select the top stocks

Theory
     Based on Current Month  minus Month-7 prices
     Calc the Performance of each Stock
     Sort the Performance for every Month moving forward
     Buy the Stocks that are Ranked as the Top10  List  next month
     Sell if the Stock is Below the Top10
     Repeat Once a Month.

Analysis
     Showed that Buy the Top-7 stocks based on the
      Performance over a Period of 7 Month gives balanced results.

Caveat:
     Past Performance does NOT imply Future Performance.

Playing With Parms
     First - Download data  with  "Get Quotes"  button
     Second - Analyses data with  "Run Analysis" button

     The Parameters for TopTen (7)  and RangeMth (7) can be changed
      And the "Run Analysis" button will show the Results.

Debugging  flag can be TOOGLED  using the "DEBUG"  drop down
     "Array-Data"    
    "Performance"  
     "Sort"          
     "Sort-Name"    
     "Rank"          
     "Buy-Price"    
      "Gain"          
      "Monthly-Perf"  
     "Compound"      
     "Summary-Stock"
     "Summary-Total"
     "Show-Top10"    
      "Gain-Details"  

TRUST BUT VERIFY !!!

=======================================
Quotes-Mega-62.ini     Top = 7     RangeMth = 7

StockAnalysisChart-1.png

     


Quotes-Mega-62.ini
AppIcon.png
Quotes-Mega-160.ini
Quotes.ini
AAA-Spread.csv
StockAnalysis-BM.ring
Quotes-Mega-32.ini
StockDrawChart.ring
StockYearlyReturns.ring

Mahmoud Fayed

unread,
Dec 11, 2025, 6:20:52 PM12/11/25
to The Ring Programming Language
Hello Bert

Thank you very much for sharing :D

Providing a RingPM Package will be much easier for installing/testing and getting updates 

Greetings,
Mahmoud

Azzeddine Remmal

unread,
Dec 11, 2025, 7:32:00 PM12/11/25
to The Ring Programming Language
Hello Bert

Great app updates
Thank you very much for sharing

Best regards

Bert Mariani

unread,
Dec 13, 2025, 12:07:10 PM12/13/25
to The Ring Programming Language
Hello Mahmoud et ALL

StockAnalysis-BM   App

Files uploaded to Git Hub
RingPM created.

GitHub:  Files
     https://github.com/umariani/StockAnalisis-BM

Package Manager:  Install on Ring
      ringpm install StockAnalysis-BM from umariani

Ring Directory
      C:\ring\tools\ringpm\packages\StockAnalisis\StockAlalysis-BM.ring

( Comment:  Tedious and convoluted. )

Mahmoud Fayed

unread,
Dec 13, 2025, 11:04:56 PM12/13/25
to The Ring Programming Language
Hello Bert

>> "  ringpm install StockAnalysis-BM from umariani"

This doesn't work, you need to add (package.ring) file to the project folder, so RingPM can install the package


You can start by opening the project folder then typing the next command
ringpm package

This will create package.ring

Also, You can check the package for StockAnalysis project (before your updates): ringpackages/stockanalysis: StockAnalysis package for the Ring programming language


The package is designed to install the files in ring/applications/stockanalysis folder: stockanalysis/applications/stockanalysis at main · ringpackages/stockanalysis

So, you can update your package to install the files in ring/applications/sockanalysis-bm folder

Greetings,
Mahmoud

Bert Mariani

unread,
Dec 14, 2025, 8:51:15 AM12/14/25
to The Ring Programming Language
Hello Mahmoud

I had followed the steps in my notes.
At the end the Files all showed up in -- 
          C:\ring\tools\ringpm\packages\StockAnalisis\StockAlalysis-BM.ring
So I thought it worked

I think a separate  more step-by-step procedure is needed in the Ring Documentation
First an overall summary then detailed section
     - Stating with  File A B and C .ring   etc  in the Laptop Directory
     - What to do in GitHub ( Adding, Deleting, Rename )
     - What to do back in the Laptop
     - The back and forth between  GitHub,  Ring Commands,  Laptop Directory
     - What files to edit/modify when in the Steps

       - EDIT......:  package.ring
         Remove:  lib.ring
         Remove:  Main.ring
         Change:  :run to    :run = "ring CodeFormatter.ring",
         Update:  Version in 2 Places

| Steps  ==>   Laptop Directory   <==>   GitHub  |<==>   Ring Commands and Editing  |


Bert Mariani

unread,
Dec 14, 2025, 9:30:56 AM12/14/25
to The Ring Programming Language
Hello Mahmoud

Added  "package.ring"     (that was on my Laptop Directory from yesterday)
     From:  Laptop/Directory
     To:      GitHub  --  StockAnalisis-BM  repertoire 

AddPackage-1.png

Mahmoud Fayed

unread,
Dec 14, 2025, 9:50:16 PM12/14/25
to The Ring Programming Language
Hello Bert

There are missing files, I get the next output when trying to install the package using RingPM

error.png

Also, file name (StockAnalyis-BM.bat) miss the (s) character, i.e. StockAnalysis-BM.bat

Greetings,
Mahmoud

Bert Mariani

unread,
Dec 15, 2025, 11:27:03 AM12/15/25
to The Ring Programming Language
Hello Mahmoud

I deleted the Old GitHub repertoire and started from scratch

Did ALL the ring commands in my Laptop Directory
Edited all the file contents
Then connected to GitHub
Created the New repertoire and uploaded ALL the files. 

c:\>ringpm install Stock-Analysis-BM from umariani

Installing Stock-Analysis-BM (master) ---> Stock-Analysis-BM (1.0.0)
Download Package Files For Stock-Analysis-BM
Download File : AAA-Spread.csv
Download File : AppIcon.png
Download File : Quotes-Mega-160.ini
Download File : Quotes-Mega-250.ini
Download File : Quotes-Mega-32.ini
Download File : Quotes-Mega-500.ini
Download File : Quotes-Mega-62.ini
Download File : Quotes-Mega-900.ini
Download File : Quotes.ini
Download File : Stock-Analysis-BM.bat
Download File : Stock-Analysis-BM.ring
Download File : Stock-Analysis-Chart-1.png
Download File : Stock-DrawChart.ring
Download File : Stock-YearlyReturns.ring

Mahmoud Fayed

unread,
Dec 15, 2025, 11:55:16 AM12/15/25
to The Ring Programming Language
Hello Bert

Very nice, work as expected :D

Suggestion: Update the README.md file to explain installing the app using RingPM

stock.png

Greetings,
Mahmoud

Bert Mariani

unread,
Dec 15, 2025, 5:51:45 PM12/15/25
to The Ring Programming Language
Hello Mahmoud, Azzeddine

Updated the GuiHub  ReadMe.

Many thanks to Azzeddine for:
   -  The Look of the QT Display !
   -  Chart display code

Azzeddine Remmal

unread,
Dec 15, 2025, 6:08:54 PM12/15/25
to The Ring Programming Language
Hello Bert.

You're welcome.
I believe that helping each other as team members is a sacred duty.

Best regards.Azzeddine

Bert Mariani

unread,
May 11, 2026, 4:46:43 PM (4 days ago) May 11
to The Ring Programming Language
Hello Azzeddine

How can I increase the font size in your Stock Analysis Pro - Ring Edition program ?
Specifically the output in the "Analysis Log" panel.
The Edit Boxes and Labels too.

StockAnalysis-Snap1.png

Azzeddine Remmal

unread,
May 11, 2026, 6:24:28 PM (4 days ago) May 11
to The Ring Programming Language
Hello Bert

You can adjust the font size of any element by adding the CSS value `font-size: 20px;` 
if it exists in the variable `C_STYLE_DARK`,
 or by adding it like  Analysis Log  :

C_STYLE_DARK = "
    QWidget {
        background-color: #2b2b2b;
        color: #ffffff;
        font-family: 'Segoe UI', sans-serif;
        font-size: 14px;
    }
    QPushButton {
        background-color: #007acc;
        border: none;
        padding: 12px 20px; /* Increased padding for larger buttons */
        border-radius: 4px;
        color: white;
        font-weight: bold;
        font-size: 20px;
        min-height: 40px; /* force height */
    }
    QPushButton:hover {
        background-color: #005999;
    }
    QPushButton:pressed {
        background-color: #004080;
    }
    QLineEdit, QComboBox {
        background-color: #3c3c3c;
        border: 1px solid #555;
        padding: 4px;
        border-radius: 3px;
        color: white;
        font-size: 18px;
    }
    QFrame {
        border: 1px solid #555;
        border-radius: 5px;
        margin-top: 10px;
        padding: 5px;
        background-color: #333;
        font-size: 20px;
    }
    QLabel {
        font-weight: bold;
        color: #cccccc;
        font-size: 20px;
    }
    QTextEdit {
        background-color: #3c3c3c;
        border: 1px solid #555;
        padding: 4px;
        border-radius: 3px;
        color: white;
        font-size: 20px;
    }
   
"

Capture1.PNG

Regards, Azzedine

Bert Mariani

unread,
May 12, 2026, 11:26:58 PM (2 days ago) May 12
to The Ring Programming Language
Thanks Azzeddine !!
I had to do ....

==================================
# Left: Data/Log
groupData = new QFrame(win,0) {
    setFrameShape(QFrame_StyledPanel)
    frameLayout = new QVBoxLayout() {
        lblTitle = new QLabel(win) {
            setText("Analysis Log")
            setStyleSheet("color: #007acc; font-weight: bold;font-size: 14px;")
        }
        addWidget(lblTitle)

        txtLog = new QTextEdit(win){setReadOnly(true)setStyleSheet("font-size: 14px;")setText("Ready to start...")}
        addWidget(txtLog)
    }
    setLayout(frameLayout)
}

=====================================

Snap1.png

Bert Mariani

unread,
May 14, 2026, 5:17:51 PM (16 hours ago) May 14
to The Ring Programming Language
Hello Azzeddine, Mahmoud et ALL

Updated: Stock-Analysis-BM.ring
                  ringpm install Stock-Analysis-BM from umariani

==================
Run 
      Use Ring Notepad
      C:/ring/tools/ringpm/packages/Stock-Analysis-BM/Stock-Analysis-BM.ring
OR
      cd C:\Stock-Analysis-BM
      ring.exe  Stock-Analysis-BM.ring

Using
     Click "Get Quotes" button
     Wait for download to finish
     Click "Run Analysis"

     After it is finished drawing, wait a few seconds for Tab processes to finish.
     Tabs - Overview
                 Yearly vs QQQ
                 Algorithm Grid
                 Buy History
                 Stock Contributions
            
==============================
Download

c:\ring>ringpm remove Stock-Analysis-BM from umariani
Deleting Stock-Analysis-BM

c:\ring>ringpm install Stock-Analysis-BM from umariani

Installing Stock-Analysis-BM (master) ---> Stock-Analysis-BM (1.0.0)
Download Package Files For Stock-Analysis-BM
Download File : AAA-Spread.csv
Download File : AppIcon.png
Download File : Quotes-Mega-160.ini
Download File : Quotes-Mega-250.ini
Download File : Quotes-Mega-32.ini
Download File : Quotes-Mega-500.ini
Download File : Quotes-Mega-62.ini
Download File : Quotes-Mega-900.ini
Download File : Quotes.ini
Download File : Stock-Analysis-Chart-1.png

Download File : Stock-Analysis-BM.bat
Download File : Stock-Analysis-BM.ring
Download File : Stock-DrawChart.ring
Download File : Stock-YearlyReturns.ring
Download File : Stock-AlgoGrid.ring
Download File : Stock-BuyHistory.ring
Download File : Stock-StockContrib.ring
Download File : Stock-YearlyVsQQQ.ring

c:\ring>
=======================================
SCREEM CAPTURES - 1 for each Tab

image.png

image (1).png

image (2).png
image (3).png
image (4).png

Mahmoud Fayed

unread,
May 14, 2026, 6:33:42 PM (15 hours ago) May 14
to The Ring Programming Language
Hello Bert

The screen shots are attractive and beautiful :D
GREAT WORK :D

Greetings,
Mahmoud

Reply all
Reply to author
Forward
0 new messages