StockBot Trading Algo Logic - Akhi Mahiti (Full Details)

Aa document ma badhi logic samjava ma aavi che ke StockBot kaise kaam kare che, kya buy kare che, kya sell kare che and indicators no use kem thay che. Badha examples ₹10,000 na price mujab samjava ma avya che.


1. Akhi Process no Flowchart (Overall Process)

Aa flowchart batave che ke algo hamesha kevi rite market ne monitor kare che.

[Diagram]

2. Indicators ne Saheli Rite Samjo (Easy Explanation)

Agar tamne RSI, MACD, and BB technical lage che, to ahiya saheli rite samjo:

A. RSI (Relative Strength Index) - "Market nu Meter"

RSI ek meter che jo 0 thi 100 vachhe hoy che. Aa batave che ke stock sasto che ke mongho.

RSI Kalike Calculate Thay Che? (Step-by-Step)

RSI ne Last 14 Days na price change thi calculate karvaama aave che.

Step 1: 14 divas ni closing price lo:

Din Close Price Farak (Change) Type
1 ₹10,000
2 ₹10,200 +₹200 Gain
3 ₹10,100 -₹100 Loss
4 ₹10,400 +₹300 Gain
5 ₹10,300 -₹100 Loss
6 ₹10,600 +₹300 Gain
7 ₹10,500 -₹100 Loss
8 ₹10,800 +₹300 Gain
9 ₹10,700 -₹100 Loss
10 ₹11,000 +₹300 Gain
11 ₹10,900 -₹100 Loss
12 ₹11,200 +₹300 Gain
13 ₹11,000 -₹200 Loss
14 ₹11,300 +₹300 Gain

Step 2: Average Gain and Average Loss calculate karo:

Step 3: RS (Relative Strength) calculate:

RS = Average Gain ÷ Average Loss = 121.4 ÷ 50 = 2.43

Step 4: RSI Formula:

RSI = 100 − (100 ÷ (1 + RS)) RSI = 100 − (100 ÷ (1 + 2.43)) RSI = 100 − (100 ÷ 3.43) RSI = 100 − 29.15 RSI = 70.85 → Stock Overbought che! Algo Sell mate vicharse.

Conclusion: Aa 14 divas ma market hamesha upar gayo che etle RSI high (70+) aayu. Jyare market vadhare down thayu hoy tyare RSI niche (30-) aave che and algo buy karse.

B. Bollinger Bands (BB) - "Stock ni Boundary"

Vicharo ke stock ek road par chale che jeni be side boundary (dhiwal) che.

BB Kalike Calculate Thay Che? (Step-by-Step)

BB ne Last 20 Days na price thi calculate karvaama aave che.

Step 1: 20 divas ni closing price lo (simple example: ₹10,000 aaspas):

Din Close Price
1 ₹9,800
2 ₹9,900
3 ₹10,000
4 ₹10,100
5 ₹10,200
6–20 (average same rehse, baki divas ₹10,000 ni aas paas)

Step 2: Middle Band (SMA) calculate:

Middle Band = 20 divas no Average Price Middle Band = (₹9,800 + ₹9,900 + ... + ₹10,200) ÷ 20 Middle Band ≈ ₹10,000

Step 3: Standard Deviation (Volatility) calculate:

Standard Deviation batave che ke price average thi ketlu dur hatu. Aa example ma Std Dev ≈ ₹200 maniye.

Step 4: Bands calculate karo:

Upper Band = Middle Band + (2 × Std Dev) = ₹10,000 + ₹400 = **₹10,400** Lower Band = Middle Band − (2 × Std Dev) = ₹10,000 − ₹400 = **₹9,600**

Conclusion: Algo joye che ke price ₹9,600 thi niche gayo to BUY karo (Bounce aavse) and ₹10,400 thi upar gayo to SELL karo (Price padi shake che).


C. MACD - "Stock ni Speed (Momentum)"

MACD batave che ke stock ketli jhadap thi upar ya niche jai rahyu che.

MACD Kalike Calculate Thay Che? (Step-by-Step)

MACD = EMA 12 (Fast) minus EMA 26 (Slow)

Step 1: EMA 12 and EMA 26 calculate karo:

Value
EMA 12 (Fast - recent 12 divas) ₹10,300
EMA 26 (Slow - recent 26 divas) ₹10,100

Step 2: MACD Line calculate:

MACD Line = EMA12 − EMA26 = ₹10,300 − ₹10,100 = **+₹200** Positive (+) MACD = Bullish (Stock upar jai rahyu che).

Step 3: Signal Line calculate (EMA 9 of MACD):

Maan lo Signal Line = ₹150 (9 divas no average of MACD).

Step 4: Crossover check karo:

MACD Line (₹200) > Signal Line (₹150)Bullish Crossover!

Signal Matlab Algo ni Action
MACD > Signal Speed vadhi rahi che (Upward) BUY
MACD < Signal Speed ghati rahi che (Downward) Hold / Sell check

Conclusion: MACD +₹200 che and Signal ₹150 thi upar che, etle algo BUY signal aapse. Jyare MACD negative thay, tyare market niche jai rahyu hoy.


3. EMA Kalike Calculate Thay Che? (Step-by-Step)

EMA (Exponential Moving Average) = Recent divas ne vadhare weight (importance) aape che compared to simple average.

Step 1: Simple Average (SMA) pehla calculate (EMA 10 mate 10 divas ni price):

Din Close Price
1 ₹9,800
2 ₹9,900
3 ₹10,000
4 ₹10,100
5 ₹10,050
6 ₹10,200
7 ₹10,150
8 ₹10,300
9 ₹10,250
10 ₹10,400

SMA = (₹9,800 + ₹9,900 + ... + ₹10,400) ÷ 10 = **₹10,115** Pehlo EMA 10 = SMA = ₹10,115

Step 2: Multiplier (Weight) calculate:

Multiplier = 2 ÷ (Period + 1) = 2 ÷ (10 + 1) = **0.1818** (roughly 18%) Aa batave che ke aaj na price ne 18% importance malse and pachi na EMA ne 82%.

Step 3: Agla din EMA calculate karo:

Maan lo 11ma din no price ₹10,500 che. EMA = (₹10,500 × 0.1818) + (₹10,115 × 0.8182) EMA = ₹1,909 + ₹8,276 EMA 10 = ₹10,185

Number thi samjo (3 divas no example):

Din Close Price SMA (Last 5 avg) EMA (Recent ko vadhare weight)
1-4 ₹10,000 ₹10,000 ₹10,000
5 ₹10,000 ₹10,000 ₹10,000
6 (Sudden Jump!) ₹11,000 ₹10,200 (Dhire vadhyu - 5 avg) ₹10,364 (Jaldi vadhyu!)

Conclusion: SMA ne pachi rahyun, EMA jaldi react karyu. Etle StockBot EMA vapare che — Tey market ni speed pakde che!

EMA na 3 Types and tenu kaam:

EMA Period Kaam
EMA 10 Last 10 divas Fast trend. Jaldi change samje.
EMA 20 Last 20 divas Medium trend. Thodu slow.
EMA 50 Last 50 divas Major long-term trend. Bahot steady.

Conclusion:


4. EMA 10 ni Undi Mahiti (Deep Dive)

EMA 10 ek dynamic indicator che jo fast movement ne pakde che.

EMA 10 Buy Logic (Price ₹10,000 par)

EMA 10 Sell Logic (Price ₹10,000 par)


5. Buy Rules (Kharidva na Niyam) - Flowchart & Examples

Aa flowchart batave che ke algo kya conditions ma buy kare che.

[Diagram]

Type 1: Uptrend Buy (Momentum)

Type 2: Dip Buy (Oversold)

Type 3: MACD Bullish


6. Sell Rules (Vechva na Niyam) - Flowchart & Examples

Aa flowchart batave che ke algo kya conditions ma sell kare che.

[Diagram]

Type 1: Profit Booking (Peak Reversal)

Type 2: Trend Breakout (Exit)

Type 3: Stop-Loss (5% Safety)


7. Corporate Actions (Vadhare nu Return) - ₹10,000 Examples

1. Dividends (Extra Cash)

2. Stock Split (1:10 Split)

3. Bonus Issue (1:1 Bonus)


8. Enhanced Strategy (Master Logic) - Akhi Samjan

Aa Strategy Kemi Aave Che?

Jyare algo ni normal trading (EMA, RSI, MACD thi kari) "Buy & Hold" (stock khali kharidine rakhi melu) strategy karta 5% vadhare return na aape, tyare algo automatic switch kare che aa "Enhanced Strategy" par.

Example: Normal Trading Return = 12%, Buy & Hold Return = 10%. Difference = 2% only. Target 5% nahi miliyo, etle Enhanced Strategy activate!


Enhanced Strategy Kalike Kaam Kare Che? (Step-by-Step)

[Diagram]

Step-by-Step Example (₹10,000 Starting Capital)

Maan lo tame ₹10,000 thi start karyo che.

Step 1: Normal Algo Result Check

Strategy Return
Normal Algo (EMA/RSI/MACD) 8% → ₹10,800
Buy & Hold 6% → ₹10,600
Target (BH + 5%) 11% → ₹11,100

Normal Algo Return (8%) < Target (11%), etle Enhanced Strategy ON!


Step 2: Pehla Swing Trade Find Karo

Algo Day 60 thi shoru kare che and agla 45 divas ma low price shozye che:

Din Price
Day 60 ₹10,200
Day 70 ₹9,500 ← Niche (Lowest Price)
Day 80 ₹9,800
Day 90 ₹10,100

BUY at Day 70 → ₹9,500


Step 3: Jya thi Kharidyu (DIP) tya thi Agla 100 Divas joyo — Stock Unchi Kyare Hati?

Saheli Bhasha ma: Tame Day 70 par ₹9,500 ma stock kharidyu (BUY). Have algo Day 71 thi Day 170 sudhi na badha divas check kare che ke stock kyare monghu (highest price) hatu. Tya j din algao SELL kare che.

Jem bajaar ma keri kharidhi low thay tyare, and paachhi rozu juvo ke price kyare vadhare monghi thase — tya j din vechi do!

Din Price Note
Day 70 ₹9,500 Ahiya BUY karyu (Sasto)
Day 100 ₹10,500 Vadhyu pan peak nathi
Day 130 ₹11,800 Monghu! Ahiya SELL karvu
Day 150 ₹11,000 Niche aavvu shuru thay gayu
Day 170 ₹10,800 Vadhare padyu

SELL at Day 130 → ₹11,800 (Algo mongha din par j veche che)


Step 4: Profit Calculate Karo

Item Amount
Buy Price ₹9,500
Sell Price ₹11,800
Profit per Share ₹2,300
Return (₹2,300 ÷ ₹9,500) × 100 = 24.2%
Starting Balance ₹10,000
New Balance (1 share example) ₹12,300

Profit 4% thi vadhare che (24.2%), etle Trade Execute!


Step 5: Next Swing Find Karo

Pehli trade complete thai. Algo have Day 131 thi agal vadhe che and fari thi agla 45 divas ma navi Dip shozye che. Aa process repeat thay che data khalas thay tya sudhi.


Simple Logic Summary (Flowchart)

[Diagram]

Key Rules of Enhanced Strategy

Rule Detail
Start Day Day 60 (Indicators ready thay pachi)
Dip Window Agla 45 divas ma Minimum Price
Peak Window Dip thi agla 100 divas ma Maximum Price
Minimum Profit 4% vadhare hoy tabhi trade karo
If < 4% Profit 7 divas skip karo and navi dip shozho
Balance Har trade pachi compound thay che

Realistic Full Example: 3 Swings with ₹10,000

Swing Buy Price Sell Price Return Balance After
Start ₹10,000
Swing 1 ₹9,500 ₹11,800 +24.2% ₹12,420
Swing 2 ₹11,200 ₹13,500 +20.5% ₹14,967
Swing 3 ₹12,800 ₹16,000 +25.0% ₹18,708

Final Return: ₹10,000 → ₹18,708 = 87% Total Return! 🚀 Jem ek trade ni profit agala trade ma invest thay, tem Compounding thatu rehse.